Fri, 12 Nov 2010 12:32:43 +0000
6598108: com.sun.source.util.Trees.isAccessible incorrect
Summary: JavacTrees' version of isAccessible should take into account enclosing class accessibility
Reviewed-by: jjg
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 | # |
jjg@526 | 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 | |
duke@1 | 19 | # Get OS/ARCH specifics |
duke@1 | 20 | OSNAME = $(shell uname -s) |
duke@1 | 21 | ifeq ($(OSNAME), SunOS) |
duke@1 | 22 | PLATFORM = solaris |
duke@1 | 23 | JT_PLATFORM = solaris |
duke@1 | 24 | ARCH = $(shell uname -p) |
duke@1 | 25 | ifeq ($(ARCH), i386) |
duke@1 | 26 | ARCH=i586 |
duke@1 | 27 | endif |
duke@1 | 28 | endif |
duke@1 | 29 | ifeq ($(OSNAME), Linux) |
duke@1 | 30 | PLATFORM = linux |
duke@1 | 31 | JT_PLATFORM = linux |
duke@1 | 32 | ARCH = $(shell uname -m) |
duke@1 | 33 | ifeq ($(ARCH), i386) |
duke@1 | 34 | ARCH=i586 |
duke@1 | 35 | endif |
duke@1 | 36 | endif |
duke@1 | 37 | ifeq ($(OSNAME), Windows_NT) |
duke@1 | 38 | PLATFORM = windows |
duke@1 | 39 | JT_PLATFORM = win32 |
duke@1 | 40 | ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)),ia64) |
duke@1 | 41 | ARCH=ia64 |
duke@1 | 42 | else |
duke@1 | 43 | ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)),AMD64) |
duke@1 | 44 | ARCH=x64 |
duke@1 | 45 | else |
duke@1 | 46 | ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)),EM64T) |
duke@1 | 47 | ARCH=x64 |
duke@1 | 48 | else |
duke@1 | 49 | ARCH=i586 |
duke@1 | 50 | endif |
duke@1 | 51 | endif |
duke@1 | 52 | endif |
jjg@565 | 53 | EXE_SUFFIX=.exe |
duke@1 | 54 | endif |
duke@1 | 55 | |
duke@1 | 56 | # Root of this test area (important to use full paths in some places) |
duke@1 | 57 | TEST_ROOT := $(shell pwd) |
duke@1 | 58 | |
jjg@526 | 59 | # Default bundle of all test results (passed or not) (JPRT only) |
jjg@526 | 60 | ifdef JPRT_JOB_ID |
jjg@526 | 61 | JPRT_CLEAN = clean |
jjg@526 | 62 | JPRT_ARCHIVE_BUNDLE = $(TEST_ROOT)/JPRT_ARCHIVE_BUNDLE.zip |
jjg@526 | 63 | endif |
duke@1 | 64 | |
duke@1 | 65 | ifeq ($(PLATFORM), windows) |
duke@1 | 66 | SLASH_JAVA = J: |
duke@1 | 67 | else |
duke@1 | 68 | SLASH_JAVA = /java |
duke@1 | 69 | endif |
duke@1 | 70 | |
duke@1 | 71 | # Default JTREG to run |
jjg@397 | 72 | ifdef JPRT_JTREG_HOME |
jjg@397 | 73 | JTREG_HOME = $(JPRT_JTREG_HOME) |
jjg@397 | 74 | else |
jjg@397 | 75 | JTREG_HOME = $(SLASH_JAVA)/re/jtreg/4.0/promoted/latest/binaries/jtreg |
jjg@397 | 76 | endif |
jjg@397 | 77 | JTREG = $(JTREG_HOME)/$(JT_PLATFORM)/bin/jtreg |
jjg@526 | 78 | JTDIFF = $(JTREG_HOME)/$(JT_PLATFORM)/bin/jtdiff |
duke@1 | 79 | |
jjg@526 | 80 | # Default JCK to run |
jjg@526 | 81 | ifdef JPRT_JCK_HOME |
jjg@526 | 82 | JCK_HOME = $(JPRT_JCK_HOME) |
jjg@526 | 83 | else |
jjg@526 | 84 | JCK_HOME = $(SLASH_JAVA)/re/jck/7/promoted/latest/binaries |
jjg@526 | 85 | endif |
jjg@526 | 86 | |
jjg@526 | 87 | # Default JDK for JTREG and JCK |
jjg@526 | 88 | # |
jjg@526 | 89 | # JT_JAVA is the version of java used to run jtreg/JCK. Since it is now |
jjg@526 | 90 | # standard to execute tests in sameVM mode, it should normally be set the |
jjg@526 | 91 | # same as TESTJAVA (although not necessarily so.) |
jjg@526 | 92 | # |
duke@1 | 93 | ifdef JPRT_JAVA_HOME |
duke@1 | 94 | JT_JAVA = $(JPRT_JAVA_HOME) |
duke@1 | 95 | else |
duke@1 | 96 | JT_JAVA = $(SLASH_JAVA)/re/jdk/1.6.0/archive/fcs/binaries/$(PLATFORM)-$(ARCH) |
duke@1 | 97 | endif |
duke@1 | 98 | |
duke@1 | 99 | # Default JDK to test |
jjg@397 | 100 | ifdef JPRT_IMPORT_PRODUCT_HOME |
jjg@397 | 101 | TESTJAVA = $(JPRT_IMPORT_PRODUCT_HOME) |
jjg@397 | 102 | else |
jjg@397 | 103 | TESTJAVA = $(SLASH_JAVA)/re/jdk/1.7.0/promoted/latest/binaries/$(PLATFORM)-$(ARCH) |
jjg@397 | 104 | endif |
jjg@397 | 105 | |
jjg@526 | 106 | # PRODUCT_HOME is a JPRT variable pointing to a directory containing the output from |
jjg@526 | 107 | # make/Makefile |
jjg@526 | 108 | # For langtools, this is a directory containing build and dist |
jjg@565 | 109 | # For a control build, this is build/$(PRODUCT)-$(ARCH)/XYZ-image |
jjg@565 | 110 | # (i.e, j2sdk-image or jdk-module-image) |
jjg@526 | 111 | ifdef PRODUCT_HOME |
jjg@526 | 112 | ifeq ($(shell [ -r $(PRODUCT_HOME)/dist/lib/classes.jar ]; echo $$?),0) |
jjg@526 | 113 | TESTBOOTCLASSPATH = $(PRODUCT_HOME)/dist/lib/classes.jar |
jjg@526 | 114 | endif |
jjg@565 | 115 | ifeq ($(shell [ -r $(PRODUCT_HOME)/bin/javac$(EXE_SUFFIX) ]; echo $$?),0) |
jjg@526 | 116 | TESTJAVA = $(PRODUCT_HOME) |
jjg@526 | 117 | endif |
jjg@526 | 118 | endif |
jjg@526 | 119 | |
jjg@526 | 120 | ifdef TESTBOOTCLASSPATH |
jjg@526 | 121 | JTREG_OPTIONS += -Xbootclasspath/p:$(TESTBOOTCLASSPATH) |
jjg@526 | 122 | ### In the following, -refvmoptions is an undocumented option |
jjg@526 | 123 | ### The following does not work JCK 7 b30 2/6/2010. Awaiting b31. |
jjg@526 | 124 | JCK_OPTIONS += \ |
jjg@526 | 125 | -vmoptions:-Xbootclasspath/p:$(TESTBOOTCLASSPATH) \ |
jjg@526 | 126 | -refvmoptions:-Xbootclasspath/p:$(TESTBOOTCLASSPATH) |
jjg@526 | 127 | endif |
jjg@526 | 128 | |
jjg@526 | 129 | # Concurrency is the number of tests that can execute at once. |
jjg@526 | 130 | # Supported for JCK, not supported for jtreg. |
jjg@526 | 131 | # On an otherwise empty machine, suggest setting to (#cpus + 2) |
jjg@526 | 132 | # If unset, the default is (#cpus) |
jjg@526 | 133 | ### RFE: determine and use #cpus |
jjg@526 | 134 | ifdef JCK_CONCURRENCY |
jjg@526 | 135 | JCK_OPTIONS += -concurrency:$(JCK_CONCURRENCY) |
jjg@526 | 136 | endif |
jjg@526 | 137 | |
jjg@526 | 138 | # JCK is executed using "Multi-JVM Group Mode", which is a hybrid |
jjg@526 | 139 | # of otherVM and sameVM modes. New JVMs are created and reused for |
jjg@526 | 140 | # a number of tests, then eventually discarded and a new one started. |
jjg@526 | 141 | # This amortizes the JVM startup time. The "group size" defines |
jjg@526 | 142 | # how many tests are run in a JVM before it is replaced. |
jjg@526 | 143 | # If unset, the default is 100. |
jjg@526 | 144 | JCK_GROUP_SIZE = 1000 |
jjg@526 | 145 | ifdef JCK_GROUP_SIZE |
jjg@526 | 146 | JCK_COMPILER_OPTIONS += \ |
jjg@526 | 147 | -jtoptions:-Ejck.env.compiler.testCompile.groupMode.groupSize=$(JCK_GROUP_SIZE) \ |
jjg@526 | 148 | -jtoptions:-Ejck.env.compiler.compRefExecute.groupMode.groupSize=$(JCK_GROUP_SIZE) |
jjg@526 | 149 | ### The following is not supported. Awaiting RFE 6924287 |
jjg@526 | 150 | ### 6924287: Jck4Jdk: Allow to configure test group size for group mode via simple command line option |
jjg@526 | 151 | ### JCK_RUNTIME_OPTIONS += \ |
jjg@526 | 152 | ### -jtoptions:-Ejck.env.runtime.testCompile.groupMode.groupSize=$(JCK_GROUP_SIZE) |
jjg@526 | 153 | endif |
jjg@526 | 154 | |
jjg@560 | 155 | # Timeouts -- by default, increase test timeouts when running on JPRT |
jjg@560 | 156 | ifdef JPRT_JOB_ID |
jjg@560 | 157 | ifndef JTREG_TIMEOUT_FACTOR |
jjg@560 | 158 | JTREG_TIMEOUT_FACTOR = 3 |
jjg@560 | 159 | endif |
jjg@560 | 160 | endif |
jjg@560 | 161 | ifdef JTREG_TIMEOUT_FACTOR |
jjg@560 | 162 | JTREG_OPTIONS += -timeoutFactor:$(JTREG_TIMEOUT_FACTOR) |
jjg@560 | 163 | endif |
jjg@560 | 164 | |
jjg@526 | 165 | # Assertions: some tests show failures when assertions are enabled. |
jjg@526 | 166 | # Since javac is typically loaded via the bootclassloader (either via TESTJAVA |
jjg@526 | 167 | # or TESTBOOTCLASSPATH), you may need -esa to enable assertions in javac. |
jjg@526 | 168 | JTREG_OPTIONS += $(ASSERTION_OPTIONS) |
jjg@526 | 169 | JCK_OPTIONS += $(ASSERTION_OPTIONS:%=-vmoptions:%) |
jjg@526 | 170 | |
jjg@526 | 171 | # Include shared options |
jjg@526 | 172 | JCK_COMPILER_OPTIONS += $(JCK_OPTIONS) |
jjg@526 | 173 | JCK_RUNTIME_OPTIONS += $(JCK_OPTIONS) |
jjg@526 | 174 | |
jjg@526 | 175 | # Exit codes: |
jjg@526 | 176 | # jtreg, jck: 0: OK, 1: tests failed, 2: tests error; 3+: SERIOUS |
jjg@526 | 177 | FATAL_JTREG_EXIT = 3 |
jjg@526 | 178 | FATAL_JCK_EXIT = 3 |
jjg@526 | 179 | # jtdiff: 0: OK, 1: differences found; 2+: SERIOUS |
jjg@526 | 180 | FATAL_JTDIFF_EXIT = 2 |
jjg@526 | 181 | # |
jjg@526 | 182 | # Exit -- used for final "normal" exit from "make". Redefine to "true" to avoid |
jjg@526 | 183 | # having make exit with non-zero return code. |
jjg@526 | 184 | EXIT = exit |
jjg@526 | 185 | # Function to exit shell if exit code of preceding command is greater than or equal |
jjg@526 | 186 | # to a given level. Redefine function or preceding FATAL_*_EXIT codes as needed. |
jjg@526 | 187 | EXIT_IF_FATAL = status=$$?; if [ $$status -ge $(1) ]; then exit $$status ; fi |
duke@1 | 188 | |
duke@1 | 189 | # The test directories to run |
duke@1 | 190 | DEFAULT_TESTDIRS = . |
duke@1 | 191 | TESTDIRS = $(DEFAULT_TESTDIRS) |
duke@1 | 192 | |
duke@1 | 193 | # Root of all test results |
jjg@526 | 194 | TEST_OUTPUT_DIR = $(TEST_ROOT)/../build/$(PLATFORM)-$(ARCH)/test/langtools |
jjg@526 | 195 | ABS_TEST_OUTPUT_DIR := \ |
jjg@526 | 196 | $(shell mkdir -p $(TEST_ROOT)/../build/$(PLATFORM)-$(ARCH)/test/langtools; \ |
jjg@526 | 197 | cd $(TEST_ROOT)/../build/$(PLATFORM)-$(ARCH)/test/langtools; \ |
jjg@526 | 198 | pwd ) |
jjg@526 | 199 | # Subdirectories for different test runs |
jjg@526 | 200 | JTREG_OUTPUT_DIR = $(ABS_TEST_OUTPUT_DIR)/jtreg |
jjg@526 | 201 | JCK_COMPILER_OUTPUT_DIR = $(ABS_TEST_OUTPUT_DIR)/jck-compiler |
jjg@526 | 202 | JCK_RUNTIME_OUTPUT_DIR = $(ABS_TEST_OUTPUT_DIR)/jck-runtime-Xcompile |
duke@1 | 203 | |
jjg@526 | 204 | # Default make rule -- warning, may take a while |
jjg@526 | 205 | all: $(JPRT_CLEAN) jtreg-tests jck-compiler-tests jck-runtime-tests $(JPRT_ARCHIVE_BUNDLE) all-summary |
jjg@526 | 206 | @echo "Testing completed successfully" |
jjg@526 | 207 | |
jjg@526 | 208 | jtreg apt javac javadoc javah javap: $(JPRT_CLEAN) jtreg-tests $(JPRT_ARCHIVE_BUNDLE) jtreg-summary |
jjg@526 | 209 | @echo "Testing completed successfully" |
jjg@526 | 210 | |
jjg@526 | 211 | jck-compiler: $(JPRT_CLEAN) jck-compiler-tests $(JPRT_ARCHIVE_BUNDLE) jck-compiler-summary |
jjg@526 | 212 | @echo "Testing completed successfully" |
jjg@526 | 213 | |
jjg@526 | 214 | jck-runtime: $(JPRT_CLEAN) jck-runtime-tests $(JPRT_ARCHIVE_BUNDLE) jck-runtime-summary |
duke@1 | 215 | @echo "Testing completed successfully" |
duke@1 | 216 | |
duke@1 | 217 | # for use with JPRT -testrule |
jjg@526 | 218 | all: JTREG_TESTDIRS = . |
jjg@526 | 219 | jtreg: JTREG_TESTDIRS = . |
jjg@526 | 220 | apt: JTREG_TESTDIRS = tools/apt |
jjg@526 | 221 | javac: JTREG_TESTDIRS = tools/javac |
jjg@526 | 222 | javadoc: JTREG_TESTDIRS = tools/javadoc com/sun/javadoc |
jjg@526 | 223 | javah: JTREG_TESTDIRS = tools/javah |
jjg@526 | 224 | javap: JTREG_TESTDIRS = tools/javap |
jjg@526 | 225 | |
jjg@526 | 226 | # Run jtreg tests |
jjg@526 | 227 | # |
jjg@526 | 228 | # JTREG_HOME |
jjg@526 | 229 | # Installed location of jtreg |
jjg@526 | 230 | # JT_JAVA |
jjg@526 | 231 | # Version of java used to run jtreg. Should normally be the same as TESTJAVA |
jjg@526 | 232 | # TESTJAVA |
jjg@526 | 233 | # Version of java to be tested. |
jjg@526 | 234 | # JTREG_OPTIONS |
jjg@526 | 235 | # Additional options for jtreg |
jjg@526 | 236 | # JTREG_TESTDIRS |
jjg@526 | 237 | # Directories of tests to be run |
jjg@526 | 238 | # JTREG_OUTPUT_DIR |
jjg@526 | 239 | # Where to write the results |
jjg@526 | 240 | # JTREG_REFERENCE |
jjg@526 | 241 | # (Optional) reference results (e.g. work, report or summary.txt) |
jjg@526 | 242 | # |
jjg@526 | 243 | jtreg-tests: check-jtreg FRC |
jjg@526 | 244 | @rm -f -r $(JTREG_OUTPUT_DIR)/JTwork $(JTREG_OUTPUT_DIR)/JTreport \ |
jjg@526 | 245 | $(JTREG_OUTPUT_DIR)/diff.html $(JTREG_OUTPUT_DIR)/status.txt |
jjg@526 | 246 | @mkdir -p $(JTREG_OUTPUT_DIR) |
jjg@526 | 247 | JT_JAVA=$(JT_JAVA) $(JTREG) \ |
jjg@526 | 248 | -J-Xmx512m \ |
jjg@526 | 249 | -a -samevm -ignore:quiet -v:fail,error,nopass \ |
jjg@526 | 250 | -r:$(JTREG_OUTPUT_DIR)/JTreport \ |
jjg@526 | 251 | -w:$(JTREG_OUTPUT_DIR)/JTwork \ |
jjg@526 | 252 | -jdk:$(TESTJAVA) \ |
jjg@526 | 253 | $(JAVA_ARGS:%=-vmoption:%) \ |
jjg@526 | 254 | $(JTREG_OPTIONS) \ |
jjg@526 | 255 | $(JTREG_TESTDIRS) \ |
jjg@526 | 256 | || ( $(call EXIT_IF_FATAL,$(FATAL_JTREG_EXIT)) ; \ |
jjg@526 | 257 | echo $$status > $(JTREG_OUTPUT_DIR)/status.txt \ |
jjg@526 | 258 | ) |
jjg@526 | 259 | ifdef JTREG_REFERENCE |
jjg@526 | 260 | JT_JAVA=$(JT_JAVA) $(JTDIFF) -o $(JTREG_OUTPUT_DIR)/diff.html \ |
jjg@526 | 261 | $(JTREG_REFERENCE) $(JTREG_OUTPUT_DIR)/JTreport \ |
jjg@526 | 262 | || ( $(call EXIT_IF_FATAL,$(FATAL_JTDIFF_EXIT)) ) |
jjg@526 | 263 | endif |
jjg@526 | 264 | |
jjg@526 | 265 | jtreg-summary: FRC |
jjg@526 | 266 | if [ -r $(JTREG_OUTPUT_DIR)/status.txt ]; then \ |
jjg@526 | 267 | echo ; echo "Summary of jtreg test failures" ; \ |
jjg@526 | 268 | cat $(JTREG_OUTPUT_DIR)/JTreport/text/summary.txt | \ |
jjg@526 | 269 | grep -v 'Not run' | grep -v 'Passed' ; \ |
jjg@526 | 270 | echo ; \ |
jjg@526 | 271 | $(EXIT) `cat $(JTREG_OUTPUT_DIR)/status.txt` ; \ |
jjg@526 | 272 | fi |
duke@1 | 273 | |
duke@1 | 274 | # Check to make sure these directories exist |
jjg@526 | 275 | check-jtreg: $(JT_HOME) $(PRODUCT_HOME) $(JTREG) |
duke@1 | 276 | |
jjg@526 | 277 | |
jjg@526 | 278 | # Run JCK-compiler tests |
jjg@526 | 279 | # |
jjg@526 | 280 | # JCK_HOME |
jjg@526 | 281 | # Installed location of JCK: should include JCK-compiler, and JCK-extras |
jjg@526 | 282 | # JT_JAVA |
jjg@526 | 283 | # Version of java used to run JCK. Should normally be the same as TESTJAVA |
jjg@526 | 284 | # TESTJAVA |
jjg@526 | 285 | # Version of java to be tested. |
jjg@526 | 286 | # JCK_COMPILER_OPTIONS |
jjg@526 | 287 | # Additional options for JCK-compiler |
jjg@526 | 288 | # JCK_COMPILER_TESTDIRS |
jjg@526 | 289 | # Directories of tests to be run |
jjg@526 | 290 | # JCK_COMPILER_OUTPUT_DIR |
jjg@526 | 291 | # Where to write the results |
jjg@526 | 292 | # JCK_COMPILER_REFERENCE |
jjg@526 | 293 | # (Optional) reference results (e.g. work, report or summary.txt) |
jjg@526 | 294 | # |
jjg@526 | 295 | jck-compiler-tests: check-jck FRC |
jjg@526 | 296 | @rm -f -r $(JCK_COMPILER_OUTPUT_DIR)/work $(JCK_COMPILER_OUTPUT_DIR)/report \ |
jjg@526 | 297 | $(JCK_COMPILER_OUTPUT_DIR)/diff.html $(JCK_COMPILER_OUTPUT_DIR)/status.txt |
jjg@526 | 298 | @mkdir -p $(JCK_COMPILER_OUTPUT_DIR) |
jjg@526 | 299 | $(JT_JAVA)/bin/java -XX:MaxPermSize=256m -Xmx512m \ |
jjg@526 | 300 | -jar $(JCK_HOME)/JCK-compiler-7/lib/jtjck.jar \ |
jjg@526 | 301 | -v:non-pass \ |
jjg@526 | 302 | -r:$(JCK_COMPILER_OUTPUT_DIR)/report \ |
jjg@526 | 303 | -w:$(JCK_COMPILER_OUTPUT_DIR)/work \ |
jjg@526 | 304 | -jdk:$(TESTJAVA) \ |
jjg@526 | 305 | $(JCK_COMPILER_OPTIONS) \ |
jjg@526 | 306 | $(JCK_COMPILER_TESTDIRS) \ |
jjg@526 | 307 | || ( $(call EXIT_IF_FATAL,$(FATAL_JCK_EXIT)) ; \ |
jjg@526 | 308 | echo $$status > $(JCK_COMPILER_OUTPUT_DIR)/status.txt \ |
jjg@526 | 309 | ) |
jjg@526 | 310 | ifdef JCK_COMPILER_REFERENCE |
jjg@526 | 311 | JT_JAVA=$(JT_JAVA) $(JTDIFF) -o $(JCK_COMPILER_OUTPUT_DIR)/diff.html \ |
jjg@526 | 312 | $(JCK_COMPILER_REFERENCE) $(JCK_COMPILER_OUTPUT_DIR)/report \ |
jjg@526 | 313 | || ( $(call EXIT_IF_FATAL,$(FATAL_JTDIFF_EXIT)) ) |
jjg@526 | 314 | endif |
jjg@526 | 315 | |
jjg@526 | 316 | jck-compiler-summary: FRC |
jjg@526 | 317 | if [ -r $(JCK_COMPILER_OUTPUT_DIR)/status.txt ]; then \ |
jjg@526 | 318 | echo ; echo "Summary of JCK-compiler test failures" ; \ |
jjg@526 | 319 | cat $(JCK_COMPILER_OUTPUT_DIR)/report/text/summary.txt | \ |
jjg@526 | 320 | grep -v 'Not run' | grep -v 'Passed' ; \ |
jjg@526 | 321 | echo ; \ |
jjg@526 | 322 | $(EXIT) `cat $(JCK_COMPILER_OUTPUT_DIR)/status.txt` ; \ |
jjg@526 | 323 | fi |
jjg@526 | 324 | |
jjg@526 | 325 | # Run JCK-runtime tests in -Xcompile mode |
jjg@526 | 326 | # This is a special mode to test javac by compiling the tests in the JCK-runtime test suite |
jjg@526 | 327 | # Normal JCK-runtime invocation belongs in the jdk/ repository. |
jjg@526 | 328 | # |
jjg@526 | 329 | # JCK_HOME |
jjg@526 | 330 | # Installed location of JCK: should include JCK-compiler, JCK-runtime and JCK-extras |
jjg@526 | 331 | # JT_JAVA |
jjg@526 | 332 | # Version of java used to run JCK. Should normally be the same as TESTJAVA |
jjg@526 | 333 | # TESTJAVA |
jjg@526 | 334 | # Version of java to be tested. |
jjg@526 | 335 | # JCK_RUNTIME_OPTIONS |
jjg@526 | 336 | # Additional options for JCK-runtime |
jjg@526 | 337 | # JCK_RUNTIME_TESTDIRS |
jjg@526 | 338 | # Directories of tests to be run |
jjg@526 | 339 | # JCK_RUNTIME_OUTPUT_DIR |
jjg@526 | 340 | # Where to write the results |
jjg@526 | 341 | # JCK_RUNTIME_REFERENCE |
jjg@526 | 342 | # (Optional) reference results (e.g. work, report or summary.txt) |
jjg@526 | 343 | # |
jjg@526 | 344 | jck-runtime-tests: check-jck FRC |
jjg@526 | 345 | @rm -f -r $(JCK_RUNTIME_OUTPUT_DIR)/work $(JCK_RUNTIME_OUTPUT_DIR)/report \ |
jjg@526 | 346 | $(JCK_RUNTIME_OUTPUT_DIR)/diff.html $(JCK_RUNTIME_OUTPUT_DIR)/status.txt |
jjg@526 | 347 | @mkdir -p $(JCK_RUNTIME_OUTPUT_DIR) |
jjg@526 | 348 | $(JT_JAVA)/bin/java -XX:MaxPermSize=256m -Xmx512m \ |
jjg@526 | 349 | -jar $(JCK_HOME)/JCK-runtime-7/lib/jtjck.jar \ |
jjg@526 | 350 | -v:non-pass \ |
jjg@526 | 351 | -r:$(JCK_RUNTIME_OUTPUT_DIR)/report \ |
jjg@526 | 352 | -w:$(JCK_RUNTIME_OUTPUT_DIR)/work \ |
jjg@526 | 353 | -jdk:$(TESTJAVA) \ |
jjg@526 | 354 | -Xcompile \ |
jjg@526 | 355 | $(JCK_RUNTIME_OPTIONS) \ |
jjg@526 | 356 | $(JCK_RUNTIME_TESTDIRS) \ |
jjg@526 | 357 | || ( $(call EXIT_IF_FATAL,$(FATAL_JCK_EXIT)) ; \ |
jjg@526 | 358 | echo $$status > $(JCK_RUNTIME_OUTPUT_DIR)/status.txt \ |
jjg@526 | 359 | ) |
jjg@526 | 360 | ifdef JCK_RUNTIME_REFERENCE |
jjg@526 | 361 | JT_JAVA=$(JT_JAVA) $(JTDIFF) -o $(JCK_RUNTIME_OUTPUT_DIR)/diff.html \ |
jjg@526 | 362 | $(JCK_RUNTIME_REFERENCE) $(JCK_RUNTIME_OUTPUT_DIR)/report \ |
jjg@526 | 363 | || ( $(call EXIT_IF_FATAL,$(FATAL_JTDIFF_EXIT)) ) |
jjg@526 | 364 | endif |
jjg@526 | 365 | |
jjg@526 | 366 | jck-runtime-summary: FRC |
jjg@526 | 367 | if [ -r $(JCK_RUNTIME_OUTPUT_DIR)/status.txt ]; then \ |
jjg@526 | 368 | echo ; echo "Summary of JCK-runtime test failures" ; \ |
jjg@526 | 369 | cat $(JCK_RUNTIME_OUTPUT_DIR)/report/text/summary.txt | \ |
jjg@526 | 370 | grep -v 'Not run' | grep -v 'Passed' ; \ |
jjg@526 | 371 | echo ; \ |
jjg@526 | 372 | $(EXIT) `cat $(JCK_RUNTIME_OUTPUT_DIR)/status.txt` ; \ |
jjg@526 | 373 | fi |
jjg@526 | 374 | |
jjg@526 | 375 | # Check to make sure these directories exist |
jjg@526 | 376 | check-jck: $(JT_HOME) $(JCK_HOME) $(PRODUCT_HOME) |
jjg@526 | 377 | |
jjg@526 | 378 | all-summary: FRC |
jjg@526 | 379 | if [ -n "`find $(TEST_OUTPUT_DIR) -name status.txt`" ]; then |
jjg@526 | 380 | echo ; echo "Summary of test failures" ; \ |
jjg@526 | 381 | cat `find $(TEST_OUTPUT_DIR) -name summary.txt` | \ |
jjg@526 | 382 | grep -v 'Not run' | grep -v 'Passed' ; \ |
jjg@526 | 383 | echo ; \ |
jjg@526 | 384 | $(EXIT) 1 |
jjg@526 | 385 | fi |
duke@1 | 386 | |
duke@1 | 387 | # Bundle up the results |
duke@1 | 388 | $(JPRT_ARCHIVE_BUNDLE): FRC |
duke@1 | 389 | @rm -f $@ |
duke@1 | 390 | @mkdir -p $(@D) |
duke@1 | 391 | ( cd $(TEST_OUTPUT_DIR) && zip -q -r $@ . ) |
duke@1 | 392 | |
duke@1 | 393 | # Cleanup |
duke@1 | 394 | clean: |
duke@1 | 395 | rm -f $(JPRT_ARCHIVE_BUNDLE) |
duke@1 | 396 | |
duke@1 | 397 | # Used to force a target rules to run |
duke@1 | 398 | FRC: |
duke@1 | 399 | |
duke@1 | 400 | # Phony targets (e.g. these are not filenames) |
jjg@526 | 401 | .PHONY: all clean \ |
jjg@526 | 402 | jtreg javac javadoc javah javap jtreg-tests jtreg-summary check-jtreg \ |
jjg@526 | 403 | jck-compiler jck-compiler-tests jck-compiler-summary \ |
jjg@526 | 404 | jck-runtime jck-runtime-tests jck-runtime-summary check-jck |
duke@1 | 405 | |
jjg@526 | 406 | # No use of suffix rules |
jjg@526 | 407 | .SUFFIXES: |
jjg@526 | 408 |