diff options
author | Georges Basile Stavracas Neto <georges.stavracas@gmail.com> | 2018-12-17 13:12:29 -0200 |
---|---|---|
committer | Simon McVittie <smcv@debian.org> | 2020-03-09 16:36:03 +0000 |
commit | ab9a62b0f7e7786a92b2e7bc9eca1ad052f6c586 (patch) | |
tree | d06f091b6c4624ac760c6dfe05e04c2f3199a683 | |
parent | 95342464a8912861f43f9aa3addf4f48a0518d8c (diff) | |
download | cogl-ab9a62b0f7e7786a92b2e7bc9eca1ad052f6c586.tar.gz |
tests: Use tmp file to dump test results
When running installed tests, the working directory for Cogl tests is
in /usr/libexec/installed-tests, 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.
(Originally commit 05ab8eebe8f37d437fb915a2dafe0c0bb68e3950 in mutter's
fork of cogl.)
-rwxr-xr-x | tests/run-tests.sh | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/run-tests.sh b/tests/run-tests.sh index 7e62bf0f..763e173b 100755 --- a/tests/run-tests.sh +++ b/tests/run-tests.sh @@ -18,6 +18,8 @@ shift set +m +LOG=$(mktemp) + trap "" ERR trap "" SIGABRT trap "" SIGFPE @@ -62,17 +64,17 @@ get_status() run_test() { - $($TEST_BINARY $1 &>.log) + $($TEST_BINARY $1 &> "$LOG") TMP=$? var_name=$2_result eval $var_name=$TMP - if grep -q "$MISSING_FEATURE" .log; then + if grep -q "$MISSING_FEATURE" "$LOG"; then if test $TMP -ne 0; then eval $var_name=500 else eval $var_name=400 fi - elif grep -q "$KNOWN_FAILURE" .log; then + elif grep -q "$KNOWN_FAILURE" "$LOG"; then if test $TMP -ne 0; then eval $var_name=300 else @@ -154,4 +156,6 @@ do echo "" done +rm "$LOG" + exit $EXIT |