cogl/tests: Use tmp file to dump test results

When running installed tests, the working directory for Cogl
tests is /usr/libexec/installed-tests/mutter-cogl-4/conform,
which isn't writable by normal users.

To avoid the adding stray hidden files to the current directory,
adapt the runner script to fallback to $(mktemp) - which is
available on all platform we care about - and avoid adding
hidden files everywhere.
This commit is contained in:
Georges Basile Stavracas Neto 2018-12-17 13:12:29 -02:00
parent 981b045459
commit 05ab8eebe8
No known key found for this signature in database
GPG Key ID: 886C17EE170D1385

View File

@ -21,6 +21,8 @@ shift
set +m set +m
LOG=$(mktemp)
trap "" ERR trap "" ERR
trap "" SIGABRT trap "" SIGABRT
trap "" SIGFPE trap "" SIGFPE
@ -65,17 +67,17 @@ get_status()
run_test() run_test()
{ {
$("$TEST_BINARY" "$1" &>.log) $("$TEST_BINARY" "$1" &> "$LOG")
TMP=$? TMP=$?
var_name=$2_result var_name=$2_result
eval "$var_name=$TMP" eval "$var_name=$TMP"
if grep -q "$MISSING_FEATURE" .log; then if grep -q "$MISSING_FEATURE" "$LOG"; then
if test "$TMP" -ne 0; then if test "$TMP" -ne 0; then
eval "$var_name=500" eval "$var_name=500"
else else
eval "$var_name=400" eval "$var_name=400"
fi fi
elif grep -q "$KNOWN_FAILURE" .log; then elif grep -q "$KNOWN_FAILURE" "$LOG"; then
if test $TMP -ne 0; then if test $TMP -ne 0; then
eval "$var_name=300" eval "$var_name=300"
else else
@ -156,4 +158,6 @@ do
echo "" echo ""
done done
rm "$LOG"
exit "$EXIT" exit "$EXIT"