#
# Makefile to run jtreg and other tests
#
# Product builds and langtools builds
#
# A full product build (or "control" build) creates a complete JDK image.
# To test a product build, set TESTJAVA to the path for the image.
#
# A langtools build just builds the langtools components of a JDK.
# To test a langtools build, set TESTJAVA to the path for a recent JDK
# build, and set TESTBOOTCLASSPATH to the compiled langtools classes --
# for example build/classes or dist/lib/classes.jar.
# JPRT
# JPRT may invoke this Makefile directly, as part of a langtools build,
else
else
else
# Root of this test area (important to use full paths in some places)
# Default bundle of all test results (passed or not) (JPRT only)
SLASH_JAVA = J:
else
# Default JTREG to run
else
# Default JCK to run
else
# Default JDK for JTREG and JCK
#
# standard to execute tests in sameVM mode, it should normally be set the
# same as TESTJAVA (although not necessarily so.)
#
else
# Default JDK to test
else
# PRODUCT_HOME is a JPRT variable pointing to a directory containing the output from
# For langtools, this is a directory containing build and dist
# For a control build, this is build/$(PRODUCT)-$(ARCH)/XYZ-image
# (i.e, j2sdk-image or jdk-module-image)
### In the following, -refvmoptions is an undocumented option
### The following does not work JCK 7 b30 2/6/2010. Awaiting b31.
JCK_OPTIONS += \
# Concurrency is the number of tests that can execute at once.
# Supported for JCK, not supported for jtreg.
# On an otherwise empty machine, suggest setting to (#cpus + 2)
# If unset, the default is (#cpus)
### RFE: determine and use #cpus
# JCK is executed using "Multi-JVM Group Mode", which is a hybrid
# of otherVM and sameVM modes. New JVMs are created and reused for
# a number of tests, then eventually discarded and a new one started.
# This amortizes the JVM startup time. The "group size" defines
# how many tests are run in a JVM before it is replaced.
# If unset, the default is 100.
JCK_COMPILER_OPTIONS += \
### The following is not supported. Awaiting RFE 6924287
### 6924287: Jck4Jdk: Allow to configure test group size for group mode via simple command line option
### JCK_RUNTIME_OPTIONS += \
### -jtoptions:-Ejck.env.runtime.testCompile.groupMode.groupSize=$(JCK_GROUP_SIZE)
# Timeouts -- by default, increase test timeouts when running on JPRT
# Assertions: some tests show failures when assertions are enabled.
# Since javac is typically loaded via the bootclassloader (either via TESTJAVA
# or TESTBOOTCLASSPATH), you may need -esa to enable assertions in javac.
JCK_OPTIONS += $(ASSERTION_OPTIONS:%=-vmoptions:%)
# Include shared options
# Exit codes:
# jtreg, jck: 0: OK, 1: tests failed, 2: tests error; 3+: SERIOUS
# jtdiff: 0: OK, 1: differences found; 2+: SERIOUS
#
# Exit -- used for final "normal" exit from "make". Redefine to "true" to avoid
# having make exit with non-zero return code.
EXIT = exit
# Function to exit shell if exit code of preceding command is greater than or equal
# to a given level. Redefine function or preceding FATAL_*_EXIT codes as needed.
# The test directories to run
DEFAULT_TESTDIRS = .
# Root of all test results
ABS_TEST_OUTPUT_DIR := \
pwd )
# Subdirectories for different test runs
# Default make rule -- warning, may take a while
all: $(JPRT_CLEAN) jtreg-tests jck-compiler-tests jck-runtime-tests $(JPRT_ARCHIVE_BUNDLE) all-summary
@echo "Testing completed successfully"
@echo "Testing completed successfully"
@echo "Testing completed successfully"
@echo "Testing completed successfully"
# for use with JPRT -testrule
# Run jtreg tests
#
# JTREG_HOME
# Installed location of jtreg
# JT_JAVA
# Version of java used to run jtreg. Should normally be the same as TESTJAVA
# TESTJAVA
# Version of java to be tested.
# JTREG_OPTIONS
# Additional options for jtreg
# JTREG_TESTDIRS
# Directories of tests to be run
# JTREG_OUTPUT_DIR
# Where to write the results
# JTREG_REFERENCE
# (Optional) reference results (e.g. work, report or summary.txt)
#
@mkdir -p $(JTREG_OUTPUT_DIR)
-J-Xmx512m \
-r:$(JTREG_OUTPUT_DIR)/JTreport \
-w:$(JTREG_OUTPUT_DIR)/JTwork \
$(JTREG_OPTIONS) \
$(JTREG_TESTDIRS) \
)
if [ -r $(JTREG_OUTPUT_DIR)/status.txt ]; then \
echo ; echo "Summary of jtreg test failures" ; \
echo ; \
fi
# Check to make sure these directories exist
# Run JCK-compiler tests
#
# JCK_HOME
# Installed location of JCK: should include JCK-compiler, and JCK-extras
# JT_JAVA
# Version of java used to run JCK. Should normally be the same as TESTJAVA
# TESTJAVA
# Version of java to be tested.
# JCK_COMPILER_OPTIONS
# Additional options for JCK-compiler
# JCK_COMPILER_TESTDIRS
# Directories of tests to be run
# JCK_COMPILER_OUTPUT_DIR
# Where to write the results
# JCK_COMPILER_REFERENCE
# (Optional) reference results (e.g. work, report or summary.txt)
#
@mkdir -p $(JCK_COMPILER_OUTPUT_DIR)
-r:$(JCK_COMPILER_OUTPUT_DIR)/report \
-w:$(JCK_COMPILER_OUTPUT_DIR)/work \
$(JCK_COMPILER_OPTIONS) \
)
if [ -r $(JCK_COMPILER_OUTPUT_DIR)/status.txt ]; then \
echo ; echo "Summary of JCK-compiler test failures" ; \
echo ; \
fi
# Run JCK-runtime tests in -Xcompile mode
# This is a special mode to test javac by compiling the tests in the JCK-runtime test suite
# Normal JCK-runtime invocation belongs in the jdk/ repository.
#
# JCK_HOME
# Installed location of JCK: should include JCK-compiler, JCK-runtime and JCK-extras
# JT_JAVA
# Version of java used to run JCK. Should normally be the same as TESTJAVA
# TESTJAVA
# Version of java to be tested.
# JCK_RUNTIME_OPTIONS
# Additional options for JCK-runtime
# JCK_RUNTIME_TESTDIRS
# Directories of tests to be run
# JCK_RUNTIME_OUTPUT_DIR
# Where to write the results
# JCK_RUNTIME_REFERENCE
# (Optional) reference results (e.g. work, report or summary.txt)
#
@mkdir -p $(JCK_RUNTIME_OUTPUT_DIR)
-r:$(JCK_RUNTIME_OUTPUT_DIR)/report \
-w:$(JCK_RUNTIME_OUTPUT_DIR)/work \
-Xcompile \
$(JCK_RUNTIME_OPTIONS) \
$(JCK_RUNTIME_TESTDIRS) \
)
if [ -r $(JCK_RUNTIME_OUTPUT_DIR)/status.txt ]; then \
echo ; echo "Summary of JCK-runtime test failures" ; \
echo ; \
fi
# Check to make sure these directories exist
echo ; echo "Summary of test failures" ; \
echo ; \
$(EXIT) 1
fi
# Bundle up the results
@rm -f $@
@mkdir -p $(@D)
# Cleanup
rm -f $(JPRT_ARCHIVE_BUNDLE)
# Used to force a target rules to run
FRC:
# Phony targets (e.g. these are not filenames)
# No use of suffix rules
.SUFFIXES: