[njs] Tests: improved test262 output when a test fails.

Dmitry Volyntsev xeioex at nginx.com
Wed Dec 22 16:55:13 UTC 2021


details:   https://hg.nginx.org/njs/rev/8843d18bee30
branches:  
changeset: 1777:8843d18bee30
user:      Dmitry Volyntsev <xeioex at nginx.com>
date:      Wed Dec 22 16:54:27 2021 +0000
description:
Tests: improved test262 output when a test fails.

diffstat:

 test/report  |  1 +
 test/setup   |  3 +++
 test/test262 |  6 +++---
 3 files changed, 7 insertions(+), 3 deletions(-)

diffs (54 lines):

diff -r dd2386828c1c -r 8843d18bee30 test/report
--- a/test/report	Wed Dec 22 16:54:13 2021 +0000
+++ b/test/report	Wed Dec 22 16:54:27 2021 +0000
@@ -9,6 +9,7 @@ if [ $njs_passed -ne $njs_total ]; then
 fi
 
 if [ -n "$njs_failed_list" ]; then
+    printf "\n"
     for t in $njs_failed_list; do
         printf "$t FAILED\n"
     done
diff -r dd2386828c1c -r 8843d18bee30 test/setup
--- a/test/setup	Wed Dec 22 16:54:13 2021 +0000
+++ b/test/setup	Wed Dec 22 16:54:27 2021 +0000
@@ -17,6 +17,9 @@ passed() {
 failed() {
     njs_failed_list="$njs_failed_list $1"
     verbose " FAILED\n"
+    printf "$1:\n"
+    cat $2
+    printf "\n"
 }
 
 verbose "Test dir: $NJS_TEST_DIR\n"
diff -r dd2386828c1c -r 8843d18bee30 test/test262
--- a/test/test262	Wed Dec 22 16:54:13 2021 +0000
+++ b/test/test262	Wed Dec 22 16:54:27 2021 +0000
@@ -34,7 +34,7 @@ END
 
         elif [ $njs_async = yes ]; then
             if [ "$njs_out" != 'Test262:AsyncTestComplete' ]; then
-                failed $njs_test
+                failed $njs_test $njs_log
 
             else
                 passed $njs_test
@@ -42,7 +42,7 @@ END
 
         else
             if [ -n "$njs_out" ]; then
-                failed $njs_test
+                failed $njs_test $njs_log
 
             else
                 passed $njs_test
@@ -54,7 +54,7 @@ END
             passed $njs_test
 
         else
-            failed $njs_test
+            failed $njs_test $njs_log
         fi
     fi
 


More information about the nginx-devel mailing list