Some times the test can be aborted for reasons others than failed assertions, such as segmentation faults or reaching unreacheable code.
To speed up noticing these problems, the `[SIGABRT]` and `[SIGSEGV]` tags are printed on the corresponding exit codes.
Also, "reached unreachable code" lines are also detected and printed with an [AF] tag.
An error may look like this:
``` FAIL: tests/hlsl/some-test.shader_test (SM4.0-SM5.1)OpenGL/SPIR-V 43[XF] 79[XF] 126[XF] 149[XF] 159[XF] [AF] vkd3d/libs/vkd3d-shader/hlsl.c:246: Aborting, reached unreachable code. [SIGABRT] Aborted (core dumped) ```
From: Francisco Casas fcasas@codeweavers.com
Some times the test can be aborted for reasons others than failed assertions, such as segmentation faults or reaching unreacheable code.
This commit adds purple tags to the test driver for visual clarity. --- tests/test-driver.sh | 11 +++++++++++ 1 file changed, 11 insertions(+)
diff --git a/tests/test-driver.sh b/tests/test-driver.sh index 221a963e5..514e38d35 100755 --- a/tests/test-driver.sh +++ b/tests/test-driver.sh @@ -182,6 +182,15 @@ EOF
details=$(awk "$awk_program" "$log_file")
+# In case of SIGABRT or SIGSEGV, add tag and print second to last line, containing the +# "(core dumped)" message. +nxt_to_last_line=$(tail -n2 "$log_file" | head -n -1) +if [ "$tweaked_estatus" -eq 134 ]; then + details="$details# [SIGABRT] <fade>$nxt_to_last_line<reset>" +elif [ "$tweaked_estatus" -eq 139 ]; then + details="$details# [SIGSEGV] <fade>$nxt_to_last_line<reset>" +fi + # Count number of [XF] tags. xfcount=$(echo "$details" | awk '/[XF]/{count++} END{printf "%d", count}')
@@ -190,6 +199,8 @@ details=$(echo "$details" |\ sed "s/[XF]/$color_yellow[XF]$color_reset/g" |\ sed "s/[XP]/$color_dark_red[XP]$color_reset/g" |\ sed "s/[AF]/$color_bright_purple[AF]$color_reset/g" |\ + sed "s/[SIGABRT]/$color_bright_purple[SIGABRT]$color_reset/g" |\ + sed "s/[SIGSEGV]/$color_bright_purple[SIGSEGV]$color_reset/g" |\ sed "s/<fade>/$color_fade/g" |\ sed "s/<reset>/$color_reset/g" |\ tr '\n' ' ' |\
From: Francisco Casas fcasas@codeweavers.com
With this, a test that fails because vkd3d_unreacheable() was hit, will now display the error line.
FAIL: tests/hlsl/some-test.shader_test (SM4.0-SM5.1)OpenGL/SPIR-V 43[XF] 79[XF] 126[XF] 149[XF] 159[XF] [AF] vkd3d/libs/vkd3d-shader/hlsl.c:246: Aborting, reached unreachable code. [SIGABRT] Aborted (core dumped) --- tests/test-driver.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/tests/test-driver.sh b/tests/test-driver.sh index 514e38d35..869cc4bee 100755 --- a/tests/test-driver.sh +++ b/tests/test-driver.sh @@ -174,7 +174,11 @@ BEGIN { }
/: Assertion .* failed./ { - print "[AF]" $0 + print "# [AF] <fade>" $0 "<reset>" +} + +/: Aborting, reached unreachable code./ { + print "# [AF] <fade>" $0 "<reset>" }
EOF
This merge request was approved by Henri Verbeet.