From: Francisco Casas fcasas@codeweavers.com
--- tests/test-driver.sh | 52 +++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 49 insertions(+), 3 deletions(-)
diff --git a/tests/test-driver.sh b/tests/test-driver.sh index 97b6ea3ef..cab967da0 100755 --- a/tests/test-driver.sh +++ b/tests/test-driver.sh @@ -1,8 +1,11 @@ #! /bin/sh -# test-driver - basic testsuite driver script. +# test-driver - basic testsuite driver script. Modified for vkd3d tests.
-scriptversion=2022-02-13.00; # UTC +scriptversion=2022-02-20.01; # UTC
+# This is a modified version of the test_driver script provided by +# auto-tools, whose licence is as follows: +# # Copyright (C) 2011-2021 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify @@ -133,8 +136,51 @@ esac # file (automake bug#11814). echo "$res $test_name (exit status: $estatus)" >>"$log_file"
+# Give detailed report +awk_program=$(cat <<'EOF' +BEGIN { + FS = ":" +} + +/: Compiling \S+ shaders with \S+ and executing with \S+/ { + n = split($3, arr, " ") + str = "(" arr[2] ")"arr[n] + printf("# [0;2m%-20s [m\n", str) +} + +/: Test failed:/ { + print $4 "[1;31m[F][m" +} + +/: Todo:/ { + print $4 "[2;32m[XF][m" +} + +/: Todo succeeded:/ { + print $4 "[1;31m[XF][m" +} + +/: Assertion .* failed./ { + print "[1;31m[AF][m" $0 +} + +END { + printf("#") +} + +EOF +) + +# Only attach details to tests that don't PASS +# If we disable this check, we will see all the [XF] on tests that PASS. +if [ "$res" != "PASS" ]; then + details=$(awk "$awk_program" "$log_file" | tr '\n' ' ' | tr '#' '\n' | awk 'NF != 2') +else + details="" +fi + # Report outcome to console. -echo "${col}${res}${std}: $test_name" +echo "${col}${res}${std}: $test_name $details"
# Register the test result, and other relevant metadata. echo ":test-result: $res" > $trs_file