--- old/common/autoconf/spec.gmk.in 2013-11-06 12:28:55.168322842 -0800 +++ new/common/autoconf/spec.gmk.in 2013-11-06 12:28:55.084322838 -0800 @@ -527,8 +527,8 @@ OBJCOPY:=@OBJCOPY@ SETFILE:=@SETFILE@ XATTR:=@XATTR@ -JT_HOME:=@JT_HOME@ -JTREGEXE:=@JTREGEXE@ +JTREG:=@JTREG@ +JTDIFF:=@JTDIFF@ FIXPATH:=@FIXPATH@ --- old/common/autoconf/toolchain.m4 2013-11-06 12:28:55.652322866 -0800 +++ new/common/autoconf/toolchain.m4 2013-11-06 12:28:55.572322862 -0800 @@ -1098,13 +1098,22 @@ AC_ARG_WITH(jtreg, [AS_HELP_STRING([--with-jtreg], [Regression Test Harness @<:@probed@:>@])], [], - [with_jtreg=no]) + [with_jtreg=optional]) if test "x$with_jtreg" = xno; then # jtreg disabled AC_MSG_CHECKING([for jtreg]) AC_MSG_RESULT(no) + # force undefine. + JTREG= + JTDIFF= else + if test "x$with_jtreg" = xoptional; then + # non-fatal if not found + jtreg_optional=yes + with_jtreg=yes + fi + if test "x$with_jtreg" != xyes; then # with path specified. JT_HOME="$with_jtreg" @@ -1117,20 +1126,59 @@ BASIC_FIXUP_PATH([JT_HOME]) # jtreg win32 script works for everybody - JTREGEXE="$JT_HOME/win32/bin/jtreg" + JTREG="$JT_HOME/win32/bin/jtreg" + + # jtdiff win32 script works for everybody + JTDIFF="$JT_HOME/win32/bin/jtdiff" + + if test ! -f "$JTREG"; then + AC_MSG_ERROR([JTReg executable does not exist: $JTREG]) + fi - if test ! -f "$JTREGEXE"; then - AC_MSG_ERROR([JTReg executable does not exist: $JTREGEXE]) + if test ! -f "$JTDIFF"; then + AC_MSG_ERROR([JTDiff executable does not exist: $JTDIFF]) fi - AC_MSG_RESULT($JTREGEXE) + AC_MSG_RESULT($JTREG) else - # try to find jtreg on path - BASIC_REQUIRE_PROG(JTREGEXE, jtreg) - JT_HOME="`$DIRNAME $JTREGEXE`" + if test "x$jtreg_optional" != xyes; then + # require that JTReg be on the path + BASIC_REQUIRE_PROG(JTREG, jtreg) + # require that JTDiff be on the path + BASIC_REQUIRE_PROG(JTDIFF, jtdiff) + else + # check if JTReg is on the path + AC_PATH_PROG(JTREG, jtreg) + # check if JTDiff is on the path + AC_PATH_PROG(JTDIFF, jtdiff) + fi + fi + + if test "x$JTREG" != x; then + # check the jtreg version + JTREG_REQUIRED_VERSION="4.1 fcs b07" + AC_MSG_CHECKING([jtreg version]) + JTREG_VERSION="`$JTREG -version 2>&1 | $HEAD -n 1`" + JTREGVER="`$ECHO $JTREG_VERSION | $SED -e "s/jtreg, version \([.]*\)/\1/g"`" +# if test "$JTREGVER" != "$JTREG_REQUIRED_VERSION"; then +# AC_MSG_ERROR([Unsupported JTReg version : $JTREGVER]) +# fi + AC_MSG_RESULT($JTREGVER) + fi + + if test "x$JTDIFF" != x; then + # check the jtdiff version + JTDIFF_REQUIRED_VERSION="4.1 fcs b07" + AC_MSG_CHECKING([jtdiff version]) + JTDIFF_VERSION="`$JTDIFF -version 2>&1 | $HEAD -n 1`" + JTDIFFVER="`$ECHO $JTDIFF_VERSION | $SED -e "s/jtdiff, version \([.]*\)/\1/g"`" +# if test "$JTREGVER" != "$JTREG_REQUIRED_VERSION"; then +# AC_MSG_ERROR([Unsupported JTReg version : $JTREGVER]) +# fi + AC_MSG_RESULT($JTDIFFVER) fi fi - AC_SUBST(JT_HOME) - AC_SUBST(JTREGEXE) + AC_SUBST(JTREG) + AC_SUBST(JTDIFF) ]) --- old/common/makefiles/Main.gmk 2013-11-06 12:28:56.152322890 -0800 +++ new/common/makefiles/Main.gmk 2013-11-06 12:28:56.072322886 -0800 @@ -179,7 +179,7 @@ test: images test-only test-only: start-make @$(call TargetEnter) - @($(CD) $(SRC_ROOT)/test && $(BUILD_LOG_WRAPPER) $(MAKE) -j1 -k MAKEFLAGS= JT_HOME=$(JT_HOME) PRODUCT_HOME=$(JDK_IMAGE_DIR) ALT_OUTPUTDIR=$(OUTPUT_ROOT) CONCURRENCY=$(JOBS) $(TEST)) || true + @($(CD) $(SRC_ROOT)/test && $(BUILD_LOG_WRAPPER) $(MAKE) -j1 -k MAKEFLAGS= JTREG="$(JTREG)" JTDIFF="$(JTDIFF)" PRODUCT_HOME="$(JDK_IMAGE_DIR)" ALT_OUTPUTDIR="$(OUTPUT_ROOT)" CONCURRENCY=$(JOBS) $(TEST)) || true @$(call TargetExit) # Stores the tips for each repository. This file is be used when constructing the jdk image and can be --- old/test/Makefile 2013-11-06 12:28:56.632322913 -0800 +++ new/test/Makefile 2013-11-06 12:28:56.552322909 -0800 @@ -39,7 +39,7 @@ if [ -d $1 ] ; then \ if [ -r $1/test/Makefile ] ; then \ echo "$(MAKE) -k -C $1/test $2" ; \ - $(MAKE) -k -C $1/test $2 ; \ + $(MAKE) -k -C $1/test $2 JTREG=$(JTREG) JTDIFF=$(JTDIFF) PRODUCT_HOME=$(PRODUCT_HOME); \ else \ echo "ERROR: File does not exist: $1/test/Makefile"; \ exit 1; \ @@ -57,7 +57,7 @@ # Test targets langtools_% : - @$(NO_STOPPING)$(call SUBDIR_TEST, $(LANGTOOLS_DIR), JT_JAVA=$(PRODUCT_HOME) JTREG_HOME=$(JT_HOME) TEST="$(subst langtools_,,$@)" $(subst langtools_,,$@)) + @$(NO_STOPPING)$(call SUBDIR_TEST, $(LANGTOOLS_DIR), TEST="$(subst langtools_,,$@)" $(subst langtools_,,$@)) jdk_% : @$(NO_STOPPING)$(call SUBDIR_TEST, $(JDK_DIR), TEST="$@" $@) @@ -65,6 +65,6 @@ ################################################################ # Phony targets (e.g. these are not filenames) -.PHONY: all clean +.PHONY: all default clean ################################################################ --- old/langtools/test/Makefile 2013-11-06 12:28:57.104322936 -0800 +++ new/langtools/test/Makefile 2013-11-06 12:28:56.976322930 -0800 @@ -16,13 +16,35 @@ # JPRT may invoke this Makefile directly, as part of a langtools build, # or indirectly, via FOREST/test/Makefile, as part of a control build. -# Get OS/ARCH specifics -OSNAME = $(shell uname -s) +# Utilities used +AWK = awk +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 +WHICH = which +WC = wc +ZIP = zip + +# Get OS name from uname (Cygwin inexplicably adds _NT-5.1) +OSNAME := $(shell $(UNAME) -s | $(CUT) -f1 -d_) ifeq ($(OSNAME), SunOS) SLASH_JAVA = /java PLATFORM = solaris - JT_PLATFORM = solaris - ARCH = $(shell uname -p) + ARCH = $(shell $(UNAME) -p) ifeq ($(ARCH), i386) ARCH=i586 endif @@ -30,32 +52,24 @@ ifeq ($(OSNAME), Linux) SLASH_JAVA = /java PLATFORM = linux - JT_PLATFORM = linux - ARCH = $(shell uname -m) + ARCH = $(shell $(UNAME) -m) ifeq ($(ARCH), i386) ARCH=i586 endif endif ifeq ($(OSNAME), Darwin) PLATFORM = bsd - JT_PLATFORM = linux - ARCH = $(shell uname -m) + ARCH = $(shell $(UNAME) -m) ifeq ($(ARCH), i386) ARCH=i586 endif endif -ifeq ($(OSNAME), Windows_NT) - # MKS - PLATFORM=windows -endif -ifeq ($(PLATFORM),) +ifeq ($(OSNAME), CYGWIN) PLATFORM = windows CYGPATH = | cygpath -m -s -f - endif ifeq ($(PLATFORM), windows) - SLASH_JAVA = J: - JT_PLATFORM = win32 ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)),ia64) ARCH=ia64 else @@ -87,14 +101,27 @@ SLASH_JAVA = /java endif -# Default JTREG to run -ifdef JPRT_JTREG_HOME - JTREG_HOME = $(JPRT_JTREG_HOME) -else - JTREG_HOME = $(SLASH_JAVA)/re/jtreg/4.1/promoted/latest/binaries/jtreg +# Expect JTREG or JT_HOME to be set for jtreg tests. +ifndef JTREG + ifdef JT_HOME + # windows executable works for everybody + JTREG = $(JT_HOME)/win32/bin/jtreg + else + # maybe it's on the path? + JTREG=$(shell $(WHICH) jtreg 2> /dev/null | $(GREP) -v '^no jtreg in') + endif +endif + +# Expect JTDIFF or JT_HOME to be set for jtdiff tests. +ifndef JTDIFF + ifdef JT_HOME + # windows executable works for everybody + JTDIFF = $(JT_HOME)/win32/bin/jtdiff + else + # maybe it's on the path? + JTDIFF=$(shell $(WHICH) jtdiff 2> /dev/null | $(GREP) -v '^no jtdiff in') + endif endif -JTREG = $(JTREG_HOME)/$(JT_PLATFORM)/bin/jtreg -JTDIFF = $(JTREG_HOME)/$(JT_PLATFORM)/bin/jtdiff # Default JCK to run ifdef JPRT_JCK_HOME @@ -103,18 +130,6 @@ JCK_HOME = $(SLASH_JAVA)/re/jck/8/promoted/latest/binaries endif -# Default JDK for JTREG and JCK -# -# JT_JAVA is the version of java used to run jtreg/JCK. Since it is now -# standard to execute tests in sameVM mode, it should normally be set the -# same as TESTJAVA (although not necessarily so.) -# -ifdef JPRT_JAVA_HOME - JT_JAVA = $(JPRT_JAVA_HOME) -else - JT_JAVA = $(SLASH_JAVA)/re/jdk/1.7.0/archive/fcs/binaries/$(PLATFORM)-$(ARCH) -endif - # Default JDK to test ifdef JPRT_IMPORT_PRODUCT_HOME TESTJAVA = $(JPRT_IMPORT_PRODUCT_HOME) @@ -136,6 +151,22 @@ endif endif +# Default JDK for JTREG and JCK +# +# JT_JAVA is the version of java used to run jtreg/JCK. +# +ifndef JT_JAVA + ifdef JPRT_JAVA_HOME + JT_JAVA = $(JPRT_JAVA_HOME) + else + ifdef TESTJAVA + JT_JAVA = $(TESTJAVA) + else + JT_JAVA = $(SLASH_JAVA)/re/jdk/1.7.0/archive/fcs/binaries/$(PLATFORM)-$(ARCH) + endif + endif +endif + ifdef TESTBOOTCLASSPATH JTREG_OPTIONS += -Xbootclasspath/p:$(TESTBOOTCLASSPATH) ### In the following, -refvmoptions is an undocumented option @@ -148,7 +179,7 @@ # Concurrency is the number of tests that can execute at once. # On an otherwise empty machine, suggest setting to (#cpus + 2) # If unset, the default is (#cpus) -### RFE: determine and use #cpus +# when invoked via root repo "make test" it is set to $(JOBS) ifdef CONCURRENCY JTREG_OPTIONS += -agentvm -concurrency:$(CONCURRENCY) else --- old/jdk/test/Makefile 2013-11-06 12:28:57.896322974 -0800 +++ new/jdk/test/Makefile 2013-11-06 12:28:57.600322960 -0800 @@ -54,6 +54,7 @@ TEE = tee UNAME = uname UNIQ = uniq +WHICH = which WC = wc ZIP = zip @@ -85,7 +86,7 @@ ABS_PLATFORM_BUILD_ROOT = $(ABS_OUTPUTDIR) ABS_TEST_OUTPUT_DIR := $(ABS_PLATFORM_BUILD_ROOT)/testoutput/$(UNIQUE_DIR) -# Expect JPRT to set PRODUCT_HOME (the product or jdk in this case to test) +# locate the JDK to be tested. ifndef PRODUCT_HOME # Try to use j2sdk-image if it exists ABS_JDK_IMAGE = $(ABS_PLATFORM_BUILD_ROOT)/images/j2sdk-image @@ -188,7 +189,7 @@ # Default make rule (runs default jdk tests) all: jdk_default - @$(ECHO) "Testing completed successfully" + @$(ECHO) "Testing completed" # Prep for output # Change execute permissions on shared library files. @@ -219,11 +220,14 @@ # jtreg tests -# Expect JT_HOME to be set for jtreg tests. (home for jtreg) -ifndef JT_HOME - JT_HOME = $(SLASH_JAVA)/re/jtreg/4.1/promoted/latest/binaries/jtreg - ifdef JPRT_JTREG_HOME - JT_HOME = $(JPRT_JTREG_HOME) +# Expect JTREG or JT_HOME to be set for jtreg tests. +ifndef JTREG + ifdef JT_HOME + # windows executable works for everybody + JTREG = $(JT_HOME)/win32/bin/jtreg + else + # maybe it's on the path? + JTREG=$(shell $(WHICH) jtreg 2> /dev/null | $(GREP) -v '^no jtreg in') endif endif @@ -262,8 +266,6 @@ EXTRA_JTREG_OPTIONS += -concurrency:$(CONCURRENCY) endif -# Default JTREG to run (win32 script works for everybody) -JTREG = $(JT_HOME)/win32/bin/jtreg # run in agentvm mode JTREG_BASIC_OPTIONS += -agentvm # Only run automatic tests @@ -296,30 +298,26 @@ JTREG_TEST_OPTIONS += $(JTREG_TESTVM_MEMORY_OPTION) # Make sure jtreg exists -$(JTREG): $(JT_HOME) +$(JTREG): # Run jtreg jtreg_tests: prep $(PRODUCT_HOME) $(JTREG) ( \ - ( JT_HOME=$(shell $(GETMIXEDPATH) "$(JT_HOME)"); \ - export JT_HOME; \ - $(shell $(GETMIXEDPATH) "$(JTREG)") \ + ( "$(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)") \ $(JTREG_EXCLUSIONS) \ $(JTREG_TEST_OPTIONS) \ - $(TEST_SELECTION) \ + $(TEST_SELECTION) \ ) ; \ $(BUNDLE_UP_AND_EXIT) \ ) 2>&1 | $(TEE) $(ABS_TEST_OUTPUT_DIR)/output.txt ; $(TESTEXIT) -PHONY_LIST += jtreg_tests - ################################################################ # Phony targets (e.g. these are not filenames) -.PHONY: all clean prep $(PHONY_LIST) +.PHONY: all clean prep jtreg_tests ################################################################