1 # 2 # Makefile to run jtreg and other tests 3 # 4 5 # Product builds and langtools builds 6 # 7 # A full product build (or "control" build) creates a complete JDK image. 8 # To test a product build, set TESTJAVA to the path for the image. 9 # 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 12 # build, and set TESTBOOTCLASSPATH to the compiled langtools classes -- 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 19 # Get OS/ARCH specifics 20 OSNAME = $(shell uname -s) 21 ifeq ($(OSNAME), SunOS) 22 SLASH_JAVA = /java 23 PLATFORM = solaris 24 JT_PLATFORM = solaris 25 ARCH = $(shell uname -p) 26 ifeq ($(ARCH), i386) 27 ARCH=i586 28 endif 29 endif 30 ifeq ($(OSNAME), Linux) 31 SLASH_JAVA = /java 32 PLATFORM = linux 33 JT_PLATFORM = linux 34 ARCH = $(shell uname -m) 35 ifeq ($(ARCH), i386) 36 ARCH=i586 37 endif 38 endif 39 ifeq ($(OSNAME), Darwin) 40 PLATFORM = bsd 41 JT_PLATFORM = linux 42 ARCH = $(shell uname -m) 43 ifeq ($(ARCH), i386) 44 ARCH=i586 45 endif 46 endif 47 ifeq ($(OSNAME), Windows_NT) 48 # MKS 49 PLATFORM=windows 50 endif 51 ifeq ($(PLATFORM),) 52 PLATFORM = windows 53 CYGPATH = | cygpath -m -s -f - 54 endif 55 56 ifeq ($(PLATFORM), windows) 57 SLASH_JAVA = J: 58 JT_PLATFORM = win32 59 ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)),ia64) 60 ARCH=ia64 61 else 62 ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)),AMD64) 63 ARCH=x64 64 else 65 ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)),EM64T) 66 ARCH=x64 67 else 68 ARCH=i586 69 endif 70 endif 71 endif 72 EXE_SUFFIX=.exe 73 endif 74 75 # Root of this test area (important to use full paths in some places) 76 TEST_ROOT := $(shell pwd $(CYGPATH) ) 77 78 # Default bundle of all test results (passed or not) (JPRT only) 79 ifdef JPRT_JOB_ID 80 JPRT_CLEAN = clean 81 JPRT_ARCHIVE_BUNDLE = $(TEST_ROOT)/JPRT_ARCHIVE_BUNDLE.zip 82 endif 83 84 ifeq ($(PLATFORM), windows) 85 SLASH_JAVA = J: 86 else 87 SLASH_JAVA = /java 88 endif 89 90 # Default JTREG to run 91 ifdef JPRT_JTREG_HOME 92 JTREG_HOME = $(JPRT_JTREG_HOME) 93 else 94 JTREG_HOME = $(SLASH_JAVA)/re/jtreg/4.1/promoted/latest/binaries/jtreg 95 endif 96 JTREG = $(JTREG_HOME)/$(JT_PLATFORM)/bin/jtreg 97 JTDIFF = $(JTREG_HOME)/$(JT_PLATFORM)/bin/jtdiff 98 99 # Default JCK to run 100 ifdef JPRT_JCK_HOME 101 JCK_HOME = $(JPRT_JCK_HOME) 102 else 103 JCK_HOME = $(SLASH_JAVA)/re/jck/8/promoted/latest/binaries 104 endif 105 106 # Default JDK for JTREG and JCK 107 # 108 # JT_JAVA is the version of java used to run jtreg/JCK. Since it is now 109 # standard to execute tests in sameVM mode, it should normally be set the 110 # same as TESTJAVA (although not necessarily so.) 111 # 112 ifdef JPRT_JAVA_HOME 113 JT_JAVA = $(JPRT_JAVA_HOME) 114 else 115 JT_JAVA = $(SLASH_JAVA)/re/jdk/1.7.0/archive/fcs/binaries/$(PLATFORM)-$(ARCH) 116 endif 117 118 # Default JDK to test 119 ifdef JPRT_IMPORT_PRODUCT_HOME 120 TESTJAVA = $(JPRT_IMPORT_PRODUCT_HOME) 121 else 122 TESTJAVA = $(SLASH_JAVA)/re/jdk/1.7.0/promoted/latest/binaries/$(PLATFORM)-$(ARCH) 123 endif 124 125 # PRODUCT_HOME is a JPRT variable pointing to a directory containing the output from 126 # make/Makefile 127 # For langtools, this is a directory containing build and dist 128 # For a control build, this is build/$(PRODUCT)-$(ARCH)/XYZ-image 129 # (i.e, j2sdk-image or jdk-module-image) 130 ifdef PRODUCT_HOME 131 ifeq ($(shell [ -r $(PRODUCT_HOME)/dist/lib/classes.jar ]; echo $$?),0) 132 TESTBOOTCLASSPATH = $(PRODUCT_HOME)/dist/lib/classes.jar 133 endif 134 ifeq ($(shell [ -r $(PRODUCT_HOME)/bin/javac$(EXE_SUFFIX) ]; echo $$?),0) 135 TESTJAVA = $(PRODUCT_HOME) 136 endif 137 endif 138 139 ifdef TESTBOOTCLASSPATH 140 JTREG_OPTIONS += -Xbootclasspath/p:$(TESTBOOTCLASSPATH) 141 ### In the following, -refvmoptions is an undocumented option 142 ### The following does not work JCK 7 b30 2/6/2010. Awaiting b31. 143 JCK_OPTIONS += \ 144 -vmoptions:-Xbootclasspath/p:$(TESTBOOTCLASSPATH) \ 145 -refvmoptions:-Xbootclasspath/p:$(TESTBOOTCLASSPATH) 146 endif 147 148 # Concurrency is the number of tests that can execute at once. 149 # On an otherwise empty machine, suggest setting to (#cpus + 2) 150 # If unset, the default is (#cpus) 151 ### RFE: determine and use #cpus 152 ifdef CONCURRENCY 153 JTREG_OPTIONS += -agentvm -concurrency:$(CONCURRENCY) 154 else 155 JTREG_OPTIONS += -samevm 156 endif 157 158 ifdef JCK_CONCURRENCY 159 JCK_OPTIONS += -concurrency:$(JCK_CONCURRENCY) 160 endif 161 162 # JCK is executed using "Multi-JVM Group Mode", which is a hybrid 163 # of otherVM and sameVM modes. New JVMs are created and reused for 164 # a number of tests, then eventually discarded and a new one started. 165 # This amortizes the JVM startup time. The "group size" defines 166 # how many tests are run in a JVM before it is replaced. 167 # If unset, the default is 100. 168 JCK_GROUP_SIZE = 1000 169 ifdef JCK_GROUP_SIZE 170 JCK_COMPILER_OPTIONS += \ 171 -jtoptions:-Ejck.env.compiler.testCompile.groupMode.groupSize=$(JCK_GROUP_SIZE) \ | 1 # 2 # Makefile to run jtreg and other tests 3 # 4 5 # Product builds and langtools builds 6 # 7 # A full product build (or "control" build) creates a complete JDK image. 8 # To test a product build, set TESTJAVA to the path for the image. 9 # 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 12 # build, and set TESTBOOTCLASSPATH to the compiled langtools classes -- 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 19 # Utilities used 20 AWK = awk 21 CAT = cat 22 CD = cd 23 CHMOD = chmod 24 CP = cp 25 CUT = cut 26 DIRNAME = dirname 27 ECHO = echo 28 EGREP = egrep 29 EXPAND = expand 30 FIND = find 31 MKDIR = mkdir 32 PWD = pwd 33 SED = sed 34 SORT = sort 35 TEE = tee 36 UNAME = uname 37 UNIQ = uniq 38 WHICH = which 39 WC = wc 40 ZIP = zip 41 42 # Get OS name from uname (Cygwin inexplicably adds _NT-5.1) 43 OSNAME := $(shell $(UNAME) -s | $(CUT) -f1 -d_) 44 ifeq ($(OSNAME), SunOS) 45 SLASH_JAVA = /java 46 PLATFORM = solaris 47 ARCH = $(shell $(UNAME) -p) 48 ifeq ($(ARCH), i386) 49 ARCH=i586 50 endif 51 endif 52 ifeq ($(OSNAME), Linux) 53 SLASH_JAVA = /java 54 PLATFORM = linux 55 ARCH = $(shell $(UNAME) -m) 56 ifeq ($(ARCH), i386) 57 ARCH=i586 58 endif 59 endif 60 ifeq ($(OSNAME), Darwin) 61 PLATFORM = bsd 62 ARCH = $(shell $(UNAME) -m) 63 ifeq ($(ARCH), i386) 64 ARCH=i586 65 endif 66 endif 67 ifeq ($(OSNAME), CYGWIN) 68 PLATFORM = windows 69 CYGPATH = | cygpath -m -s -f - 70 endif 71 72 ifeq ($(PLATFORM), windows) 73 ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)),ia64) 74 ARCH=ia64 75 else 76 ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)),AMD64) 77 ARCH=x64 78 else 79 ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)),EM64T) 80 ARCH=x64 81 else 82 ARCH=i586 83 endif 84 endif 85 endif 86 EXE_SUFFIX=.exe 87 endif 88 89 # Root of this test area (important to use full paths in some places) 90 TEST_ROOT := $(shell pwd $(CYGPATH) ) 91 92 # Default bundle of all test results (passed or not) (JPRT only) 93 ifdef JPRT_JOB_ID 94 JPRT_CLEAN = clean 95 JPRT_ARCHIVE_BUNDLE = $(TEST_ROOT)/JPRT_ARCHIVE_BUNDLE.zip 96 endif 97 98 ifeq ($(PLATFORM), windows) 99 SLASH_JAVA = J: 100 else 101 SLASH_JAVA = /java 102 endif 103 104 # Expect JTREG or JT_HOME to be set for jtreg tests. 105 ifndef JTREG 106 ifdef JT_HOME 107 # windows executable works for everybody 108 JTREG = $(JT_HOME)/win32/bin/jtreg 109 else 110 # maybe it's on the path? 111 JTREG=$(shell $(WHICH) jtreg 2> /dev/null | $(GREP) -v '^no jtreg in') 112 endif 113 endif 114 115 # Expect JTDIFF or JT_HOME to be set for jtdiff tests. 116 ifndef JTDIFF 117 ifdef JT_HOME 118 # windows executable works for everybody 119 JTDIFF = $(JT_HOME)/win32/bin/jtdiff 120 else 121 # maybe it's on the path? 122 JTDIFF=$(shell $(WHICH) jtdiff 2> /dev/null | $(GREP) -v '^no jtdiff in') 123 endif 124 endif 125 126 # Default JCK to run 127 ifdef JPRT_JCK_HOME 128 JCK_HOME = $(JPRT_JCK_HOME) 129 else 130 JCK_HOME = $(SLASH_JAVA)/re/jck/8/promoted/latest/binaries 131 endif 132 133 # Default JDK to test 134 ifdef JPRT_IMPORT_PRODUCT_HOME 135 TESTJAVA = $(JPRT_IMPORT_PRODUCT_HOME) 136 else 137 TESTJAVA = $(SLASH_JAVA)/re/jdk/1.7.0/promoted/latest/binaries/$(PLATFORM)-$(ARCH) 138 endif 139 140 # PRODUCT_HOME is a JPRT variable pointing to a directory containing the output from 141 # make/Makefile 142 # For langtools, this is a directory containing build and dist 143 # For a control build, this is build/$(PRODUCT)-$(ARCH)/XYZ-image 144 # (i.e, j2sdk-image or jdk-module-image) 145 ifdef PRODUCT_HOME 146 ifeq ($(shell [ -r $(PRODUCT_HOME)/dist/lib/classes.jar ]; echo $$?),0) 147 TESTBOOTCLASSPATH = $(PRODUCT_HOME)/dist/lib/classes.jar 148 endif 149 ifeq ($(shell [ -r $(PRODUCT_HOME)/bin/javac$(EXE_SUFFIX) ]; echo $$?),0) 150 TESTJAVA = $(PRODUCT_HOME) 151 endif 152 endif 153 154 # Default JDK for JTREG and JCK 155 # 156 # JT_JAVA is the version of java used to run jtreg/JCK. 157 # 158 ifndef JT_JAVA 159 ifdef JPRT_JAVA_HOME 160 JT_JAVA = $(JPRT_JAVA_HOME) 161 else 162 ifdef TESTJAVA 163 JT_JAVA = $(TESTJAVA) 164 else 165 JT_JAVA = $(SLASH_JAVA)/re/jdk/1.7.0/archive/fcs/binaries/$(PLATFORM)-$(ARCH) 166 endif 167 endif 168 endif 169 170 ifdef TESTBOOTCLASSPATH 171 JTREG_OPTIONS += -Xbootclasspath/p:$(TESTBOOTCLASSPATH) 172 ### In the following, -refvmoptions is an undocumented option 173 ### The following does not work JCK 7 b30 2/6/2010. Awaiting b31. 174 JCK_OPTIONS += \ 175 -vmoptions:-Xbootclasspath/p:$(TESTBOOTCLASSPATH) \ 176 -refvmoptions:-Xbootclasspath/p:$(TESTBOOTCLASSPATH) 177 endif 178 179 # Concurrency is the number of tests that can execute at once. 180 # On an otherwise empty machine, suggest setting to (#cpus + 2) 181 # If unset, the default is (#cpus) 182 # when invoked via root repo "make test" it is set to $(JOBS) 183 ifdef CONCURRENCY 184 JTREG_OPTIONS += -agentvm -concurrency:$(CONCURRENCY) 185 else 186 JTREG_OPTIONS += -samevm 187 endif 188 189 ifdef JCK_CONCURRENCY 190 JCK_OPTIONS += -concurrency:$(JCK_CONCURRENCY) 191 endif 192 193 # JCK is executed using "Multi-JVM Group Mode", which is a hybrid 194 # of otherVM and sameVM modes. New JVMs are created and reused for 195 # a number of tests, then eventually discarded and a new one started. 196 # This amortizes the JVM startup time. The "group size" defines 197 # how many tests are run in a JVM before it is replaced. 198 # If unset, the default is 100. 199 JCK_GROUP_SIZE = 1000 200 ifdef JCK_GROUP_SIZE 201 JCK_COMPILER_OPTIONS += \ 202 -jtoptions:-Ejck.env.compiler.testCompile.groupMode.groupSize=$(JCK_GROUP_SIZE) \ |