[mutter/wip/smcv/cogl-show-test-output] cogl tests: Show the actual output from tests if VERBOSE is set
- From: Simon McVittie <smcv src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/smcv/cogl-show-test-output] cogl tests: Show the actual output from tests if VERBOSE is set
- Date: Wed, 27 May 2020 14:46:26 +0000 (UTC)
commit 2ff68e3b159a2c0d7c4c9ae7e30ab53a4656496d
Author: Simon McVittie <smcv debian org>
Date: Sat Aug 24 15:37:29 2019 +0100
cogl tests: Show the actual output from tests if VERBOSE is set
Writing tests' output to a log file makes them difficult to debug when
the test might be running on an autobuilder or CI system where only
stdout/stderr are recorded. This is particularly troublesome if a
failure is only reproducible on a particular autobuilder.
Recent Automake versions have the convention that detailed output from
failing tests is written to stdout/stderr, not just to log files, when
the VERBOSE environment variable is set; borrow that convention as a
trigger for producing detailed test output.
This was originally cogl!14, but applies equally to mutter's fork of cogl.
Signed-off-by: Simon McVittie <smcv debian org>
cogl/tests/run-tests.sh | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
---
diff --git a/cogl/tests/run-tests.sh b/cogl/tests/run-tests.sh
index 825dd12519..ce7580fbe9 100755
--- a/cogl/tests/run-tests.sh
+++ b/cogl/tests/run-tests.sh
@@ -1,5 +1,7 @@
#!/usr/bin/env bash
+set -o pipefail
+
if test -z "$G_DEBUG"; then
G_DEBUG=fatal-warnings
else
@@ -69,7 +71,12 @@ get_status()
run_test()
{
- $("$TEST_BINARY" "$1" &> "$LOG")
+ if [ -n "${VERBOSE-}" ]; then
+ echo "running $TEST_BINARY $1:"
+ $TEST_BINARY $1 2>&1 | tee "$LOG"
+ else
+ $($TEST_BINARY $1 &> "$LOG")
+ fi
TMP=$?
var_name=$2_result
eval "$var_name=$TMP"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]