80833bb9a1bf25dcf19e814438a4b311d2e1f4cffuankg# Makefile to run jtreg and other tests
1337c7673efc1f80f634139fbad7cbb98a0dc657ylavic# Product builds and langtools builds
1337c7673efc1f80f634139fbad7cbb98a0dc657ylavic# A full product build (or "control" build) creates a complete JDK image.
4da61833a1cbbca94094f9653fd970582b97a72etrawick# To test a product build, set TESTJAVA to the path for the image.
4da61833a1cbbca94094f9653fd970582b97a72etrawick# A langtools build just builds the langtools components of a JDK.
4da61833a1cbbca94094f9653fd970582b97a72etrawick# To test a langtools build, set TESTJAVA to the path for a recent JDK
4da61833a1cbbca94094f9653fd970582b97a72etrawick# build, and set TESTBOOTCLASSPATH to the compiled langtools classes --
4789804be088bcd86ae637a29cdb7fda25169521jailletc# for example build/classes or dist/lib/classes.jar.
4789804be088bcd86ae637a29cdb7fda25169521jailletc# JPRT may invoke this Makefile directly, as part of a langtools build,
e50c3026198fd496f183cda4c32a202925476778covener# or indirectly, via FOREST/test/Makefile, as part of a control build.
e50c3026198fd496f183cda4c32a202925476778covener# Get OS/ARCH specifics
44ff304057225e944e220e981d434a046d14cf06covener# Root of this test area (important to use full paths in some places)
44ff304057225e944e220e981d434a046d14cf06covener# Default bundle of all test results (passed or not) (JPRT only)
5d1ba75b8794925e67591c209085a49279791de9covener JPRT_ARCHIVE_BUNDLE = $(TEST_ROOT)/JPRT_ARCHIVE_BUNDLE.zip
45a10d38e6051fd7bdf9d742aaae633d97ff02abjailletc# Default JTREG to run
a34684a59b60a4173c25035d0c627ef17e6dc215rpluem JTREG_HOME = $(SLASH_JAVA)/re/jtreg/4.0/promoted/latest/binaries/jtreg
fa7ed98b9dc94c5845cf845aea0a44ecacd290c9humbedooh# Default JCK to run
0b67eb8568cd58bb77082703951679b42cf098actrawick JCK_HOME = $(SLASH_JAVA)/re/jck/7/promoted/latest/binaries
5ef3c61605a3a021ff71f488983cb0065f8e1a79covener# Default JDK for JTREG and JCK
09c87c777bed1655621bb20e1c46cb6b1a63279dcovener# JT_JAVA is the version of java used to run jtreg/JCK. Since it is now
6502b7b32f980cc2093bb3ebce37e5e4dc68fba4ylavic# standard to execute tests in sameVM mode, it should normally be set the
6502b7b32f980cc2093bb3ebce37e5e4dc68fba4ylavic# same as TESTJAVA (although not necessarily so.)
e6b4bd1113567627ab6bb6c6a7105e1e01a7d889jailletc JT_JAVA = $(SLASH_JAVA)/re/jdk/1.6.0/archive/fcs/binaries/$(PLATFORM)-$(ARCH)
e466c40e1801982602ee0200c9e8b61cc148742djailletc# Default JDK to test
04983e3bd1754764eec7d6bb772fe3b0bf391771jorton TESTJAVA = $(SLASH_JAVA)/re/jdk/1.7.0/promoted/latest/binaries/$(PLATFORM)-$(ARCH)
15660979a30d251681463de2e0584853890082accovener# PRODUCT_HOME is a JPRT variable pointing to a directory containing the output from
49dacedb6c387b786b7911082ff35121a45f414bcovener# For langtools, this is a directory containing build and dist
49dacedb6c387b786b7911082ff35121a45f414bcovener# For a control build, this is build/$(PRODUCT)-$(ARCH)/XYZ-image
cfd9415521847b2f9394fad04fb701cfb955f503rjung# (i.e, j2sdk-image or jdk-module-image)
cfd9415521847b2f9394fad04fb701cfb955f503rjung ifeq ($(shell [ -r $(PRODUCT_HOME)/dist/lib/classes.jar ]; echo $$?),0)
28c31fb73c1264bd1d0ff932573677030b024c7dwrowe TESTBOOTCLASSPATH = $(PRODUCT_HOME)/dist/lib/classes.jar
28c31fb73c1264bd1d0ff932573677030b024c7dwrowe ifeq ($(shell [ -r $(PRODUCT_HOME)/bin/javac$(EXE_SUFFIX) ]; echo $$?),0)
63b9f1f5880391261705f696d7d65507bbe9ace3covener JTREG_OPTIONS += -Xbootclasspath/p:$(TESTBOOTCLASSPATH)
49dacedb6c387b786b7911082ff35121a45f414bcovener### In the following, -refvmoptions is an undocumented option
49dacedb6c387b786b7911082ff35121a45f414bcovener### The following does not work JCK 7 b30 2/6/2010. Awaiting b31.
3c990331fc6702119e4f5b8ba9eae3021aea5265jim# Concurrency is the number of tests that can execute at once.
fc42512879dd0504532f52fe5d0d0383dda96a1eniq# Supported for JCK, not supported for jtreg.
fc42512879dd0504532f52fe5d0d0383dda96a1eniq# On an otherwise empty machine, suggest setting to (#cpus + 2)
fc42512879dd0504532f52fe5d0d0383dda96a1eniq# If unset, the default is (#cpus)
0451df5dc50fa5d8b3e07d92ee6a92e36a1181a5niq### RFE: determine and use #cpus
da0442c0440caef34706e2c2f3af05cb65921cc0jailletc# JCK is executed using "Multi-JVM Group Mode", which is a hybrid
da0442c0440caef34706e2c2f3af05cb65921cc0jailletc# of otherVM and sameVM modes. New JVMs are created and reused for
06b8f183140c8e02e0974e938a05078b511d1603covener# a number of tests, then eventually discarded and a new one started.
06b8f183140c8e02e0974e938a05078b511d1603covener# This amortizes the JVM startup time. The "group size" defines
06b8f183140c8e02e0974e938a05078b511d1603covener# how many tests are run in a JVM before it is replaced.
15890c9306ba98f6fc243e15a3c4778ddc7d773erpluem# If unset, the default is 100.
259878293a997ff49f5ddfc53d3739cbdc25444ecovener -jtoptions:-Ejck.env.compiler.testCompile.groupMode.groupSize=$(JCK_GROUP_SIZE) \
15890c9306ba98f6fc243e15a3c4778ddc7d773erpluem -jtoptions:-Ejck.env.compiler.compRefExecute.groupMode.groupSize=$(JCK_GROUP_SIZE)
b54b024c06a19926832d77d40ba35ad8c41e4d3dminfrin### The following is not supported. Awaiting RFE 6924287
b54b024c06a19926832d77d40ba35ad8c41e4d3dminfrin### 6924287: Jck4Jdk: Allow to configure test group size for group mode via simple command line option
b54b024c06a19926832d77d40ba35ad8c41e4d3dminfrin### JCK_RUNTIME_OPTIONS += \
65967d05f839dbf27cf91d91fa79585eeae19660minfrin### -jtoptions:-Ejck.env.runtime.testCompile.groupMode.groupSize=$(JCK_GROUP_SIZE)
65967d05f839dbf27cf91d91fa79585eeae19660minfrin# Timeouts -- by default, increase test timeouts when running on JPRT
75f5c2db254c0167a0e396254460de09b775d203trawick JTREG_OPTIONS += -timeoutFactor:$(JTREG_TIMEOUT_FACTOR)
4f0358189bfa57b8e75bd6b94db264302a8f336amrumph# Assertions: some tests show failures when assertions are enabled.
5716f9c6daa92dde5f2f9d11ed63f7c9549c223atrawick# Since javac is typically loaded via the bootclassloader (either via TESTJAVA
5716f9c6daa92dde5f2f9d11ed63f7c9549c223atrawick# or TESTBOOTCLASSPATH), you may need -esa to enable assertions in javac.
54d750a84a175d8e338880514d440773eb986b50covener# Include shared options
54d750a84a175d8e338880514d440773eb986b50covener# Exit codes:
54d750a84a175d8e338880514d440773eb986b50covener# jtreg, jck: 0: OK, 1: tests failed, 2: tests error; 3+: SERIOUS
54d750a84a175d8e338880514d440773eb986b50covener# jtdiff: 0: OK, 1: differences found; 2+: SERIOUS
4e30ef014533a7e93c92d88306291f5e49c9692ftrawick# Exit -- used for final "normal" exit from "make". Redefine to "true" to avoid
83b50288fa7d306324bba68832011ea08f5c7832covener# having make exit with non-zero return code.
5f066f496cd9f20a2a701255bc67d44e7cb46daetrawick# Function to exit shell if exit code of preceding command is greater than or equal
5f066f496cd9f20a2a701255bc67d44e7cb46daetrawick# to a given level. Redefine function or preceding FATAL_*_EXIT codes as needed.
2e15620d724fb8e3a5be183b917359a2fd6e9468covenerEXIT_IF_FATAL = status=$$?; if [ $$status -ge $(1) ]; then exit $$status ; fi
2e15620d724fb8e3a5be183b917359a2fd6e9468covener# The test directories to run
1b988c41ee505962781d110a3e4c2c90f1ea0aa4covener# Root of all test results
1b988c41ee505962781d110a3e4c2c90f1ea0aa4covenerTEST_OUTPUT_DIR = $(TEST_ROOT)/../build/$(PLATFORM)-$(ARCH)/test/langtools
b8efdc95bec9cf089aa1be0bfd07d46aa1137a7acovener $(shell mkdir -p $(TEST_ROOT)/../build/$(PLATFORM)-$(ARCH)/test/langtools; \
b8efdc95bec9cf089aa1be0bfd07d46aa1137a7acovener cd $(TEST_ROOT)/../build/$(PLATFORM)-$(ARCH)/test/langtools; \
f06e7c4b1bce6b6491e5de0b7998d3f5696b293dchrisd# Subdirectories for different test runs
179565be4043d7e5f9161aa75271fa0a001866d9covenerJCK_COMPILER_OUTPUT_DIR = $(ABS_TEST_OUTPUT_DIR)/jck-compiler
179565be4043d7e5f9161aa75271fa0a001866d9covenerJCK_RUNTIME_OUTPUT_DIR = $(ABS_TEST_OUTPUT_DIR)/jck-runtime-Xcompile
111436a32ba1254291e4883292fb116d15fe8f64covener# Default make rule -- warning, may take a while
fce4949fb0b309a5744afcd503c6ed2d35621ee2covenerall: $(JPRT_CLEAN) jtreg-tests jck-compiler-tests jck-runtime-tests $(JPRT_ARCHIVE_BUNDLE) all-summary
fce4949fb0b309a5744afcd503c6ed2d35621ee2covener @echo "Testing completed successfully"
fce4949fb0b309a5744afcd503c6ed2d35621ee2covenerjtreg apt javac javadoc javah javap: $(JPRT_CLEAN) jtreg-tests $(JPRT_ARCHIVE_BUNDLE) jtreg-summary
7b7430e701e9a31ce809da7c220bb8dfcf68c86etrawick @echo "Testing completed successfully"
7b7430e701e9a31ce809da7c220bb8dfcf68c86etrawickjck-compiler: $(JPRT_CLEAN) jck-compiler-tests $(JPRT_ARCHIVE_BUNDLE) jck-compiler-summary
ccc20788c1e5fc973f36df634399c89acb70deaejerenkrantz @echo "Testing completed successfully"
ccc20788c1e5fc973f36df634399c89acb70deaejerenkrantzjck-runtime: $(JPRT_CLEAN) jck-runtime-tests $(JPRT_ARCHIVE_BUNDLE) jck-runtime-summary
273e512f20f262e5e2aa8e0e83371d1929fb76adjkaluza @echo "Testing completed successfully"
273e512f20f262e5e2aa8e0e83371d1929fb76adjkaluza# for use with JPRT -testrule
993d1261a278d7322bccef219101220b7b4fb8c5jkaluzajavadoc: JTREG_TESTDIRS = tools/javadoc com/sun/javadoc
ba050a6f942b9fa0e81ed73437588005c569655ccovener# Run jtreg tests
ba050a6f942b9fa0e81ed73437588005c569655ccovener# JTREG_HOME
135ddda3a989215d2bedbcf1529bfb269c3eda23niq# Installed location of jtreg
135ddda3a989215d2bedbcf1529bfb269c3eda23niq# Version of java used to run jtreg. Should normally be the same as TESTJAVA
001a44c352f89c9ec332ffd3e0a6927dcd19432chumbedooh# Version of java to be tested.
001a44c352f89c9ec332ffd3e0a6927dcd19432chumbedooh# JTREG_OPTIONS
efe780dcf13b2b95effabf897d694d8f23feac74trawick# Additional options for jtreg
793214f67dede32edfd9ee96c664ead04d175cbbjfclere# JTREG_TESTDIRS
cc5a4a08dc9783fcbc52ce86f11e01c281a43810minfrin# Directories of tests to be run
9b0076ddd1103e5fa9c1f9bafde4b06ce244fbaecovener# JTREG_OUTPUT_DIR
9b0076ddd1103e5fa9c1f9bafde4b06ce244fbaecovener# Where to write the results
9b0076ddd1103e5fa9c1f9bafde4b06ce244fbaecovener# JTREG_REFERENCE
249d09d51808cb7981af99762c3b3736ca126cd5jkaluza# (Optional) reference results (e.g. work, report or summary.txt)
56589be3d7a3e9343370df240010c6928cc78b39jkaluza @rm -f -r $(JTREG_OUTPUT_DIR)/JTwork $(JTREG_OUTPUT_DIR)/JTreport \
56589be3d7a3e9343370df240010c6928cc78b39jkaluza $(JTREG_OUTPUT_DIR)/diff.html $(JTREG_OUTPUT_DIR)/status.txt
a4df2cd1e1391575a327c2a90ba4315f805a0a78covener JT_JAVA=$(JT_JAVA) $(JTDIFF) -o $(JTREG_OUTPUT_DIR)/diff.html \
1c2cab00d988fc48cbe59032cf76cc0bab20d6f7covener echo ; echo "Summary of jtreg test failures" ; \
6a80c3c6f4b8ea7ba5e89402b8b779b09ce020e0covener cat $(JTREG_OUTPUT_DIR)/JTreport/text/summary.txt | \
1f50dc34ae069adeed20b2986e5ffdefa5c410e0covener# Check to make sure these directories exist
63a5ea80bddcc84a462e40f402b4f330e0e05411covener# Run JCK-compiler tests
65a4e663b82f8bce28ac22ab2edfd7502de36998sf# Installed location of JCK: should include JCK-compiler, and JCK-extras
c7de1955eb0eaeabf7042902476397692672d549sf# Version of java used to run JCK. Should normally be the same as TESTJAVA
74e7f6c55fd67b10cb400b3f6d1dc718a303d944minfrin# Version of java to be tested.
74e7f6c55fd67b10cb400b3f6d1dc718a303d944minfrin# JCK_COMPILER_OPTIONS
74e7f6c55fd67b10cb400b3f6d1dc718a303d944minfrin# Additional options for JCK-compiler
a511a29faf2ff7ead3b67680154a624effb31aafminfrin# JCK_COMPILER_TESTDIRS
a511a29faf2ff7ead3b67680154a624effb31aafminfrin# Directories of tests to be run
a511a29faf2ff7ead3b67680154a624effb31aafminfrin# JCK_COMPILER_OUTPUT_DIR
a511a29faf2ff7ead3b67680154a624effb31aafminfrin# Where to write the results
a511a29faf2ff7ead3b67680154a624effb31aafminfrin# JCK_COMPILER_REFERENCE
63921358ef93fcb41bc71d9894221ba3d7fbb87bminfrin# (Optional) reference results (e.g. work, report or summary.txt)
deec48c67d4786bc77112ffbf3a4e70b931097edminfrin @rm -f -r $(JCK_COMPILER_OUTPUT_DIR)/work $(JCK_COMPILER_OUTPUT_DIR)/report \
6d601599d3d65df0410eae6e573e75b2dbfb1fb4minfrin $(JCK_COMPILER_OUTPUT_DIR)/diff.html $(JCK_COMPILER_OUTPUT_DIR)/status.txt
ef82e8fa164e0a1f8b813f7deb6b7ead96018c94niq JT_JAVA=$(JT_JAVA) $(JTDIFF) -o $(JCK_COMPILER_OUTPUT_DIR)/diff.html \
ef82e8fa164e0a1f8b813f7deb6b7ead96018c94niq $(JCK_COMPILER_REFERENCE) $(JCK_COMPILER_OUTPUT_DIR)/report \
eafcc0ebf263d0ba69855b6e10958c4c1a2361bdsf echo ; echo "Summary of JCK-compiler test failures" ; \
eafcc0ebf263d0ba69855b6e10958c4c1a2361bdsf cat $(JCK_COMPILER_OUTPUT_DIR)/report/text/summary.txt | \
4576c1a9ef54cd1e5555ee07d016a7f559f80338sf# Run JCK-runtime tests in -Xcompile mode
4576c1a9ef54cd1e5555ee07d016a7f559f80338sf# This is a special mode to test javac by compiling the tests in the JCK-runtime test suite
4576c1a9ef54cd1e5555ee07d016a7f559f80338sf# Normal JCK-runtime invocation belongs in the jdk/ repository.
9811aed12bbc71783d2e544ccb5fecd193843eadsf# Installed location of JCK: should include JCK-compiler, JCK-runtime and JCK-extras
88fac54d9d64f85bbdab5d7010816f4377f95bd7rjung# Version of java used to run JCK. Should normally be the same as TESTJAVA
bd3f5647b96d378d9c75c954e3f13582af32c643sf# Version of java to be tested.
bd3f5647b96d378d9c75c954e3f13582af32c643sf# JCK_RUNTIME_OPTIONS
bd3f5647b96d378d9c75c954e3f13582af32c643sf# Additional options for JCK-runtime
bd3f5647b96d378d9c75c954e3f13582af32c643sf# JCK_RUNTIME_TESTDIRS
2a7beea91d46beb41f043a84eaad060047ee04aafabien# Directories of tests to be run
2a7beea91d46beb41f043a84eaad060047ee04aafabien# JCK_RUNTIME_OUTPUT_DIR
2a7beea91d46beb41f043a84eaad060047ee04aafabien# Where to write the results
2a7beea91d46beb41f043a84eaad060047ee04aafabien# JCK_RUNTIME_REFERENCE
584a85dd4047e38d3ed3a29b6662fcc9d100ae4csf# (Optional) reference results (e.g. work, report or summary.txt)
f21e9e3d0bfb7a507ecc5bc963f2159d693503d1sf @rm -f -r $(JCK_RUNTIME_OUTPUT_DIR)/work $(JCK_RUNTIME_OUTPUT_DIR)/report \
f21e9e3d0bfb7a507ecc5bc963f2159d693503d1sf $(JCK_RUNTIME_OUTPUT_DIR)/diff.html $(JCK_RUNTIME_OUTPUT_DIR)/status.txt
536d2e7cd1fdec1255b8c3bdf41fdc714c506a54trawick echo $$status > $(JCK_RUNTIME_OUTPUT_DIR)/status.txt \
79c5787b92ac5f0e1cc82393816c77a006399316trawick JT_JAVA=$(JT_JAVA) $(JTDIFF) -o $(JCK_RUNTIME_OUTPUT_DIR)/diff.html \
79c5787b92ac5f0e1cc82393816c77a006399316trawick $(JCK_RUNTIME_REFERENCE) $(JCK_RUNTIME_OUTPUT_DIR)/report \
79c5787b92ac5f0e1cc82393816c77a006399316trawick if [ -r $(JCK_RUNTIME_OUTPUT_DIR)/status.txt ]; then \
79c5787b92ac5f0e1cc82393816c77a006399316trawick echo ; echo "Summary of JCK-runtime test failures" ; \
79c5787b92ac5f0e1cc82393816c77a006399316trawick cat $(JCK_RUNTIME_OUTPUT_DIR)/report/text/summary.txt | \
7b395e4e878c28a4784919cfd2e704ddd14a3390jorton $(EXIT) `cat $(JCK_RUNTIME_OUTPUT_DIR)/status.txt` ; \
536e48c08d674acac5d44929318f2ad928edc361jorton# Check to make sure these directories exist
3e4e54d4e3fc0123c63d57aa84ac7ad7a8c73ff8jorton if [ -n "`find $(TEST_OUTPUT_DIR) -name status.txt`" ]; then
3e4e54d4e3fc0123c63d57aa84ac7ad7a8c73ff8jorton echo ; echo "Summary of test failures" ; \
6bb524f1895f30265a1431afc460977d391cb36bsf# Bundle up the results
23f1535d6a60817d2846bac0aea230ea475d7dccminfrin# Used to force a target rules to run
ec7520b24cd80d34d82bbcaca153cbb23cc04bc0rjung# Phony targets (e.g. these are not filenames)
ec7520b24cd80d34d82bbcaca153cbb23cc04bc0rjung jtreg javac javadoc javah javap jtreg-tests jtreg-summary check-jtreg \
ec7520b24cd80d34d82bbcaca153cbb23cc04bc0rjung jck-compiler jck-compiler-tests jck-compiler-summary \
ec7520b24cd80d34d82bbcaca153cbb23cc04bc0rjung jck-runtime jck-runtime-tests jck-runtime-summary check-jck
ec7520b24cd80d34d82bbcaca153cbb23cc04bc0rjung# No use of suffix rules