8187672: RunTest displays broken output if jtreg fails completely
authorihse
Mon, 25 Sep 2017 11:52:40 +0200
changeset 47259 0b347d8efb40
parent 47258 4bfce39946ba
child 47260 be020513a185
8187672: RunTest displays broken output if jtreg fails completely Reviewed-by: erikj, tbell
make/RunTests.gmk
--- 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