changeset 47271:0b347d8efb40

8187672: RunTest displays broken output if jtreg fails completely Reviewed-by: erikj, tbell
author ihse
date Mon, 25 Sep 2017 11:52:40 +0200
parents 4bfce39946ba
children be020513a185
files make/RunTests.gmk
diffstat 1 files changed, 21 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/make/RunTests.gmk	Mon Sep 25 11:50:39 2017 +0200
+++ b/make/RunTests.gmk	Mon Sep 25 11:52:40 2017 +0200
@@ -392,20 +392,27 @@
 	$$(call LogWarn, Finished running test '$$($1_TEST)')
 	$$(call LogWarn, Test report is stored in $$(strip \
 	    $$(subst $$(TOPDIR)/, , $$($1_TEST_RESULTS_DIR))))
-	$$(eval $1_PASSED := $$(shell $$(AWK) '{ gsub(/[,;]/, ""); \
-	    for (i=1; i<=NF; i++) { if ($$$$i == "passed:") \
-	    print $$$$(i+1) } }' $$($1_RESULT_FILE)))
-	$$(if $$($1_PASSED), , $$(eval $1_PASSED := 0))
-	$$(eval $1_FAILED := $$(shell $$(AWK) '{gsub(/[,;]/, ""); \
-	    for (i=1; i<=NF; i++) { if ($$$$i == "failed:") \
-	    print $$$$(i+1) } }' $$($1_RESULT_FILE)))
-	$$(if $$($1_FAILED), , $$(eval $1_FAILED := 0))
-	$$(eval $1_ERROR := $$(shell $$(AWK) '{gsub(/[,;]/, ""); \
-	    for (i=1; i<=NF; i++) { if ($$$$i == "error:") \
-	    print $$$$(i+1) } }' $$($1_RESULT_FILE)))
-	$$(if $$($1_ERROR), , $$(eval $1_ERROR := 0))
-	$$(eval $1_TOTAL := $$(shell \
-	    $$(EXPR) $$($1_PASSED) + $$($1_FAILED) + $$($1_ERROR)))
+	$$(if  $$(wildcard $$($1_RESULT_FILE)), \
+	  $$(eval $1_PASSED := $$(shell $$(AWK) '{ gsub(/[,;]/, ""); \
+	      for (i=1; i<=NF; i++) { if ($$$$i == "passed:") \
+	      print $$$$(i+1) } }' $$($1_RESULT_FILE))) \
+	  $$(if $$($1_PASSED), , $$(eval $1_PASSED := 0)) \
+	  $$(eval $1_FAILED := $$(shell $$(AWK) '{gsub(/[,;]/, ""); \
+	      for (i=1; i<=NF; i++) { if ($$$$i == "failed:") \
+	      print $$$$(i+1) } }' $$($1_RESULT_FILE))) \
+	  $$(if $$($1_FAILED), , $$(eval $1_FAILED := 0)) \
+	  $$(eval $1_ERROR := $$(shell $$(AWK) '{gsub(/[,;]/, ""); \
+	      for (i=1; i<=NF; i++) { if ($$$$i == "error:") \
+	      print $$$$(i+1) } }' $$($1_RESULT_FILE))) \
+	  $$(if $$($1_ERROR), , $$(eval $1_ERROR := 0)) \
+	  $$(eval $1_TOTAL := $$(shell \
+	      $$(EXPR) $$($1_PASSED) + $$($1_FAILED) + $$($1_ERROR))) \
+	, \
+	  $$(eval $1_PASSED := 0) \
+	  $$(eval $1_FAILED := 0) \
+	  $$(eval $1_ERROR := 1) \
+	  $$(eval $1_TOTAL := 1) \
+	)
 
   $1: run-test-$1 parse-test-$1