test/Makefile

changeset 2447
ef851705e3e1
parent 1391
7de830a4c219
child 2458
daa47f8cf745
equal deleted inserted replaced
2446:d932feeb203d 2447:ef851705e3e1
48 else \ 48 else \
49 echo "WARNING: No testing done, directory does not exist: $1"; \ 49 echo "WARNING: No testing done, directory does not exist: $1"; \
50 fi 50 fi
51 endef 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 # Default test target (core) 69 # Default test target (core)
54 default: jdk_core langtools_jtreg 70 default: jdk_core langtools_jtreg
55 71
56 # All testing 72 # All testing
57 all: jdk_all langtools_all 73 all: jdk_all langtools_all
58 74
59 # Test targets 75 # Test targets
60 langtools_% : 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 jdk_% core_%s svc_%: 79 jdk_% core_%s svc_%:
64 @$(NO_STOPPING)$(call SUBDIR_TEST, $(JDK_DIR), TEST="$@" $@) 80 @$(NO_STOPPING)$(call SUBDIR_TEST, $(JDK_DIR), TEST="$@" $@)
65 81
66 hotspot_%: 82 hotspot_%:
67 @$(NO_STOPPING)$(call SUBDIR_TEST, $(HOTSPOT_DIR), TEST="$@" $@) 83 @$(NO_STOPPING)$(call SUBDIR_TEST, $(HOTSPOT_DIR), TEST="$@" $@)
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 "")
68 113
69 # 114 #
70 # jtreg_tests 115 # jtreg_tests
71 # 116 #
72 # Invocation: 117 # Invocation:
93 @$(NO_STOPPING)$(call SUBDIR_TEST, $(TOPDIR)/$(COMPONENT), TESTDIRS=$(TESTDIRS_TESTS) $@) 138 @$(NO_STOPPING)$(call SUBDIR_TEST, $(TOPDIR)/$(COMPONENT), TESTDIRS=$(TESTDIRS_TESTS) $@)
94 139
95 ################################################################ 140 ################################################################
96 141
97 # Phony targets (e.g. these are not filenames) 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 ################################################################

mercurial