@@ -50,6 +50,22 @@ else \
50
50
fi
51
51
endef
52
52
53
+ # Macro to print a summary for a given test subdirectory
54
+ define SUBDIR_SUMMARY # subdirectory to print summary
55
+ if [ -d $1 ] ; then \
56
+ if [ -r $1/Stats.txt ] ; then \
57
+ cat $1/Stats.txt; \
58
+ echo ""; \
59
+ else \
60
+ echo "ERROR: File does not exist: $1/Stats.txt"; \
61
+ exit 1; \
62
+ fi; \
63
+ else \
64
+ echo "WARNING: Expected directory does not exist: $1"; \
65
+ echo " Test summary might be incorrect."; \
66
+ fi
67
+ endef
68
+
53
69
# Default test target (core)
54
70
default : jdk_core langtools_jtreg
55
71
@@ -58,14 +74,43 @@ all: jdk_all langtools_all
58
74
59
75
# Test targets
60
76
langtools_% :
61
- @$(NO_STOPPING )$(call SUBDIR_TEST, $(LANGTOOLS_DIR ) , JT_JAVA=$(PRODUCT_HOME ) JTREG_HOME=$(JT_HOME ) TEST="$(subst langtools_,,$@ ) " $(subst langtools_,,$@ ) )
77
+ @$(NO_STOPPING )$(call SUBDIR_TEST, $(LANGTOOLS_DIR ) , JT_JAVA=$(PRODUCT_HOME ) JTREG_HOME=$(JT_HOME ) UNIQUE_DIR=" $@ " TEST="$(subst langtools_,,$@ ) " $(subst langtools_,,$@ ) )
62
78
63
79
jdk_% core_% s svc_% :
64
80
@$(NO_STOPPING )$(call SUBDIR_TEST, $(JDK_DIR ) , TEST="$@ " $@ )
65
81
66
82
hotspot_% :
67
83
@$(NO_STOPPING )$(call SUBDIR_TEST, $(HOTSPOT_DIR ) , TEST="$@ " $@ )
68
84
85
+ # Variables for tier1 testing
86
+ TIER1_TESTOUTPUT ="$(ALT_OUTPUTDIR ) /testoutput"
87
+ TIER1_STATUS_FILE ="$(TIER1_TESTOUTPUT ) /tier1_exitcode.txt"
88
+
89
+ # Note: Test failures are handled via summary_tier1 as the
90
+ # tier1 targets are never aborted even if tests fail.
91
+ tier1 : prep_tier1 jdk_tier1 langtools_tier1 hotspot_tier1 summary_tier1
92
+
93
+ prep_tier1 :
94
+ @rm -rf $(TIER1_STATUS_FILE )
95
+
96
+ # This relies on jdk_tier1, langtools_tier1, hotspot_tier1 producing
97
+ # Stats.txt (summary) and exitcode.txt files.
98
+ summary_tier1 :
99
+ @ (EXIT_VAL=0; \
100
+ echo " " ; \
101
+ echo " -------------- Test Summary ------------" ; \
102
+ echo " " ; \
103
+ for test_dir in $$ (find " $( ALT_OUTPUTDIR) " -type d -name \* _tier1); do \
104
+ $(call SUBDIR_SUMMARY, $${test_dir}) ; \
105
+ EXIT_VAL=$$(expr $${EXIT_VAL} + $$(cat $${test_dir}/exitcode.txt ) ) ; \
106
+ done ; \
107
+ echo $$ {EXIT_VAL} > $(TIER1_STATUS_FILE ) ; \
108
+ echo " For details see:" ; \
109
+ echo $(TIER1_TESTOUTPUT ) ; \
110
+ echo " " ; \
111
+ echo " -------------- Test Summary ------------" ; \
112
+ echo " " )
113
+
69
114
#
70
115
# jtreg_tests
71
116
#
@@ -95,6 +140,6 @@ jtreg_tests:
95
140
# ###############################################################
96
141
97
142
# Phony targets (e.g. these are not filenames)
98
- .PHONY : all clean
143
+ .PHONY : all clean summary_tier1 prep_tier1
99
144
100
145
# ###############################################################
0 commit comments