提交 c021978e 编写于 作者: M mikael

8049071: Add jtreg jobs to JPRT for hotspot

Reviewed-by: dholmes, iveresov
上级 b26919da
...@@ -374,21 +374,25 @@ jprt.make.rule.test.targets.standard.internalvmtests = \ ...@@ -374,21 +374,25 @@ jprt.make.rule.test.targets.standard.internalvmtests = \
${jprt.my.windows.i586}-fastdebug-c2-internalvmtests, \ ${jprt.my.windows.i586}-fastdebug-c2-internalvmtests, \
${jprt.my.windows.x64}-fastdebug-c2-internalvmtests ${jprt.my.windows.x64}-fastdebug-c2-internalvmtests
jprt.make.rule.test.targets.standard.wbapi = \ jprt.make.rule.test.targets.standard.reg.group = \
${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-wbapitest, \ ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GROUP, \
${jprt.my.solaris.x64}-{product|fastdebug}-c2-wbapitest, \ ${jprt.my.solaris.x64}-{product|fastdebug}-c2-GROUP, \
${jprt.my.linux.i586}-{product|fastdebug}-c2-wbapitest, \ ${jprt.my.linux.i586}-{product|fastdebug}-c2-GROUP, \
${jprt.my.linux.x64}-{product|fastdebug}-c2-wbapitest, \ ${jprt.my.linux.x64}-{product|fastdebug}-c2-GROUP, \
${jprt.my.windows.i586}-{product|fastdebug}-c2-wbapitest, \ ${jprt.my.windows.i586}-{product|fastdebug}-c2-GROUP, \
${jprt.my.windows.x64}-{product|fastdebug}-c2-wbapitest, \ ${jprt.my.windows.x64}-{product|fastdebug}-c2-GROUP, \
${jprt.my.linux.i586}-{product|fastdebug}-c1-wbapitest, \ ${jprt.my.linux.i586}-{product|fastdebug}-c1-GROUP, \
${jprt.my.windows.i586}-{product|fastdebug}-c1-wbapitest ${jprt.my.windows.i586}-{product|fastdebug}-c1-GROUP
jprt.make.rule.test.targets.standard = \ jprt.make.rule.test.targets.standard = \
${jprt.make.rule.test.targets.standard.client}, \ ${jprt.make.rule.test.targets.standard.client}, \
${jprt.make.rule.test.targets.standard.server}, \ ${jprt.make.rule.test.targets.standard.server}, \
${jprt.make.rule.test.targets.standard.internalvmtests}, \ ${jprt.make.rule.test.targets.standard.internalvmtests}, \
${jprt.make.rule.test.targets.standard.wbapi} ${jprt.make.rule.test.targets.standard.reg.group:GROUP=hotspot_wbapitest}, \
${jprt.make.rule.test.targets.standard.reg.group:GROUP=hotspot_compiler}, \
${jprt.make.rule.test.targets.standard.reg.group:GROUP=hotspot_gc}, \
${jprt.make.rule.test.targets.standard.reg.group:GROUP=hotspot_runtime}, \
${jprt.make.rule.test.targets.standard.reg.group:GROUP=hotspot_serviceability}
jprt.make.rule.test.targets.embedded = \ jprt.make.rule.test.targets.embedded = \
${jprt.make.rule.test.targets.standard.client} ${jprt.make.rule.test.targets.standard.client}
......
# #
# Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
...@@ -23,14 +23,36 @@ ...@@ -23,14 +23,36 @@
# #
# #
# Makefile to run various jdk tests # Makefile to run various hotspot tests
# #
GETMIXEDPATH=echo GETMIXEDPATH=echo
# Get OS/ARCH specifics # Utilities used
OSNAME = $(shell uname -s) AWK = awk
ifeq ($(OSNAME), SunOS) CAT = cat
CD = cd
CHMOD = chmod
CP = cp
CUT = cut
DIRNAME = dirname
ECHO = echo
EGREP = egrep
EXPAND = expand
FIND = find
MKDIR = mkdir
PWD = pwd
SED = sed
SORT = sort
TEE = tee
UNAME = uname
UNIQ = uniq
WC = wc
ZIP = zip
# Get OS name from uname (Cygwin inexplicably adds _NT-5.1)
UNAME_S := $(shell $(UNAME) -s | $(CUT) -f1 -d_)
ifeq ($(UNAME_S), SunOS)
PLATFORM = solaris PLATFORM = solaris
SLASH_JAVA = /java SLASH_JAVA = /java
ARCH = $(shell uname -p) ARCH = $(shell uname -p)
...@@ -38,7 +60,7 @@ ifeq ($(OSNAME), SunOS) ...@@ -38,7 +60,7 @@ ifeq ($(OSNAME), SunOS)
ARCH=i586 ARCH=i586
endif endif
endif endif
ifeq ($(OSNAME), Linux) ifeq ($(UNAME_S), Linux)
PLATFORM = linux PLATFORM = linux
SLASH_JAVA = /java SLASH_JAVA = /java
ARCH = $(shell uname -m) ARCH = $(shell uname -m)
...@@ -46,7 +68,7 @@ ifeq ($(OSNAME), Linux) ...@@ -46,7 +68,7 @@ ifeq ($(OSNAME), Linux)
ARCH = i586 ARCH = i586
endif endif
endif endif
ifeq ($(OSNAME), Darwin) ifeq ($(UNAME_S), Darwin)
PLATFORM = bsd PLATFORM = bsd
SLASH_JAVA = /java SLASH_JAVA = /java
ARCH = $(shell uname -m) ARCH = $(shell uname -m)
...@@ -54,7 +76,7 @@ ifeq ($(OSNAME), Darwin) ...@@ -54,7 +76,7 @@ ifeq ($(OSNAME), Darwin)
ARCH = i586 ARCH = i586
endif endif
endif endif
ifeq ($(findstring BSD,$(OSNAME)), BSD) ifeq ($(findstring BSD,$(UNAME_S)), BSD)
PLATFORM = bsd PLATFORM = bsd
SLASH_JAVA = /java SLASH_JAVA = /java
ARCH = $(shell uname -m) ARCH = $(shell uname -m)
...@@ -63,12 +85,12 @@ ifeq ($(findstring BSD,$(OSNAME)), BSD) ...@@ -63,12 +85,12 @@ ifeq ($(findstring BSD,$(OSNAME)), BSD)
endif endif
endif endif
ifeq ($(PLATFORM),) ifeq ($(PLATFORM),)
# detect wether we're running in MKS or cygwin # detect whether we're running in MKS or cygwin
ifeq ($(OSNAME), Windows_NT) # MKS ifeq ($(UNAME_S), Windows_NT) # MKS
GETMIXEDPATH=dosname -s GETMIXEDPATH=dosname -s
endif endif
ifeq ($(findstring CYGWIN,$(OSNAME)), CYGWIN) ifeq ($(findstring CYGWIN,$(UNAME_S)), CYGWIN)
GETMIXEDPATH=cygpath -m -s GETMIXEDPATH=cygpath -m
endif endif
PLATFORM = windows PLATFORM = windows
SLASH_JAVA = J: SLASH_JAVA = J:
...@@ -92,13 +114,6 @@ ifdef ALT_SLASH_JAVA ...@@ -92,13 +114,6 @@ ifdef ALT_SLASH_JAVA
SLASH_JAVA = $(ALT_SLASH_JAVA) SLASH_JAVA = $(ALT_SLASH_JAVA)
endif endif
# Utilities used
CD = cd
CP = cp
ECHO = echo
MKDIR = mkdir
ZIP = zip
# Root of this test area (important to use full paths in some places) # Root of this test area (important to use full paths in some places)
TEST_ROOT := $(shell pwd) TEST_ROOT := $(shell pwd)
...@@ -136,21 +151,82 @@ ifdef JPRT_ARCHIVE_BUNDLE ...@@ -136,21 +151,82 @@ ifdef JPRT_ARCHIVE_BUNDLE
endif endif
# How to create the test bundle (pass or fail, we want to create this) # How to create the test bundle (pass or fail, we want to create this)
BUNDLE_UP = ( $(MKDIR) -p `dirname $(ARCHIVE_BUNDLE)` \ # Follow command with ";$(BUNDLE_UP_AND_EXIT)", so it always gets executed.
ZIP_UP_RESULTS = ( $(MKDIR) -p `$(DIRNAME) $(ARCHIVE_BUNDLE)` \
&& $(CD) $(ABS_TEST_OUTPUT_DIR) \ && $(CD) $(ABS_TEST_OUTPUT_DIR) \
&& $(CHMOD) -R a+r . \
&& $(ZIP) -q -r $(ARCHIVE_BUNDLE) . ) && $(ZIP) -q -r $(ARCHIVE_BUNDLE) . )
BUNDLE_UP_FAILED = ( exitCode=$$? && $(BUNDLE_UP) && exit $${exitCode} )
# important results files
SUMMARY_TXT = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/JTreport/text/summary.txt")
STATS_TXT_NAME = Stats.txt
STATS_TXT = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/$(STATS_TXT_NAME)")
RUNLIST = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/runlist.txt")
PASSLIST = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/passlist.txt")
FAILLIST = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/faillist.txt")
EXITCODE = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/exitcode.txt")
TESTEXIT = \
if [ ! -s $(EXITCODE) ] ; then \
$(ECHO) "ERROR: EXITCODE file not filled in."; \
$(ECHO) "1" > $(EXITCODE); \
fi ; \
testExitCode=`$(CAT) $(EXITCODE)`; \
$(ECHO) "EXIT CODE: $${testExitCode}"; \
exit $${testExitCode}
BUNDLE_UP_AND_EXIT = \
( \
jtregExitCode=$$? && \
_summary="$(SUMMARY_TXT)"; \
$(RM) -f $(STATS_TXT) $(RUNLIST) $(PASSLIST) $(FAILLIST) $(EXITCODE); \
$(ECHO) "$${jtregExitCode}" > $(EXITCODE); \
if [ -r "$${_summary}" ] ; then \
$(ECHO) "Summary: $(UNIQUE_DIR)" > $(STATS_TXT); \
$(EXPAND) $${_summary} | $(EGREP) -v ' Not run\.' > $(RUNLIST); \
$(EGREP) ' Passed\.' $(RUNLIST) \
| $(EGREP) -v ' Error\.' \
| $(EGREP) -v ' Failed\.' > $(PASSLIST); \
( $(EGREP) ' Failed\.' $(RUNLIST); \
$(EGREP) ' Error\.' $(RUNLIST); \
$(EGREP) -v ' Passed\.' $(RUNLIST) ) \
| $(SORT) | $(UNIQ) > $(FAILLIST); \
if [ $${jtregExitCode} != 0 -o -s $(FAILLIST) ] ; then \
$(EXPAND) $(FAILLIST) \
| $(CUT) -d' ' -f1 \
| $(SED) -e 's@^@FAILED: @' >> $(STATS_TXT); \
if [ $${jtregExitCode} = 0 ] ; then \
jtregExitCode=1; \
fi; \
fi; \
runc="`$(CAT) $(RUNLIST) | $(WC) -l | $(AWK) '{print $$1;}'`"; \
passc="`$(CAT) $(PASSLIST) | $(WC) -l | $(AWK) '{print $$1;}'`"; \
failc="`$(CAT) $(FAILLIST) | $(WC) -l | $(AWK) '{print $$1;}'`"; \
exclc="FIXME CODETOOLS-7900176"; \
$(ECHO) "TEST STATS: name=$(UNIQUE_DIR) run=$${runc} pass=$${passc} fail=$${failc}" \
>> $(STATS_TXT); \
else \
$(ECHO) "Missing file: $${_summary}" >> $(STATS_TXT); \
fi; \
if [ -f $(STATS_TXT) ] ; then \
$(CAT) $(STATS_TXT); \
fi; \
$(ZIP_UP_RESULTS) ; \
$(TESTEXIT) \
)
################################################################ ################################################################
# Default make rule (runs jtreg_tests) # Default make rule (runs jtreg_tests)
all: jtreg_tests all: hotspot_all
@$(ECHO) "Testing completed successfully" @$(ECHO) "Testing completed successfully"
# Support "hotspot_" prefixed test make targets too # Support "hotspot_" prefixed test make targets (too)
# The hotspot_% targets are for example invoked by the top level Makefile # The hotspot_% targets are used by the top level Makefile
# Unless explicitly defined below, hotspot_<x> is interpreted as a jtreg test group name
hotspot_%: hotspot_%:
$(MAKE) $* $(ECHO) "Running tests: $@"
$(MAKE) -j 1 TEST_SELECTION=":$@" UNIQUE_DIR=$@ jtreg_tests;
# Prep for output # Prep for output
prep: clean prep: clean
...@@ -168,41 +244,64 @@ clean: ...@@ -168,41 +244,64 @@ clean:
# Expect JT_HOME to be set for jtreg tests. (home for jtreg) # Expect JT_HOME to be set for jtreg tests. (home for jtreg)
ifndef JT_HOME ifndef JT_HOME
JT_HOME = $(SLASH_JAVA)/re/jtreg/4.0/promoted/latest/binaries/jtreg JT_HOME = $(SLASH_JAVA)/re/jtreg/4.1/promoted/latest/binaries/jtreg
endif ifdef JPRT_JTREG_HOME
ifdef JPRT_JTREG_HOME
JT_HOME = $(JPRT_JTREG_HOME) JT_HOME = $(JPRT_JTREG_HOME)
endif
endif endif
# Expect JPRT to set TESTDIRS to the jtreg test dirs # When called from JPRT the TESTDIRS variable is set to the jtreg tests to run
JTREG_TESTDIRS = demo/jvmti/gctest demo/jvmti/hprof
ifdef TESTDIRS ifdef TESTDIRS
JTREG_TESTDIRS = $(TESTDIRS) TEST_SELECTION = $(TESTDIRS)
endif
ifdef CONCURRENCY
EXTRA_JTREG_OPTIONS += -concurrency:$(CONCURRENCY)
endif endif
# Default JTREG to run # Default JTREG to run
JTREG = $(JT_HOME)/bin/jtreg JTREG = $(JT_HOME)/bin/jtreg
# Only run automatic tests
JTREG_BASIC_OPTIONS += -a
# Report details on all failed or error tests, times too
JTREG_BASIC_OPTIONS += -v:fail,error,time
# Retain all files for failing tests
JTREG_BASIC_OPTIONS += -retain:fail,error
# Ignore tests are not run and completely silent about it
JTREG_IGNORE_OPTION = -ignore:quiet
JTREG_BASIC_OPTIONS += $(JTREG_IGNORE_OPTION)
# Add any extra options
JTREG_BASIC_OPTIONS += $(EXTRA_JTREG_OPTIONS)
# Set other vm and test options
JTREG_TEST_OPTIONS = $(JAVA_ARGS:%=-javaoptions:%) $(JAVA_OPTIONS:%=-vmoption:%) $(JAVA_VM_ARGS:%=-vmoption:%)
# Option to tell jtreg to not run tests marked with "ignore" # Option to tell jtreg to not run tests marked with "ignore"
ifeq ($(PLATFORM), windows) ifeq ($(PLATFORM), windows)
JTREG_KEY_OPTION = -k:!ignore JTREG_KEY_OPTION = -k:!ignore
else else
JTREG_KEY_OPTION = -k:\!ignore JTREG_KEY_OPTION = -k:\!ignore
endif endif
JTREG_BASIC_OPTIONS += $(JTREG_KEY_OPTION)
#EXTRA_JTREG_OPTIONS =
# Make sure jtreg exists
jtreg_tests: prep $(JT_HOME) $(PRODUCT_HOME) $(JTREG) $(JTREG): $(JT_HOME)
$(JTREG) -a -v:fail,error \
$(JTREG_KEY_OPTION) \ jtreg_tests: prep $(PRODUCT_HOME) $(JTREG)
$(EXTRA_JTREG_OPTIONS) \ ( \
-r:$(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/JTreport \ ( JT_HOME=$(shell $(GETMIXEDPATH) "$(JT_HOME)"); \
-w:$(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/JTwork \ export JT_HOME; \
$(shell $(GETMIXEDPATH) "$(JTREG)") \
$(JTREG_BASIC_OPTIONS) \
-r:$(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/JTreport") \
-w:$(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/JTwork") \
-jdk:$(shell $(GETMIXEDPATH) "$(PRODUCT_HOME)") \ -jdk:$(shell $(GETMIXEDPATH) "$(PRODUCT_HOME)") \
$(JAVA_OPTIONS:%=-vmoption:%) \ $(JTREG_EXCLUSIONS) \
$(JTREG_TESTDIRS) \ $(JTREG_TEST_OPTIONS) \
|| $(BUNDLE_UP_FAILED) $(TEST_SELECTION) \
$(BUNDLE_UP) ) ; \
$(BUNDLE_UP_AND_EXIT) \
) 2>&1 | $(TEE) $(ABS_TEST_OUTPUT_DIR)/output.txt ; $(TESTEXIT)
PHONY_LIST += jtreg_tests PHONY_LIST += jtreg_tests
...@@ -210,7 +309,7 @@ PHONY_LIST += jtreg_tests ...@@ -210,7 +309,7 @@ PHONY_LIST += jtreg_tests
# clienttest (make sure various basic java client options work) # clienttest (make sure various basic java client options work)
clienttest: prep $(PRODUCT_HOME) hotspot_clienttest clienttest: prep $(PRODUCT_HOME)
$(PRODUCT_HOME)/bin/java $(JAVA_OPTIONS) -version $(PRODUCT_HOME)/bin/java $(JAVA_OPTIONS) -version
$(PRODUCT_HOME)/bin/java $(JAVA_OPTIONS) -help $(PRODUCT_HOME)/bin/java $(JAVA_OPTIONS) -help
$(PRODUCT_HOME)/bin/java $(JAVA_OPTIONS) -X $(PRODUCT_HOME)/bin/java $(JAVA_OPTIONS) -X
...@@ -218,73 +317,27 @@ clienttest: prep $(PRODUCT_HOME) ...@@ -218,73 +317,27 @@ clienttest: prep $(PRODUCT_HOME)
$(RM) $(PRODUCT_HOME)/jre/bin/client/classes.jsa $(RM) $(PRODUCT_HOME)/jre/bin/client/classes.jsa
$(PRODUCT_HOME)/bin/java $(JAVA_OPTIONS) -Xshare:dump $(PRODUCT_HOME)/bin/java $(JAVA_OPTIONS) -Xshare:dump
PHONY_LIST += clienttest PHONY_LIST += hotspot_clienttest clienttest
################################################################ ################################################################
# servertest (make sure various basic java server options work) # servertest (make sure various basic java server options work)
servertest: prep $(PRODUCT_HOME) hotspot_servertest servertest: prep $(PRODUCT_HOME)
$(PRODUCT_HOME)/bin/java $(JAVA_OPTIONS) -version $(PRODUCT_HOME)/bin/java $(JAVA_OPTIONS) -version
$(PRODUCT_HOME)/bin/java $(JAVA_OPTIONS) -help $(PRODUCT_HOME)/bin/java $(JAVA_OPTIONS) -help
$(PRODUCT_HOME)/bin/java $(JAVA_OPTIONS) -X $(PRODUCT_HOME)/bin/java $(JAVA_OPTIONS) -X
PHONY_LIST += servertest PHONY_LIST += hotspot_servertest servertest
################################################################ ################################################################
# internalvmtests (run internal unit tests inside the VM) # internalvmtests (run internal unit tests inside the VM)
internalvmtests: prep $(PRODUCT_HOME) hotspot_internalvmtests internalvmtests: prep $(PRODUCT_HOME)
$(PRODUCT_HOME)/bin/java $(JAVA_OPTIONS) -XX:+ExecuteInternalVMTests -version $(PRODUCT_HOME)/bin/java $(JAVA_OPTIONS) -XX:+ExecuteInternalVMTests -version
PHONY_LIST += internalvmtests PHONY_LIST += hotspot_internalvmtests internalvmtests
################################################################
# wbapitest (make sure the whitebox testing api classes work
wbapitest: prep $(JT_HOME) $(PRODUCT_HOME) $(JTREG)
$(JTREG) -a -v:fail,error \
$(JTREG_KEY_OPTION) \
$(EXTRA_JTREG_OPTIONS) \
-r:$(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/JTreport \
-w:$(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/JTwork \
-jdk:$(shell $(GETMIXEDPATH) "$(PRODUCT_HOME)") \
$(JAVA_OPTIONS:%=-vmoption:%) \
$(shell $(GETMIXEDPATH) "$(TEST_ROOT)")/sanity \
|| $(BUNDLE_UP_FAILED)
$(BUNDLE_UP)
PHONY_LIST += wbapitest
################################################################
# packtest
# Expect JPRT to set JPRT_PACKTEST_HOME.
PACKTEST_HOME = /net/jprt-web.sfbay.sun.com/jprt/allproducts/packtest
ifdef JPRT_PACKTEST_HOME
PACKTEST_HOME = $(JPRT_PACKTEST_HOME)
endif
#EXTRA_PACKTEST_OPTIONS =
packtest: prep $(PACKTEST_HOME)/ptest $(PRODUCT_HOME)
( $(CD) $(PACKTEST_HOME) && \
$(PACKTEST_HOME)/ptest \
-t "$(PRODUCT_HOME)" \
$(PACKTEST_STRESS_OPTION) \
$(EXTRA_PACKTEST_OPTIONS) \
-W $(ABS_TEST_OUTPUT_DIR) \
$(JAVA_OPTIONS:%=-J %) \
) || $(BUNDLE_UP_FAILED)
$(BUNDLE_UP)
packtest_stress: PACKTEST_STRESS_OPTION=-s
packtest_stress: packtest
PHONY_LIST += packtest packtest_stress
################################################################ ################################################################
...@@ -292,4 +345,3 @@ PHONY_LIST += packtest packtest_stress ...@@ -292,4 +345,3 @@ PHONY_LIST += packtest packtest_stress
.PHONY: all clean prep $(PHONY_LIST) .PHONY: all clean prep $(PHONY_LIST)
################################################################ ################################################################
...@@ -125,6 +125,27 @@ compact3 = \ ...@@ -125,6 +125,27 @@ compact3 = \
-:needs_jdk -:needs_jdk
# When called from top level the test suites use the hotspot_ prefix
hotspot_wbapitest = \
sanity/
hotspot_compiler = \
sanity/ExecuteInternalVMTests.java
hotspot_gc = \
sanity/ExecuteInternalVMTests.java
hotspot_runtime = \
sanity/ExecuteInternalVMTests.java
hotspot_serviceability = \
sanity/ExecuteInternalVMTests.java
hotspot_all = \
:hotspot_compiler \
:hotspot_gc \
:hotspot_runtime \
:hotspot_serviceability
# Tests that require compact3 API's # Tests that require compact3 API's
# #
needs_compact3 = \ needs_compact3 = \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册