test/langtools/Makefile
changeset 51994 7577686cc9bd
parent 47216 71c04702a3d5
equal deleted inserted replaced
51993:c0d05cf1d19d 51994:7577686cc9bd
     9 #
     9 #
    10 # A langtools build just builds the langtools components of a JDK.
    10 # A langtools build just builds the langtools components of a JDK.
    11 # To test a langtools build, set TESTJAVA to the path for a recent JDK
    11 # To test a langtools build, set TESTJAVA to the path for a recent JDK
    12 # build, and set TESTBOOTCLASSPATH to the compiled langtools classes --
    12 # build, and set TESTBOOTCLASSPATH to the compiled langtools classes --
    13 # for example build/classes or dist/lib/classes.jar.
    13 # for example build/classes or dist/lib/classes.jar.
    14 
       
    15 # JPRT
       
    16 # JPRT may invoke this Makefile directly, as part of a langtools build,
       
    17 # or indirectly, via FOREST/test/Makefile, as part of a control build.
       
    18 
    14 
    19 # Get OS/ARCH specifics
    15 # Get OS/ARCH specifics
    20 OSNAME = $(shell uname -s)
    16 OSNAME = $(shell uname -s)
    21 ifeq ($(OSNAME), SunOS)
    17 ifeq ($(OSNAME), SunOS)
    22   SLASH_JAVA = /java
    18   SLASH_JAVA = /java
    69 endif
    65 endif
    70 
    66 
    71 # Root of this test area (important to use full paths in some places)
    67 # Root of this test area (important to use full paths in some places)
    72 TEST_ROOT := $(shell pwd $(CYGPATH) )
    68 TEST_ROOT := $(shell pwd $(CYGPATH) )
    73 
    69 
    74 # Default bundle of all test results (passed or not) (JPRT only)
       
    75 ifdef JPRT_JOB_ID
       
    76   JPRT_CLEAN = clean
       
    77   JPRT_ARCHIVE_BUNDLE = $(TEST_ROOT)/JPRT_ARCHIVE_BUNDLE.zip
       
    78 endif
       
    79 
       
    80 ifeq ($(PLATFORM), windows)
    70 ifeq ($(PLATFORM), windows)
    81   SLASH_JAVA = J:
    71   SLASH_JAVA = J:
    82 else
    72 else
    83   SLASH_JAVA = /java
    73   SLASH_JAVA = /java
    84 endif
    74 endif
    85 
    75 
    86 # Default JTREG to run
    76 # Default JTREG to run
    87 ifndef JTREG_HOME
    77 ifndef JTREG_HOME
    88   ifdef JPRT_JTREG_HOME
    78   ifdef JT_HOME
    89     JTREG_HOME = $(JPRT_JTREG_HOME)
       
    90   else ifdef JT_HOME
       
    91     JTREG_HOME = $(JT_HOME)
    79     JTREG_HOME = $(JT_HOME)
    92   else
    80   else
    93     JTREG_HOME = $(SLASH_JAVA)/re/jtreg/4.2/promoted/latest/
    81     JTREG_HOME = $(SLASH_JAVA)/re/jtreg/4.2/promoted/latest/
    94   endif
    82   endif
    95 endif
    83 endif
   106   JTREG_EXCLUSIONS = $(PROBLEM_LISTS:%=-exclude:%)
    94   JTREG_EXCLUSIONS = $(PROBLEM_LISTS:%=-exclude:%)
   107 endif
    95 endif
   108 
    96 
   109 # Default JCK to run
    97 # Default JCK to run
   110 ifndef JCK_HOME
    98 ifndef JCK_HOME
   111   ifdef JPRT_JCK_HOME
    99   JCK_HOME = $(SLASH_JAVA)/re/jck/8/promoted/latest/binaries
   112     JCK_HOME = $(JPRT_JCK_HOME)
       
   113   else
       
   114     JCK_HOME = $(SLASH_JAVA)/re/jck/8/promoted/latest/binaries
       
   115   endif
       
   116 endif
   100 endif
   117 
   101 
   118 # Default JDK for JTREG and JCK
   102 # Default JDK for JTREG and JCK
   119 #
   103 #
   120 # JT_JAVA is the version of java used to run jtreg/JCK. 
   104 # JT_JAVA is the version of java used to run jtreg/JCK. 
   121 #
   105 #
   122 ifndef JT_JAVA
   106 ifndef JT_JAVA
   123   ifdef JPRT_JAVA_HOME
   107   JT_JAVA = $(SLASH_JAVA)/re/jdk/1.9.0/archive/fcs/binaries/$(PLATFORM)-$(ARCH)
   124     JT_JAVA = $(JPRT_JAVA_HOME)
       
   125   else
       
   126     JT_JAVA = $(SLASH_JAVA)/re/jdk/1.9.0/archive/fcs/binaries/$(PLATFORM)-$(ARCH)
       
   127   endif
       
   128 endif
   108 endif
   129 
   109 
   130 # Default JDK to test
   110 # Default JDK to test
   131 ifdef JPRT_IMPORT_PRODUCT_HOME
   111 TESTJAVA = $(SLASH_JAVA)/re/jdk/1.9.0/promoted/latest/binaries/$(PLATFORM)-$(ARCH)
   132   TESTJAVA = $(JPRT_IMPORT_PRODUCT_HOME)
   112 
   133 else
   113 # PRODUCT_HOME is a variable pointing to a directory containing the output from
   134   TESTJAVA = $(SLASH_JAVA)/re/jdk/1.9.0/promoted/latest/binaries/$(PLATFORM)-$(ARCH)
       
   135 endif
       
   136 
       
   137 # PRODUCT_HOME is a JPRT variable pointing to a directory containing the output from
       
   138 # make/Makefile
   114 # make/Makefile
   139 # For langtools, this is a directory containing build and dist
   115 # For langtools, this is a directory containing build and dist
   140 # For a control build, this is build/$(PRODUCT)-$(ARCH)/XYZ-image
   116 # For a control build, this is build/$(PRODUCT)-$(ARCH)/XYZ-image
   141 #	(i.e, j2sdk-image or jdk-module-image)
   117 #	(i.e, j2sdk-image or jdk-module-image)
   142 ifdef PRODUCT_HOME
   118 ifdef PRODUCT_HOME
   197 ### 6924287: Jck4Jdk: Allow to configure test group size for group mode via simple command line option
   173 ### 6924287: Jck4Jdk: Allow to configure test group size for group mode via simple command line option
   198 ###  JCK_RUNTIME_OPTIONS += \
   174 ###  JCK_RUNTIME_OPTIONS += \
   199 ###    -jtoptions:-Ejck.env.runtime.testCompile.groupMode.groupSize=$(JCK_GROUP_SIZE)
   175 ###    -jtoptions:-Ejck.env.runtime.testCompile.groupMode.groupSize=$(JCK_GROUP_SIZE)
   200 endif
   176 endif
   201 
   177 
   202 # Timeouts -- by default, increase test timeouts when running on JPRT
   178 # Timeouts
   203 ifdef JPRT_JOB_ID
       
   204   ifndef JTREG_TIMEOUT_FACTOR
       
   205     JTREG_TIMEOUT_FACTOR = 3
       
   206   endif
       
   207 endif
       
   208 ifdef JTREG_TIMEOUT_FACTOR
   179 ifdef JTREG_TIMEOUT_FACTOR
   209   JTREG_OPTIONS += -timeoutFactor:$(JTREG_TIMEOUT_FACTOR)
   180   JTREG_OPTIONS += -timeoutFactor:$(JTREG_TIMEOUT_FACTOR)
   210 endif
   181 endif
   211 
   182 
   212 ifdef JCK_TIMEOUT_FACTOR
   183 ifdef JCK_TIMEOUT_FACTOR
   264   JTREG_GC_OPTION = -vmoption:-XX:+UseSerialGC
   235   JTREG_GC_OPTION = -vmoption:-XX:+UseSerialGC
   265   JTREG_OPTIONS += $(JTREG_GC_OPTION)
   236   JTREG_OPTIONS += $(JTREG_GC_OPTION)
   266 endif
   237 endif
   267 
   238 
   268 # Default make rule -- warning, may take a while
   239 # Default make rule -- warning, may take a while
   269 all: $(JPRT_CLEAN) jtreg-tests jck-compiler-tests jck-runtime-tests $(JPRT_ARCHIVE_BUNDLE) all-summary
   240 all: jtreg-tests jck-compiler-tests jck-runtime-tests all-summary
   270 	@echo "Testing completed successfully"
   241 	@echo "Testing completed successfully"
   271 
   242 
   272 jtreg apt javac javadoc javah javap jdeps: $(JPRT_CLEAN) jtreg-tests $(JPRT_ARCHIVE_BUNDLE) jtreg-summary
   243 jtreg apt javac javadoc javah javap jdeps: jtreg-tests jtreg-summary
   273 	@echo "Testing completed successfully"
   244 	@echo "Testing completed successfully"
   274 
   245 
   275 jck-compiler: $(JPRT_CLEAN) jck-compiler-tests $(JPRT_ARCHIVE_BUNDLE) jck-compiler-summary
   246 jck-compiler: jck-compiler-tests jck-compiler-summary
   276 	@echo "Testing completed successfully"
   247 	@echo "Testing completed successfully"
   277 
   248 
   278 jck-runtime: $(JPRT_CLEAN) jck-runtime-tests $(JPRT_ARCHIVE_BUNDLE) jck-runtime-summary
   249 jck-runtime: jck-runtime-tests jck-runtime-summary
   279 	@echo "Testing completed successfully"
   250 	@echo "Testing completed successfully"
   280 
   251 
   281 # a way to select tests from outside
   252 # a way to select tests from outside
   282 # works for targets 'jtreg', 'jck-compiler', and 'jck-runtime'
   253 # works for targets 'jtreg', 'jck-compiler', and 'jck-runtime'
   283 ifdef TEST_SELECTION
   254 ifdef TEST_SELECTION
   284   JTREG_TESTDIRS = $(TEST_SELECTION)
   255   JTREG_TESTDIRS = $(TEST_SELECTION)
   285   JCK_COMPILER_TESTDIRS = $(TEST_SELECTION)
   256   JCK_COMPILER_TESTDIRS = $(TEST_SELECTION)
   286   JCK_RUNTIME_TESTDIRS = $(TEST_SELECTION)
   257   JCK_RUNTIME_TESTDIRS = $(TEST_SELECTION)
   287 endif
   258 endif
   288 
   259 
   289 # for use with JPRT -testrule
   260 # convenience targets
   290 all:		JTREG_TESTDIRS = .
   261 all:		JTREG_TESTDIRS = .
   291 jtreg:		JTREG_TESTDIRS ?= .
   262 jtreg:		JTREG_TESTDIRS ?= .
   292 apt:		JTREG_TESTDIRS = tools/apt
   263 apt:		JTREG_TESTDIRS = tools/apt
   293 javac: 		JTREG_TESTDIRS = tools/javac
   264 javac: 		JTREG_TESTDIRS = tools/javac
   294 javadoc:	JTREG_TESTDIRS = tools/javadoc com/sun/javadoc
   265 javadoc:	JTREG_TESTDIRS = tools/javadoc com/sun/javadoc
   474 		grep -v 'Not run' | grep -v 'Passed' ; \
   445 		grep -v 'Not run' | grep -v 'Passed' ; \
   475 	    echo ; \
   446 	    echo ; \
   476 	    $(EXIT) 1
   447 	    $(EXIT) 1
   477 	fi
   448 	fi
   478 
   449 
   479 # Bundle up the results
       
   480 $(JPRT_ARCHIVE_BUNDLE): FRC
       
   481 	@rm -f $@
       
   482 	@mkdir -p $(@D)
       
   483 	( cd $(TEST_OUTPUT_DIR) && zip -q -r $@ . )
       
   484 
       
   485 # Cleanup
   450 # Cleanup
   486 clean:
   451 clean:
   487 	rm -f $(JPRT_ARCHIVE_BUNDLE)
       
   488 
   452 
   489 # Used to force a target rules to run
   453 # Used to force a target rules to run
   490 FRC:
   454 FRC:
   491 
   455 
   492 # Phony targets (e.g. these are not filenames)
   456 # Phony targets (e.g. these are not filenames)