1 #
2 # Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 #
5 # This code is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU General Public License version 2 only, as
7 # published by the Free Software Foundation.
8 #
9 # This code is distributed in the hope that it will be useful, but WITHOUT
10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 # version 2 for more details (a copy is included in the LICENSE file that
13 # accompanied this code).
14 #
15 # You should have received a copy of the GNU General Public License version
16 # 2 along with this work; if not, write to the Free Software Foundation,
17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 #
19 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 # or visit www.oracle.com if you need additional information or have any
21 # questions.
22 #
131
132 # Expect JPRT to set PRODUCT_HOME (the product or jdk in this case to test)
133 ifndef PRODUCT_HOME
134 # Try to use j2sdk-image if it exists
135 ABS_JDK_IMAGE = $(ABS_BUILD_ROOT)/j2sdk-image
136 PRODUCT_HOME := \
137 $(shell \
138 if [ -d $(ABS_JDK_IMAGE) ] ; then \
139 $(ECHO) "$(ABS_JDK_IMAGE)"; \
140 else \
141 $(ECHO) "$(ABS_BUILD_ROOT)" ; \
142 fi)
143 endif
144
145 # Expect JPRT to set JAVA_ARGS (e.g. -server etc.)
146 JAVA_OPTIONS =
147 ifdef JAVA_ARGS
148 JAVA_OPTIONS = $(JAVA_ARGS)
149 endif
150
151 # Expect JPRT to set JPRT_ARCHIVE_BUNDLE (path to zip bundle for results)
152 ARCHIVE_BUNDLE = $(ABS_TEST_OUTPUT_DIR)/ARCHIVE_BUNDLE.zip
153 ifdef JPRT_ARCHIVE_BUNDLE
154 ARCHIVE_BUNDLE = $(JPRT_ARCHIVE_BUNDLE)
155 endif
156
157 # How to create the test bundle (pass or fail, we want to create this)
158 # Follow command with ";$(BUNDLE_UP_AND_EXIT)", so it always gets executed.
159 ZIP_UP_RESULTS = ( $(MKDIR) -p `$(DIRNAME) $(ARCHIVE_BUNDLE)` \
160 && $(CD) $(ABS_TEST_OUTPUT_DIR) \
161 && $(CHMOD) -R a+r . \
162 && $(ZIP) -q -r $(ARCHIVE_BUNDLE) . )
163
164 # important results files
165 SUMMARY_TXT = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/JTreport/text/summary.txt")
166 STATS_TXT_NAME = Stats.txt
167 STATS_TXT = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/$(STATS_TXT_NAME)")
168 RUNLIST = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/runlist.txt")
169 PASSLIST = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/passlist.txt")
170 FAILLIST = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/faillist.txt")
286 # Option to tell jtreg to not run tests marked with "ignore"
287 ifeq ($(PLATFORM), windows)
288 JTREG_KEY_OPTION = -k:!ignore
289 else
290 JTREG_KEY_OPTION = -k:\!ignore
291 endif
292 JTREG_BASIC_OPTIONS += $(JTREG_KEY_OPTION)
293
294 # Make sure jtreg exists
295 $(JTREG): $(JT_HOME)
296
297 jtreg_tests: prep $(PRODUCT_HOME) $(JTREG)
298 ( \
299 ( JT_HOME=$(shell $(GETMIXEDPATH) "$(JT_HOME)"); \
300 export JT_HOME; \
301 $(shell $(GETMIXEDPATH) "$(JTREG)") \
302 $(JTREG_BASIC_OPTIONS) \
303 -r:$(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/JTreport") \
304 -w:$(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/JTwork") \
305 -jdk:$(shell $(GETMIXEDPATH) "$(PRODUCT_HOME)") \
306 $(JTREG_EXCLUSIONS) \
307 $(JTREG_TEST_OPTIONS) \
308 $(TEST_SELECTION) \
309 ) ; \
310 $(BUNDLE_UP_AND_EXIT) \
311 ) 2>&1 | $(TEE) $(ABS_TEST_OUTPUT_DIR)/output.txt ; $(TESTEXIT)
312
313 PHONY_LIST += jtreg_tests
314
315 # flags used to execute java in test targets
316 TEST_FLAGS += -version -Xinternalversion -X -help
317
318 sanitytest: prep $(PRODUCT_HOME)
319 @for flag in $(TEST_FLAGS); \
320 do \
321 echo Executing java $(JAVA_OPTIONS) $$flag; \
322 $(PRODUCT_HOME)/bin/java $(JAVA_OPTIONS) $$flag; \
323 res=$$?; \
324 if [ $$res -ne 0 ]; then \
325 exit $$res; \
|
1 #
2 # Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 #
5 # This code is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU General Public License version 2 only, as
7 # published by the Free Software Foundation.
8 #
9 # This code is distributed in the hope that it will be useful, but WITHOUT
10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 # version 2 for more details (a copy is included in the LICENSE file that
13 # accompanied this code).
14 #
15 # You should have received a copy of the GNU General Public License version
16 # 2 along with this work; if not, write to the Free Software Foundation,
17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 #
19 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 # or visit www.oracle.com if you need additional information or have any
21 # questions.
22 #
131
132 # Expect JPRT to set PRODUCT_HOME (the product or jdk in this case to test)
133 ifndef PRODUCT_HOME
134 # Try to use j2sdk-image if it exists
135 ABS_JDK_IMAGE = $(ABS_BUILD_ROOT)/j2sdk-image
136 PRODUCT_HOME := \
137 $(shell \
138 if [ -d $(ABS_JDK_IMAGE) ] ; then \
139 $(ECHO) "$(ABS_JDK_IMAGE)"; \
140 else \
141 $(ECHO) "$(ABS_BUILD_ROOT)" ; \
142 fi)
143 endif
144
145 # Expect JPRT to set JAVA_ARGS (e.g. -server etc.)
146 JAVA_OPTIONS =
147 ifdef JAVA_ARGS
148 JAVA_OPTIONS = $(JAVA_ARGS)
149 endif
150
151 # jtreg -nativepath <dir>
152 #
153 # Local make tests will be TEST_IMAGE_DIR and JPRT with jprt.use.reg.test.bundle=true
154 # should be JPRT_TESTNATIVE_PATH
155 ifndef TESTNATIVE_DIR
156 ifdef TEST_IMAGE_DIR
157 TESTNATIVE_DIR = $(TEST_IMAGE_DIR)
158 else
159 TESTNATIVE_DIR = $(JPRT_TESTNATIVE_PATH)
160 endif
161 endif
162
163 # Expect JPRT to set JPRT_ARCHIVE_BUNDLE (path to zip bundle for results)
164 ARCHIVE_BUNDLE = $(ABS_TEST_OUTPUT_DIR)/ARCHIVE_BUNDLE.zip
165 ifdef JPRT_ARCHIVE_BUNDLE
166 ARCHIVE_BUNDLE = $(JPRT_ARCHIVE_BUNDLE)
167 endif
168
169 # How to create the test bundle (pass or fail, we want to create this)
170 # Follow command with ";$(BUNDLE_UP_AND_EXIT)", so it always gets executed.
171 ZIP_UP_RESULTS = ( $(MKDIR) -p `$(DIRNAME) $(ARCHIVE_BUNDLE)` \
172 && $(CD) $(ABS_TEST_OUTPUT_DIR) \
173 && $(CHMOD) -R a+r . \
174 && $(ZIP) -q -r $(ARCHIVE_BUNDLE) . )
175
176 # important results files
177 SUMMARY_TXT = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/JTreport/text/summary.txt")
178 STATS_TXT_NAME = Stats.txt
179 STATS_TXT = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/$(STATS_TXT_NAME)")
180 RUNLIST = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/runlist.txt")
181 PASSLIST = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/passlist.txt")
182 FAILLIST = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/faillist.txt")
298 # Option to tell jtreg to not run tests marked with "ignore"
299 ifeq ($(PLATFORM), windows)
300 JTREG_KEY_OPTION = -k:!ignore
301 else
302 JTREG_KEY_OPTION = -k:\!ignore
303 endif
304 JTREG_BASIC_OPTIONS += $(JTREG_KEY_OPTION)
305
306 # Make sure jtreg exists
307 $(JTREG): $(JT_HOME)
308
309 jtreg_tests: prep $(PRODUCT_HOME) $(JTREG)
310 ( \
311 ( JT_HOME=$(shell $(GETMIXEDPATH) "$(JT_HOME)"); \
312 export JT_HOME; \
313 $(shell $(GETMIXEDPATH) "$(JTREG)") \
314 $(JTREG_BASIC_OPTIONS) \
315 -r:$(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/JTreport") \
316 -w:$(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/JTwork") \
317 -jdk:$(shell $(GETMIXEDPATH) "$(PRODUCT_HOME)") \
318 -nativepath:$(shell $(GETMIXEDPATH) "$(TESTNATIVE_DIR)/hotspot/jtreg/native") \
319 $(JTREG_EXCLUSIONS) \
320 $(JTREG_TEST_OPTIONS) \
321 $(TEST_SELECTION) \
322 ) ; \
323 $(BUNDLE_UP_AND_EXIT) \
324 ) 2>&1 | $(TEE) $(ABS_TEST_OUTPUT_DIR)/output.txt ; $(TESTEXIT)
325
326 PHONY_LIST += jtreg_tests
327
328 # flags used to execute java in test targets
329 TEST_FLAGS += -version -Xinternalversion -X -help
330
331 sanitytest: prep $(PRODUCT_HOME)
332 @for flag in $(TEST_FLAGS); \
333 do \
334 echo Executing java $(JAVA_OPTIONS) $$flag; \
335 $(PRODUCT_HOME)/bin/java $(JAVA_OPTIONS) $$flag; \
336 res=$$?; \
337 if [ $$res -ne 0 ]; then \
338 exit $$res; \
|