Fri, 24 Jul 2020 22:42:51 +0100
Added tag jdk8u265-b01 for changeset e0342245812a
duke@1 | 1 | # |
jjg@526 | 2 | # Makefile to run jtreg and other tests |
duke@1 | 3 | # |
duke@1 | 4 | |
jjg@526 | 5 | # Product builds and langtools builds |
jjg@526 | 6 | # |
jjg@526 | 7 | # A full product build (or "control" build) creates a complete JDK image. |
jjg@526 | 8 | # To test a product build, set TESTJAVA to the path for the image. |
jjg@526 | 9 | # |
mduigou@2073 | 10 | # A langtools build just builds the langtools components of a JDK. |
jjg@526 | 11 | # To test a langtools build, set TESTJAVA to the path for a recent JDK |
jjg@526 | 12 | # build, and set TESTBOOTCLASSPATH to the compiled langtools classes -- |
jjg@526 | 13 | # for example build/classes or dist/lib/classes.jar. |
jjg@526 | 14 | |
jjg@526 | 15 | # JPRT |
jjg@526 | 16 | # JPRT may invoke this Makefile directly, as part of a langtools build, |
jjg@526 | 17 | # or indirectly, via FOREST/test/Makefile, as part of a control build. |
jjg@526 | 18 | |
sgehwolf@3835 | 19 | |
sgehwolf@3835 | 20 | # Utilities used |
sgehwolf@3835 | 21 | AWK = awk |
sgehwolf@3835 | 22 | CAT = cat |
sgehwolf@3835 | 23 | CD = cd |
sgehwolf@3835 | 24 | CHMOD = chmod |
sgehwolf@3835 | 25 | CP = cp |
sgehwolf@3835 | 26 | CUT = cut |
sgehwolf@3835 | 27 | DIRNAME = dirname |
sgehwolf@3835 | 28 | ECHO = echo |
sgehwolf@3835 | 29 | EGREP = egrep |
sgehwolf@3835 | 30 | EXPAND = expand |
sgehwolf@3835 | 31 | FIND = find |
sgehwolf@3835 | 32 | MKDIR = mkdir |
sgehwolf@3835 | 33 | PWD = pwd |
sgehwolf@3835 | 34 | SED = sed |
sgehwolf@3835 | 35 | SORT = sort |
sgehwolf@3835 | 36 | TEE = tee |
sgehwolf@3835 | 37 | UNAME = uname |
sgehwolf@3835 | 38 | UNIQ = uniq |
sgehwolf@3835 | 39 | WC = wc |
sgehwolf@3835 | 40 | ZIP = zip |
sgehwolf@3835 | 41 | |
sgehwolf@3835 | 42 | # Get OS name from uname (Cygwin inexplicably adds _NT-5.1) |
sgehwolf@3835 | 43 | UNAME_S := $(shell $(UNAME) -s | $(CUT) -f1 -d_) |
sgehwolf@3835 | 44 | |
sgehwolf@3835 | 45 | # Commands to run on paths to make mixed paths for java on windows |
sgehwolf@3835 | 46 | ifeq ($(UNAME_S), CYGWIN) |
sgehwolf@3835 | 47 | # Location of developer shared files |
sgehwolf@3835 | 48 | SLASH_JAVA = J: |
sgehwolf@3835 | 49 | GETMIXEDPATH = cygpath -m |
sgehwolf@3835 | 50 | else |
sgehwolf@3835 | 51 | # Location of developer shared files |
sgehwolf@3835 | 52 | SLASH_JAVA = /java |
sgehwolf@3835 | 53 | |
sgehwolf@3835 | 54 | GETMIXEDPATH=$(ECHO) |
sgehwolf@3835 | 55 | endif |
sgehwolf@3835 | 56 | |
duke@1 | 57 | # Get OS/ARCH specifics |
duke@1 | 58 | OSNAME = $(shell uname -s) |
duke@1 | 59 | ifeq ($(OSNAME), SunOS) |
jjh@1124 | 60 | SLASH_JAVA = /java |
duke@1 | 61 | PLATFORM = solaris |
duke@1 | 62 | ARCH = $(shell uname -p) |
duke@1 | 63 | ifeq ($(ARCH), i386) |
duke@1 | 64 | ARCH=i586 |
duke@1 | 65 | endif |
duke@1 | 66 | endif |
duke@1 | 67 | ifeq ($(OSNAME), Linux) |
jjh@1124 | 68 | SLASH_JAVA = /java |
duke@1 | 69 | PLATFORM = linux |
duke@1 | 70 | ARCH = $(shell uname -m) |
duke@1 | 71 | ifeq ($(ARCH), i386) |
duke@1 | 72 | ARCH=i586 |
duke@1 | 73 | endif |
duke@1 | 74 | endif |
michaelm@1223 | 75 | ifeq ($(OSNAME), Darwin) |
michaelm@1223 | 76 | PLATFORM = bsd |
michaelm@1223 | 77 | ARCH = $(shell uname -m) |
michaelm@1223 | 78 | ifeq ($(ARCH), i386) |
michaelm@1223 | 79 | ARCH=i586 |
michaelm@1223 | 80 | endif |
michaelm@1223 | 81 | endif |
duke@1 | 82 | ifeq ($(OSNAME), Windows_NT) |
jjh@1124 | 83 | # MKS |
jjh@1124 | 84 | PLATFORM=windows |
jjh@1124 | 85 | endif |
jjh@1124 | 86 | ifeq ($(PLATFORM),) |
duke@1 | 87 | PLATFORM = windows |
jjh@1124 | 88 | CYGPATH = | cygpath -m -s -f - |
jjh@1124 | 89 | endif |
jjh@1124 | 90 | |
jjh@1124 | 91 | ifeq ($(PLATFORM), windows) |
jjh@1124 | 92 | SLASH_JAVA = J: |
duke@1 | 93 | ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)),ia64) |
duke@1 | 94 | ARCH=ia64 |
duke@1 | 95 | else |
duke@1 | 96 | ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)),AMD64) |
duke@1 | 97 | ARCH=x64 |
duke@1 | 98 | else |
duke@1 | 99 | ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)),EM64T) |
duke@1 | 100 | ARCH=x64 |
duke@1 | 101 | else |
duke@1 | 102 | ARCH=i586 |
duke@1 | 103 | endif |
duke@1 | 104 | endif |
duke@1 | 105 | endif |
jjg@565 | 106 | EXE_SUFFIX=.exe |
duke@1 | 107 | endif |
duke@1 | 108 | |
duke@1 | 109 | # Root of this test area (important to use full paths in some places) |
jjh@1124 | 110 | TEST_ROOT := $(shell pwd $(CYGPATH) ) |
duke@1 | 111 | |
jjg@526 | 112 | # Default bundle of all test results (passed or not) (JPRT only) |
jjg@526 | 113 | ifdef JPRT_JOB_ID |
jjg@526 | 114 | JPRT_CLEAN = clean |
jjg@526 | 115 | JPRT_ARCHIVE_BUNDLE = $(TEST_ROOT)/JPRT_ARCHIVE_BUNDLE.zip |
jjg@526 | 116 | endif |
duke@1 | 117 | |
duke@1 | 118 | ifeq ($(PLATFORM), windows) |
duke@1 | 119 | SLASH_JAVA = J: |
duke@1 | 120 | else |
duke@1 | 121 | SLASH_JAVA = /java |
duke@1 | 122 | endif |
duke@1 | 123 | |
duke@1 | 124 | # Default JTREG to run |
jjg@397 | 125 | ifdef JPRT_JTREG_HOME |
jjg@397 | 126 | JTREG_HOME = $(JPRT_JTREG_HOME) |
jjg@397 | 127 | else |
jjh@1124 | 128 | JTREG_HOME = $(SLASH_JAVA)/re/jtreg/4.1/promoted/latest/binaries/jtreg |
jjg@397 | 129 | endif |
jjg@2806 | 130 | JTREG = $(JTREG_HOME)/bin/jtreg |
jjg@2806 | 131 | JTDIFF = $(JTREG_HOME)/bin/jtdiff |
duke@1 | 132 | |
jjg@526 | 133 | # Default JCK to run |
jjg@526 | 134 | ifdef JPRT_JCK_HOME |
jjg@526 | 135 | JCK_HOME = $(JPRT_JCK_HOME) |
jjg@526 | 136 | else |
jjh@1124 | 137 | JCK_HOME = $(SLASH_JAVA)/re/jck/8/promoted/latest/binaries |
jjg@526 | 138 | endif |
jjg@526 | 139 | |
jjg@526 | 140 | # Default JDK for JTREG and JCK |
jjg@526 | 141 | # |
jjg@526 | 142 | # JT_JAVA is the version of java used to run jtreg/JCK. Since it is now |
jjg@526 | 143 | # standard to execute tests in sameVM mode, it should normally be set the |
jjg@526 | 144 | # same as TESTJAVA (although not necessarily so.) |
jjg@526 | 145 | # |
duke@1 | 146 | ifdef JPRT_JAVA_HOME |
duke@1 | 147 | JT_JAVA = $(JPRT_JAVA_HOME) |
duke@1 | 148 | else |
jjh@1124 | 149 | JT_JAVA = $(SLASH_JAVA)/re/jdk/1.7.0/archive/fcs/binaries/$(PLATFORM)-$(ARCH) |
duke@1 | 150 | endif |
duke@1 | 151 | |
duke@1 | 152 | # Default JDK to test |
jjg@397 | 153 | ifdef JPRT_IMPORT_PRODUCT_HOME |
jjg@397 | 154 | TESTJAVA = $(JPRT_IMPORT_PRODUCT_HOME) |
jjg@397 | 155 | else |
jjg@397 | 156 | TESTJAVA = $(SLASH_JAVA)/re/jdk/1.7.0/promoted/latest/binaries/$(PLATFORM)-$(ARCH) |
jjg@397 | 157 | endif |
jjg@397 | 158 | |
mduigou@2073 | 159 | # PRODUCT_HOME is a JPRT variable pointing to a directory containing the output from |
jjg@526 | 160 | # make/Makefile |
jjg@526 | 161 | # For langtools, this is a directory containing build and dist |
mduigou@2073 | 162 | # For a control build, this is build/$(PRODUCT)-$(ARCH)/XYZ-image |
jjg@565 | 163 | # (i.e, j2sdk-image or jdk-module-image) |
jjg@526 | 164 | ifdef PRODUCT_HOME |
jjg@526 | 165 | ifeq ($(shell [ -r $(PRODUCT_HOME)/dist/lib/classes.jar ]; echo $$?),0) |
jjg@526 | 166 | TESTBOOTCLASSPATH = $(PRODUCT_HOME)/dist/lib/classes.jar |
jjg@526 | 167 | endif |
jjg@565 | 168 | ifeq ($(shell [ -r $(PRODUCT_HOME)/bin/javac$(EXE_SUFFIX) ]; echo $$?),0) |
jjg@526 | 169 | TESTJAVA = $(PRODUCT_HOME) |
jjg@526 | 170 | endif |
jjg@526 | 171 | endif |
jjg@526 | 172 | |
jjg@526 | 173 | ifdef TESTBOOTCLASSPATH |
jjg@526 | 174 | JTREG_OPTIONS += -Xbootclasspath/p:$(TESTBOOTCLASSPATH) |
jjg@526 | 175 | ### In the following, -refvmoptions is an undocumented option |
mduigou@2073 | 176 | ### The following does not work JCK 7 b30 2/6/2010. Awaiting b31. |
jjg@526 | 177 | JCK_OPTIONS += \ |
jjg@526 | 178 | -vmoptions:-Xbootclasspath/p:$(TESTBOOTCLASSPATH) \ |
jjg@526 | 179 | -refvmoptions:-Xbootclasspath/p:$(TESTBOOTCLASSPATH) |
jjg@526 | 180 | endif |
jjg@526 | 181 | |
mduigou@2073 | 182 | # Concurrency is the number of tests that can execute at once. |
jjg@526 | 183 | # On an otherwise empty machine, suggest setting to (#cpus + 2) |
jjg@526 | 184 | # If unset, the default is (#cpus) |
jjg@526 | 185 | ### RFE: determine and use #cpus |
jjh@1414 | 186 | ifdef CONCURRENCY |
jjh@1414 | 187 | JTREG_OPTIONS += -agentvm -concurrency:$(CONCURRENCY) |
jjh@1414 | 188 | else |
jjh@1414 | 189 | JTREG_OPTIONS += -samevm |
jjh@1414 | 190 | endif |
jjh@1414 | 191 | |
jjg@526 | 192 | ifdef JCK_CONCURRENCY |
jjg@526 | 193 | JCK_OPTIONS += -concurrency:$(JCK_CONCURRENCY) |
jjg@526 | 194 | endif |
jjg@526 | 195 | |
jjg@526 | 196 | # JCK is executed using "Multi-JVM Group Mode", which is a hybrid |
jjg@526 | 197 | # of otherVM and sameVM modes. New JVMs are created and reused for |
jjg@526 | 198 | # a number of tests, then eventually discarded and a new one started. |
jjg@526 | 199 | # This amortizes the JVM startup time. The "group size" defines |
jjg@526 | 200 | # how many tests are run in a JVM before it is replaced. |
jjg@526 | 201 | # If unset, the default is 100. |
jjg@526 | 202 | JCK_GROUP_SIZE = 1000 |
jjg@526 | 203 | ifdef JCK_GROUP_SIZE |
jjg@526 | 204 | JCK_COMPILER_OPTIONS += \ |
jjg@526 | 205 | -jtoptions:-Ejck.env.compiler.testCompile.groupMode.groupSize=$(JCK_GROUP_SIZE) \ |
jjg@526 | 206 | -jtoptions:-Ejck.env.compiler.compRefExecute.groupMode.groupSize=$(JCK_GROUP_SIZE) |
jjg@526 | 207 | ### The following is not supported. Awaiting RFE 6924287 |
jjg@526 | 208 | ### 6924287: Jck4Jdk: Allow to configure test group size for group mode via simple command line option |
jjg@526 | 209 | ### JCK_RUNTIME_OPTIONS += \ |
jjg@526 | 210 | ### -jtoptions:-Ejck.env.runtime.testCompile.groupMode.groupSize=$(JCK_GROUP_SIZE) |
jjg@526 | 211 | endif |
jjg@526 | 212 | |
jjg@560 | 213 | # Timeouts -- by default, increase test timeouts when running on JPRT |
jjg@560 | 214 | ifdef JPRT_JOB_ID |
jjg@560 | 215 | ifndef JTREG_TIMEOUT_FACTOR |
jjg@560 | 216 | JTREG_TIMEOUT_FACTOR = 3 |
jjg@560 | 217 | endif |
jjg@560 | 218 | endif |
jjg@560 | 219 | ifdef JTREG_TIMEOUT_FACTOR |
jjg@560 | 220 | JTREG_OPTIONS += -timeoutFactor:$(JTREG_TIMEOUT_FACTOR) |
jjg@560 | 221 | endif |
jjg@560 | 222 | |
dlsmith@2393 | 223 | # Default verbosity setting for jtreg |
sgehwolf@3835 | 224 | JTREG_VERBOSE = fail,error,summary |
dlsmith@2393 | 225 | |
dlsmith@2393 | 226 | # Default verbosity setting for jck |
dlsmith@2393 | 227 | JCK_VERBOSE = non-pass |
dlsmith@2393 | 228 | |
jjg@526 | 229 | # Assertions: some tests show failures when assertions are enabled. |
jjg@526 | 230 | # Since javac is typically loaded via the bootclassloader (either via TESTJAVA |
jjg@526 | 231 | # or TESTBOOTCLASSPATH), you may need -esa to enable assertions in javac. |
jjg@526 | 232 | JTREG_OPTIONS += $(ASSERTION_OPTIONS) |
jjg@526 | 233 | JCK_OPTIONS += $(ASSERTION_OPTIONS:%=-vmoptions:%) |
jjg@526 | 234 | |
jjg@526 | 235 | # Include shared options |
jjg@526 | 236 | JCK_COMPILER_OPTIONS += $(JCK_OPTIONS) |
jjg@526 | 237 | JCK_RUNTIME_OPTIONS += $(JCK_OPTIONS) |
jjg@526 | 238 | |
jjg@526 | 239 | # Exit codes: |
jjg@526 | 240 | # jtreg, jck: 0: OK, 1: tests failed, 2: tests error; 3+: SERIOUS |
jjg@526 | 241 | FATAL_JTREG_EXIT = 3 |
jjg@526 | 242 | FATAL_JCK_EXIT = 3 |
jjg@526 | 243 | # jtdiff: 0: OK, 1: differences found; 2+: SERIOUS |
jjg@526 | 244 | FATAL_JTDIFF_EXIT = 2 |
jjg@526 | 245 | # |
jjg@526 | 246 | # Exit -- used for final "normal" exit from "make". Redefine to "true" to avoid |
jjg@526 | 247 | # having make exit with non-zero return code. |
jjg@526 | 248 | EXIT = exit |
mduigou@2073 | 249 | # Function to exit shell if exit code of preceding command is greater than or equal |
jjg@526 | 250 | # to a given level. Redefine function or preceding FATAL_*_EXIT codes as needed. |
jjg@526 | 251 | EXIT_IF_FATAL = status=$$?; if [ $$status -ge $(1) ]; then exit $$status ; fi |
duke@1 | 252 | |
duke@1 | 253 | # The test directories to run |
duke@1 | 254 | DEFAULT_TESTDIRS = . |
duke@1 | 255 | TESTDIRS = $(DEFAULT_TESTDIRS) |
duke@1 | 256 | |
duke@1 | 257 | # Root of all test results |
jjg@526 | 258 | TEST_OUTPUT_DIR = $(TEST_ROOT)/../build/$(PLATFORM)-$(ARCH)/test/langtools |
sgehwolf@3835 | 259 | ifdef ALT_OUTPUTDIR |
sgehwolf@3835 | 260 | ABS_OUTPUTDIR := $(shell cd $(ALT_OUTPUTDIR) && pwd $(CYGPATH)) |
sgehwolf@3835 | 261 | else |
sgehwolf@3835 | 262 | ABS_OUTPUTDIR := $(shell mkdir -p $(TEST_OUTPUT_DIR); cd $(TEST_OUTPUT_DIR) && pwd $(CYGPATH)) |
sgehwolf@3835 | 263 | endif |
sgehwolf@3835 | 264 | ABS_TEST_OUTPUT_DIR := $(ABS_OUTPUTDIR)/testoutput/$(UNIQUE_DIR) |
jjg@526 | 265 | # Subdirectories for different test runs |
sgehwolf@3835 | 266 | JTREG_OUTPUT_DIR = $(ABS_OUTPUTDIR)/jtreg |
sgehwolf@3835 | 267 | JCK_COMPILER_OUTPUT_DIR = $(ABS_OUTPUTDIR)/jck-compiler |
sgehwolf@3835 | 268 | JCK_RUNTIME_OUTPUT_DIR = $(ABS_OUTPUTDIR)/jck-runtime-Xcompile |
duke@1 | 269 | |
jjg@526 | 270 | # Default make rule -- warning, may take a while |
jjg@526 | 271 | all: $(JPRT_CLEAN) jtreg-tests jck-compiler-tests jck-runtime-tests $(JPRT_ARCHIVE_BUNDLE) all-summary |
jjg@526 | 272 | @echo "Testing completed successfully" |
jjg@526 | 273 | |
mchung@1472 | 274 | jtreg apt javac javadoc javah javap jdeps: $(JPRT_CLEAN) jtreg-tests $(JPRT_ARCHIVE_BUNDLE) jtreg-summary |
jjg@526 | 275 | @echo "Testing completed successfully" |
jjg@526 | 276 | |
jjg@526 | 277 | jck-compiler: $(JPRT_CLEAN) jck-compiler-tests $(JPRT_ARCHIVE_BUNDLE) jck-compiler-summary |
jjg@526 | 278 | @echo "Testing completed successfully" |
jjg@526 | 279 | |
jjg@526 | 280 | jck-runtime: $(JPRT_CLEAN) jck-runtime-tests $(JPRT_ARCHIVE_BUNDLE) jck-runtime-summary |
duke@1 | 281 | @echo "Testing completed successfully" |
duke@1 | 282 | |
sgehwolf@3835 | 283 | tier1: jtreg-tests-tier1 |
sgehwolf@3835 | 284 | |
duke@1 | 285 | # for use with JPRT -testrule |
jjg@526 | 286 | all: JTREG_TESTDIRS = . |
jjg@526 | 287 | jtreg: JTREG_TESTDIRS = . |
jjg@526 | 288 | apt: JTREG_TESTDIRS = tools/apt |
jjg@526 | 289 | javac: JTREG_TESTDIRS = tools/javac |
jjg@526 | 290 | javadoc: JTREG_TESTDIRS = tools/javadoc com/sun/javadoc |
jjg@526 | 291 | javah: JTREG_TESTDIRS = tools/javah |
jjg@526 | 292 | javap: JTREG_TESTDIRS = tools/javap |
mchung@1472 | 293 | jdeps: JTREG_TESTDIRS = tools/jdeps |
jjg@526 | 294 | |
jjg@526 | 295 | # Run jtreg tests |
jjg@526 | 296 | # |
jjg@526 | 297 | # JTREG_HOME |
jjg@526 | 298 | # Installed location of jtreg |
jjg@526 | 299 | # JT_JAVA |
jjg@526 | 300 | # Version of java used to run jtreg. Should normally be the same as TESTJAVA |
jjg@526 | 301 | # TESTJAVA |
mduigou@2073 | 302 | # Version of java to be tested. |
dlsmith@2393 | 303 | # JTREG_VERBOSE |
dlsmith@2393 | 304 | # Verbosity setting for jtreg |
jjg@526 | 305 | # JTREG_OPTIONS |
jjg@526 | 306 | # Additional options for jtreg |
jjg@526 | 307 | # JTREG_TESTDIRS |
jjg@526 | 308 | # Directories of tests to be run |
jjg@526 | 309 | # JTREG_OUTPUT_DIR |
jjg@526 | 310 | # Where to write the results |
jjg@526 | 311 | # JTREG_REFERENCE |
jjg@526 | 312 | # (Optional) reference results (e.g. work, report or summary.txt) |
jjg@526 | 313 | # |
michaelm@1223 | 314 | jtreg_tests: jtreg-tests |
jjg@526 | 315 | jtreg-tests: check-jtreg FRC |
jjg@526 | 316 | @rm -f -r $(JTREG_OUTPUT_DIR)/JTwork $(JTREG_OUTPUT_DIR)/JTreport \ |
jjg@526 | 317 | $(JTREG_OUTPUT_DIR)/diff.html $(JTREG_OUTPUT_DIR)/status.txt |
jjg@526 | 318 | @mkdir -p $(JTREG_OUTPUT_DIR) |
jjg@526 | 319 | JT_JAVA=$(JT_JAVA) $(JTREG) \ |
jjg@526 | 320 | -J-Xmx512m \ |
vromero@1520 | 321 | -vmoption:-Xmx768m \ |
dlsmith@2393 | 322 | -a -ignore:quiet $(if $(JTREG_VERBOSE),-v:$(JTREG_VERBOSE)) \ |
jjg@526 | 323 | -r:$(JTREG_OUTPUT_DIR)/JTreport \ |
jjg@526 | 324 | -w:$(JTREG_OUTPUT_DIR)/JTwork \ |
jjg@526 | 325 | -jdk:$(TESTJAVA) \ |
jjg@526 | 326 | $(JAVA_ARGS:%=-vmoption:%) \ |
jjg@526 | 327 | $(JTREG_OPTIONS) \ |
jjg@526 | 328 | $(JTREG_TESTDIRS) \ |
jjg@526 | 329 | || ( $(call EXIT_IF_FATAL,$(FATAL_JTREG_EXIT)) ; \ |
jjg@526 | 330 | echo $$status > $(JTREG_OUTPUT_DIR)/status.txt \ |
jjg@526 | 331 | ) |
jjg@526 | 332 | ifdef JTREG_REFERENCE |
jjg@526 | 333 | JT_JAVA=$(JT_JAVA) $(JTDIFF) -o $(JTREG_OUTPUT_DIR)/diff.html \ |
jjg@526 | 334 | $(JTREG_REFERENCE) $(JTREG_OUTPUT_DIR)/JTreport \ |
jjg@526 | 335 | || ( $(call EXIT_IF_FATAL,$(FATAL_JTDIFF_EXIT)) ) |
jjg@526 | 336 | endif |
jjg@526 | 337 | |
jjg@526 | 338 | jtreg-summary: FRC |
jjg@526 | 339 | if [ -r $(JTREG_OUTPUT_DIR)/status.txt ]; then \ |
jjg@526 | 340 | echo ; echo "Summary of jtreg test failures" ; \ |
jjg@526 | 341 | cat $(JTREG_OUTPUT_DIR)/JTreport/text/summary.txt | \ |
jjg@526 | 342 | grep -v 'Not run' | grep -v 'Passed' ; \ |
jjg@526 | 343 | echo ; \ |
jjg@526 | 344 | $(EXIT) `cat $(JTREG_OUTPUT_DIR)/status.txt` ; \ |
jjg@526 | 345 | fi |
duke@1 | 346 | |
duke@1 | 347 | # Check to make sure these directories exist |
jjh@1124 | 348 | check-jtreg: $(PRODUCT_HOME) $(JTREG) |
duke@1 | 349 | |
jjg@526 | 350 | # Run JCK-compiler tests |
jjg@526 | 351 | # |
jjg@526 | 352 | # JCK_HOME |
jjg@526 | 353 | # Installed location of JCK: should include JCK-compiler, and JCK-extras |
jjh@1124 | 354 | # Default is JCK 8. |
jjg@526 | 355 | # JT_JAVA |
jjg@526 | 356 | # Version of java used to run JCK. Should normally be the same as TESTJAVA |
jjh@1124 | 357 | # Default is JDK 7 |
jjg@526 | 358 | # TESTJAVA |
mduigou@2073 | 359 | # Version of java to be tested. |
dlsmith@2393 | 360 | # JCK_VERBOSE |
dlsmith@2393 | 361 | # Verbosity setting for jtjck |
jjg@526 | 362 | # JCK_COMPILER_OPTIONS |
jjg@526 | 363 | # Additional options for JCK-compiler |
jjg@526 | 364 | # JCK_COMPILER_TESTDIRS |
jjg@526 | 365 | # Directories of tests to be run |
jjg@526 | 366 | # JCK_COMPILER_OUTPUT_DIR |
jjg@526 | 367 | # Where to write the results |
jjg@526 | 368 | # JCK_COMPILER_REFERENCE |
jjg@526 | 369 | # (Optional) reference results (e.g. work, report or summary.txt) |
jjg@526 | 370 | # |
jjg@526 | 371 | jck-compiler-tests: check-jck FRC |
jjg@526 | 372 | @rm -f -r $(JCK_COMPILER_OUTPUT_DIR)/work $(JCK_COMPILER_OUTPUT_DIR)/report \ |
jjg@526 | 373 | $(JCK_COMPILER_OUTPUT_DIR)/diff.html $(JCK_COMPILER_OUTPUT_DIR)/status.txt |
jjg@526 | 374 | @mkdir -p $(JCK_COMPILER_OUTPUT_DIR) |
dlsmith@2393 | 375 | $(JT_JAVA)/bin/java -Xmx512m \ |
jjh@1124 | 376 | -jar $(JCK_HOME)/JCK-compiler-8/lib/jtjck.jar \ |
dlsmith@2393 | 377 | $(if $(JCK_VERBOSE),-v:$(JCK_VERBOSE)) \ |
jjg@526 | 378 | -r:$(JCK_COMPILER_OUTPUT_DIR)/report \ |
jjg@526 | 379 | -w:$(JCK_COMPILER_OUTPUT_DIR)/work \ |
jjg@526 | 380 | -jdk:$(TESTJAVA) \ |
jjg@526 | 381 | $(JCK_COMPILER_OPTIONS) \ |
jjg@526 | 382 | $(JCK_COMPILER_TESTDIRS) \ |
jjg@526 | 383 | || ( $(call EXIT_IF_FATAL,$(FATAL_JCK_EXIT)) ; \ |
jjg@526 | 384 | echo $$status > $(JCK_COMPILER_OUTPUT_DIR)/status.txt \ |
jjg@526 | 385 | ) |
jjg@526 | 386 | ifdef JCK_COMPILER_REFERENCE |
jjg@526 | 387 | JT_JAVA=$(JT_JAVA) $(JTDIFF) -o $(JCK_COMPILER_OUTPUT_DIR)/diff.html \ |
jjg@526 | 388 | $(JCK_COMPILER_REFERENCE) $(JCK_COMPILER_OUTPUT_DIR)/report \ |
jjg@526 | 389 | || ( $(call EXIT_IF_FATAL,$(FATAL_JTDIFF_EXIT)) ) |
jjg@526 | 390 | endif |
jjg@526 | 391 | |
jjg@526 | 392 | jck-compiler-summary: FRC |
jjg@526 | 393 | if [ -r $(JCK_COMPILER_OUTPUT_DIR)/status.txt ]; then \ |
jjg@526 | 394 | echo ; echo "Summary of JCK-compiler test failures" ; \ |
jjg@526 | 395 | cat $(JCK_COMPILER_OUTPUT_DIR)/report/text/summary.txt | \ |
jjg@526 | 396 | grep -v 'Not run' | grep -v 'Passed' ; \ |
jjg@526 | 397 | echo ; \ |
jjg@526 | 398 | $(EXIT) `cat $(JCK_COMPILER_OUTPUT_DIR)/status.txt` ; \ |
jjg@526 | 399 | fi |
jjg@526 | 400 | |
jjg@526 | 401 | # Run JCK-runtime tests in -Xcompile mode |
jjg@526 | 402 | # This is a special mode to test javac by compiling the tests in the JCK-runtime test suite |
jjg@526 | 403 | # Normal JCK-runtime invocation belongs in the jdk/ repository. |
jjg@526 | 404 | # |
jjg@526 | 405 | # JCK_HOME |
jjg@526 | 406 | # Installed location of JCK: should include JCK-compiler, JCK-runtime and JCK-extras |
jjg@526 | 407 | # JT_JAVA |
jjg@526 | 408 | # Version of java used to run JCK. Should normally be the same as TESTJAVA |
jjg@526 | 409 | # TESTJAVA |
mduigou@2073 | 410 | # Version of java to be tested. |
dlsmith@2393 | 411 | # JCK_VERBOSE |
dlsmith@2393 | 412 | # Verbosity setting for jtjck |
jjg@526 | 413 | # JCK_RUNTIME_OPTIONS |
jjg@526 | 414 | # Additional options for JCK-runtime |
jjg@526 | 415 | # JCK_RUNTIME_TESTDIRS |
jjg@526 | 416 | # Directories of tests to be run |
jjg@526 | 417 | # JCK_RUNTIME_OUTPUT_DIR |
jjg@526 | 418 | # Where to write the results |
jjg@526 | 419 | # JCK_RUNTIME_REFERENCE |
jjg@526 | 420 | # (Optional) reference results (e.g. work, report or summary.txt) |
jjg@526 | 421 | # |
jjg@526 | 422 | jck-runtime-tests: check-jck FRC |
jjg@526 | 423 | @rm -f -r $(JCK_RUNTIME_OUTPUT_DIR)/work $(JCK_RUNTIME_OUTPUT_DIR)/report \ |
jjg@526 | 424 | $(JCK_RUNTIME_OUTPUT_DIR)/diff.html $(JCK_RUNTIME_OUTPUT_DIR)/status.txt |
jjg@526 | 425 | @mkdir -p $(JCK_RUNTIME_OUTPUT_DIR) |
dlsmith@2393 | 426 | $(JT_JAVA)/bin/java -Xmx512m \ |
jjh@1124 | 427 | -jar $(JCK_HOME)/JCK-runtime-8/lib/jtjck.jar \ |
dlsmith@2393 | 428 | $(if $(JCK_VERBOSE),-v:$(JCK_VERBOSE)) \ |
jjg@526 | 429 | -r:$(JCK_RUNTIME_OUTPUT_DIR)/report \ |
jjg@526 | 430 | -w:$(JCK_RUNTIME_OUTPUT_DIR)/work \ |
jjg@526 | 431 | -jdk:$(TESTJAVA) \ |
jjg@526 | 432 | -Xcompile \ |
jjg@526 | 433 | $(JCK_RUNTIME_OPTIONS) \ |
jjg@526 | 434 | $(JCK_RUNTIME_TESTDIRS) \ |
jjg@526 | 435 | || ( $(call EXIT_IF_FATAL,$(FATAL_JCK_EXIT)) ; \ |
jjg@526 | 436 | echo $$status > $(JCK_RUNTIME_OUTPUT_DIR)/status.txt \ |
jjg@526 | 437 | ) |
jjg@526 | 438 | ifdef JCK_RUNTIME_REFERENCE |
jjg@526 | 439 | JT_JAVA=$(JT_JAVA) $(JTDIFF) -o $(JCK_RUNTIME_OUTPUT_DIR)/diff.html \ |
jjg@526 | 440 | $(JCK_RUNTIME_REFERENCE) $(JCK_RUNTIME_OUTPUT_DIR)/report \ |
jjg@526 | 441 | || ( $(call EXIT_IF_FATAL,$(FATAL_JTDIFF_EXIT)) ) |
jjg@526 | 442 | endif |
jjg@526 | 443 | |
jjg@526 | 444 | jck-runtime-summary: FRC |
jjg@526 | 445 | if [ -r $(JCK_RUNTIME_OUTPUT_DIR)/status.txt ]; then \ |
jjg@526 | 446 | echo ; echo "Summary of JCK-runtime test failures" ; \ |
jjg@526 | 447 | cat $(JCK_RUNTIME_OUTPUT_DIR)/report/text/summary.txt | \ |
jjg@526 | 448 | grep -v 'Not run' | grep -v 'Passed' ; \ |
jjg@526 | 449 | echo ; \ |
jjg@526 | 450 | $(EXIT) `cat $(JCK_RUNTIME_OUTPUT_DIR)/status.txt` ; \ |
jjg@526 | 451 | fi |
jjg@526 | 452 | |
jjg@526 | 453 | # Check to make sure these directories exist |
jjh@1124 | 454 | check-jck: $(JCK_HOME) $(PRODUCT_HOME) |
jjg@526 | 455 | |
jjg@526 | 456 | all-summary: FRC |
jjg@526 | 457 | if [ -n "`find $(TEST_OUTPUT_DIR) -name status.txt`" ]; then |
jjg@526 | 458 | echo ; echo "Summary of test failures" ; \ |
jjg@526 | 459 | cat `find $(TEST_OUTPUT_DIR) -name summary.txt` | \ |
jjg@526 | 460 | grep -v 'Not run' | grep -v 'Passed' ; \ |
jjg@526 | 461 | echo ; \ |
jjg@526 | 462 | $(EXIT) 1 |
jjg@526 | 463 | fi |
duke@1 | 464 | |
duke@1 | 465 | # Bundle up the results |
duke@1 | 466 | $(JPRT_ARCHIVE_BUNDLE): FRC |
duke@1 | 467 | @rm -f $@ |
duke@1 | 468 | @mkdir -p $(@D) |
duke@1 | 469 | ( cd $(TEST_OUTPUT_DIR) && zip -q -r $@ . ) |
duke@1 | 470 | |
duke@1 | 471 | # Cleanup |
duke@1 | 472 | clean: |
duke@1 | 473 | rm -f $(JPRT_ARCHIVE_BUNDLE) |
duke@1 | 474 | |
duke@1 | 475 | # Used to force a target rules to run |
duke@1 | 476 | FRC: |
duke@1 | 477 | |
sgehwolf@3835 | 478 | # |
sgehwolf@3835 | 479 | # Tier 1 langtools testing logic |
sgehwolf@3835 | 480 | # |
sgehwolf@3835 | 481 | |
sgehwolf@3835 | 482 | ARCHIVE_BUNDLE = $(ABS_TEST_OUTPUT_DIR)/ARCHIVE_BUNDLE.zip |
sgehwolf@3835 | 483 | |
sgehwolf@3835 | 484 | # How to create the test bundle (pass or fail, we want to create this) |
sgehwolf@3835 | 485 | # Follow command with ";$(BUNDLE_UP_AND_EXIT)", so it always gets executed. |
sgehwolf@3835 | 486 | ZIP_UP_RESULTS = ( $(MKDIR) -p `$(DIRNAME) $(ARCHIVE_BUNDLE)` \ |
sgehwolf@3835 | 487 | && $(CD) $(ABS_TEST_OUTPUT_DIR) \ |
sgehwolf@3835 | 488 | && $(CHMOD) -R a+r . \ |
sgehwolf@3835 | 489 | && $(ZIP) -q -r $(ARCHIVE_BUNDLE) . ) |
sgehwolf@3835 | 490 | |
sgehwolf@3835 | 491 | # important results files |
sgehwolf@3835 | 492 | SUMMARY_TXT = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/JTreport/text/summary.txt") |
sgehwolf@3835 | 493 | STATS_TXT_NAME = Stats.txt |
sgehwolf@3835 | 494 | STATS_TXT = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/$(STATS_TXT_NAME)") |
sgehwolf@3835 | 495 | RUNLIST = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/runlist.txt") |
sgehwolf@3835 | 496 | PASSLIST = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/passlist.txt") |
sgehwolf@3835 | 497 | FAILLIST = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/faillist.txt") |
sgehwolf@3835 | 498 | EXITCODE = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/exitcode.txt") |
sgehwolf@3835 | 499 | |
sgehwolf@3835 | 500 | TESTEXIT = \ |
sgehwolf@3835 | 501 | if [ ! -s $(EXITCODE) ] ; then \ |
sgehwolf@3835 | 502 | $(ECHO) "ERROR: EXITCODE file not filled in."; \ |
sgehwolf@3835 | 503 | $(ECHO) "1" > $(EXITCODE); \ |
sgehwolf@3835 | 504 | fi ; \ |
sgehwolf@3835 | 505 | testExitCode=`$(CAT) $(EXITCODE)`; \ |
sgehwolf@3835 | 506 | $(ECHO) "EXIT CODE: $${testExitCode}"; \ |
sgehwolf@3835 | 507 | exit $${testExitCode} |
sgehwolf@3835 | 508 | |
sgehwolf@3835 | 509 | BUNDLE_UP_AND_EXIT = \ |
sgehwolf@3835 | 510 | ( \ |
sgehwolf@3835 | 511 | jtregExitCode=$$? && \ |
sgehwolf@3835 | 512 | _summary="$(SUMMARY_TXT)"; \ |
sgehwolf@3835 | 513 | $(RM) -f $(STATS_TXT) $(RUNLIST) $(PASSLIST) $(FAILLIST) $(EXITCODE); \ |
sgehwolf@3835 | 514 | $(ECHO) "$${jtregExitCode}" > $(EXITCODE); \ |
sgehwolf@3835 | 515 | if [ -r "$${_summary}" ] ; then \ |
sgehwolf@3835 | 516 | $(ECHO) "Summary: $(UNIQUE_DIR)" > $(STATS_TXT); \ |
sgehwolf@3835 | 517 | $(EXPAND) $${_summary} | $(EGREP) -v ' Not run\.' > $(RUNLIST); \ |
sgehwolf@3835 | 518 | $(EGREP) ' Passed\.' $(RUNLIST) \ |
sgehwolf@3835 | 519 | | $(EGREP) -v ' Error\.' \ |
sgehwolf@3835 | 520 | | $(EGREP) -v ' Failed\.' > $(PASSLIST); \ |
sgehwolf@3835 | 521 | ( $(EGREP) ' Failed\.' $(RUNLIST); \ |
sgehwolf@3835 | 522 | $(EGREP) ' Error\.' $(RUNLIST); \ |
sgehwolf@3835 | 523 | $(EGREP) -v ' Passed\.' $(RUNLIST) ) \ |
sgehwolf@3835 | 524 | | $(SORT) | $(UNIQ) > $(FAILLIST); \ |
sgehwolf@3835 | 525 | if [ $${jtregExitCode} != 0 -o -s $(FAILLIST) ] ; then \ |
sgehwolf@3835 | 526 | $(EXPAND) $(FAILLIST) \ |
sgehwolf@3835 | 527 | | $(CUT) -d' ' -f1 \ |
sgehwolf@3835 | 528 | | $(SED) -e 's@^@FAILED: @' >> $(STATS_TXT); \ |
sgehwolf@3835 | 529 | if [ $${jtregExitCode} = 0 ] ; then \ |
sgehwolf@3835 | 530 | jtregExitCode=1; \ |
sgehwolf@3835 | 531 | fi; \ |
sgehwolf@3835 | 532 | fi; \ |
sgehwolf@3835 | 533 | runc="`$(CAT) $(RUNLIST) | $(WC) -l | $(AWK) '{print $$1;}'`"; \ |
sgehwolf@3835 | 534 | passc="`$(CAT) $(PASSLIST) | $(WC) -l | $(AWK) '{print $$1;}'`"; \ |
sgehwolf@3835 | 535 | failc="`$(CAT) $(FAILLIST) | $(WC) -l | $(AWK) '{print $$1;}'`"; \ |
sgehwolf@3835 | 536 | exclc="FIXME CODETOOLS-7900176"; \ |
sgehwolf@3835 | 537 | $(ECHO) "TEST STATS: name=$(UNIQUE_DIR) run=$${runc} pass=$${passc} fail=$${failc}" \ |
sgehwolf@3835 | 538 | >> $(STATS_TXT); \ |
sgehwolf@3835 | 539 | else \ |
sgehwolf@3835 | 540 | $(ECHO) "Missing file: $${_summary}" >> $(STATS_TXT); \ |
sgehwolf@3835 | 541 | fi; \ |
sgehwolf@3835 | 542 | if [ -f $(STATS_TXT) ] ; then \ |
sgehwolf@3835 | 543 | $(CAT) $(STATS_TXT); \ |
sgehwolf@3835 | 544 | fi; \ |
sgehwolf@3835 | 545 | $(ZIP_UP_RESULTS) ; \ |
sgehwolf@3835 | 546 | $(TESTEXIT) \ |
sgehwolf@3835 | 547 | ) |
sgehwolf@3835 | 548 | |
sgehwolf@3835 | 549 | prep-tier1: |
sgehwolf@3835 | 550 | @$(MKDIR) -p $(ABS_TEST_OUTPUT_DIR) |
sgehwolf@3835 | 551 | |
sgehwolf@3835 | 552 | # Run tier1 jtreg |
sgehwolf@3835 | 553 | jtreg-tests-tier1: check-jtreg prep-tier1 FRC |
sgehwolf@3835 | 554 | ( \ |
sgehwolf@3835 | 555 | ( JT_HOME=$(shell $(GETMIXEDPATH) "$(JT_HOME)"); \ |
sgehwolf@3835 | 556 | export JT_HOME; \ |
sgehwolf@3835 | 557 | $(shell $(GETMIXEDPATH) "$(JTREG)") \ |
sgehwolf@3835 | 558 | -J-Xmx512m \ |
sgehwolf@3835 | 559 | -vmoption:-Xmx768m \ |
sgehwolf@3835 | 560 | -a -ignore:quiet $(if $(JTREG_VERBOSE),-v:$(JTREG_VERBOSE)) \ |
sgehwolf@3835 | 561 | -r:$(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/JTreport") \ |
sgehwolf@3835 | 562 | -w:$(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/JTwork") \ |
sgehwolf@3835 | 563 | -jdk:$(shell $(GETMIXEDPATH) "$(TESTJAVA)") \ |
sgehwolf@3835 | 564 | $(JAVA_ARGS:%=-vmoption:%) \ |
sgehwolf@3835 | 565 | $(JTREG_OPTIONS) \ |
sgehwolf@3835 | 566 | :langtools_tier1 \ |
sgehwolf@3835 | 567 | ) ; \ |
sgehwolf@3835 | 568 | $(BUNDLE_UP_AND_EXIT) \ |
sgehwolf@3835 | 569 | ) 2>&1 | $(TEE) $(ABS_TEST_OUTPUT_DIR)/output.txt ; $(TESTEXIT) |
sgehwolf@3835 | 570 | |
duke@1 | 571 | # Phony targets (e.g. these are not filenames) |
jjg@526 | 572 | .PHONY: all clean \ |
mchung@1472 | 573 | jtreg javac javadoc javah javap jdeps jtreg-tests jtreg-summary check-jtreg \ |
jjg@526 | 574 | jck-compiler jck-compiler-tests jck-compiler-summary \ |
sgehwolf@3835 | 575 | jck-runtime jck-runtime-tests jck-runtime-summary check-jck prep-tier1 \ |
sgehwolf@3835 | 576 | jtreg-tests-tier1 tier1 |
duke@1 | 577 | |
jjg@526 | 578 | # No use of suffix rules |
jjg@526 | 579 | .SUFFIXES: |
jjg@526 | 580 |