8217638: Remove old way of running tests (test/Makefile)
Reviewed-by: erikj, jjg
This commit is contained in:
parent
494ed992df
commit
659006b218
124
test/Makefile
124
test/Makefile
@ -1,124 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
#
|
||||
# Makefile to run tests from multiple sibling directories
|
||||
#
|
||||
|
||||
$(info WARNING: This way of running tests ("cd test && make") is deprecated)
|
||||
$(info Please use "make test TEST=..." instead. See doc/testing.md for details)
|
||||
|
||||
# Macro to run a test target in a subdir
|
||||
define SUBDIR_TEST # subdirectory target
|
||||
if [ -d $1 ] ; then \
|
||||
if [ -r $1/Makefile ] ; then \
|
||||
$(MAKE) --no-print-directory -k -C $1 $2 ; \
|
||||
echo 'WARNING: This way of running tests ("cd test && make") is deprecated' ; \
|
||||
echo 'Please use "make test TEST=..." instead. See doc/testing.md for details' ; \
|
||||
else \
|
||||
echo "ERROR: File does not exist: $1/Makefile"; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
else \
|
||||
echo "WARNING: No testing done, directory does not exist: $1"; \
|
||||
fi
|
||||
endef
|
||||
|
||||
# Default test target (core)
|
||||
default: jdk_core langtools_jtreg jaxp_all
|
||||
|
||||
# All testing
|
||||
all: jdk_all langtools_all jaxp_all
|
||||
|
||||
ifeq ($(TEST_JOBS), 0)
|
||||
JDK_TEST_JOBS=$(JOBS)
|
||||
else
|
||||
JDK_TEST_JOBS=$(TEST_JOBS)
|
||||
endif
|
||||
# Test targets
|
||||
langtools_% :
|
||||
@$(NO_STOPPING)$(call SUBDIR_TEST, langtools, \
|
||||
$(if $(JDK_TEST_JOBS), CONCURRENCY=$(JDK_TEST_JOBS)) \
|
||||
JT_JAVA=$(PRODUCT_HOME) JTREG_HOME=$(JT_HOME) \
|
||||
TEST="$(subst langtools_,,$@)" $(subst langtools_,,$@))
|
||||
|
||||
jdk_% core_%s svc_%:
|
||||
@$(NO_STOPPING)$(call SUBDIR_TEST, jdk, \
|
||||
$(if $(JDK_TEST_JOBS), CONCURRENCY=$(JDK_TEST_JOBS)) TEST="$@" $@)
|
||||
|
||||
jaxp_%:
|
||||
@$(NO_STOPPING)$(call SUBDIR_TEST, jaxp, \
|
||||
$(if $(JDK_TEST_JOBS), CONCURRENCY=$(JDK_TEST_JOBS)) TEST="$@" $@)
|
||||
|
||||
nashorn_%:
|
||||
@$(NO_STOPPING)$(call SUBDIR_TEST, nashorn, \
|
||||
$(if $(JDK_TEST_JOBS), CONCURRENCY=$(JDK_TEST_JOBS)) TEST="$@" $@)
|
||||
|
||||
SUB_MAKE_ARGS :=
|
||||
ifneq ($(TEST_JOBS), 0)
|
||||
ifneq ($(TEST_JOBS), )
|
||||
SUB_MAKE_ARGS += CONCURRENCY=$(TEST_JOBS)
|
||||
endif
|
||||
endif
|
||||
hotspot_%:
|
||||
@$(NO_STOPPING)$(call SUBDIR_TEST, hotspot/jtreg, $(SUB_MAKE_ARGS) TEST="$@" $@)
|
||||
|
||||
#
|
||||
# jtreg_tests
|
||||
#
|
||||
# Invocation:
|
||||
#
|
||||
# make jtreg_tests TESTDIRS=<test-dirs> TEST_SELECTION=<path to test or jtreg group> TEST_OUTPUT_DIR=<path>
|
||||
#
|
||||
# where <test-dirs> is something like '../<component>/test/runtime',
|
||||
# <component> in turn being one of the top level directories (for
|
||||
# example 'hotspot').
|
||||
#
|
||||
# The below will strip the path prefix and delegate to the
|
||||
# corresponding ../<component>/test/Makefile.
|
||||
|
||||
ifneq ($(TESTDIRS),)
|
||||
# Extract the component from ../test/<component>/...
|
||||
TESTDIRS_NORM := $(patsubst test/%, %, $(patsubst ../%, %, $(TESTDIRS)))
|
||||
COMPONENT := $(word 1,$(subst /, ,$(TESTDIRS_NORM)))
|
||||
|
||||
# Strip off the ../<component>/test prefix and pass the rest as TESTDIRS
|
||||
# to the delegate Makefile
|
||||
# The hotspot tests are in a subdir "java". Accept paths both including
|
||||
# and excluding this extra subdir
|
||||
TESTDIRS_TESTS := $(patsubst $(COMPONENT)/%,%,$(patsubst hotspot/jtreg/%,%, \
|
||||
$(patsubst ../%, %, $(TESTDIRS_NORM))))
|
||||
endif
|
||||
|
||||
jtreg_tests:
|
||||
$(MAKE) --no-print-directory TESTDIRS=$(TESTDIRS_TESTS) \
|
||||
$(COMPONENT)_jtreg_tests
|
||||
|
||||
################################################################
|
||||
|
||||
# Phony targets (e.g. these are not filenames)
|
||||
.PHONY: all clean
|
||||
|
||||
################################################################
|
@ -1,472 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 1995, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
#
|
||||
# Common logic to run various tests for a component, to be included by the
|
||||
# component specific test makefiles.
|
||||
#
|
||||
|
||||
# Default values for some properties that can be overridden by components.
|
||||
USE_JTREG_VERSION ?= 4.2
|
||||
JTREG_VM_TYPE ?= -agentvm
|
||||
USE_JTREG_ASSERT ?= true
|
||||
LIMIT_JTREG_VM_MEMORY ?= true
|
||||
|
||||
X:=
|
||||
SPACE:=$(X) $(X)
|
||||
|
||||
.DEFAULT : all
|
||||
|
||||
# Empty these to get rid of some default rules
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .java
|
||||
CO=
|
||||
GET=
|
||||
|
||||
# Utilities used
|
||||
AWK = awk
|
||||
CAT = cat
|
||||
CD = cd
|
||||
CHMOD = chmod
|
||||
CP = cp
|
||||
CUT = cut
|
||||
DIRNAME = dirname
|
||||
ECHO = echo
|
||||
EGREP = egrep
|
||||
EXPAND = expand
|
||||
FIND = find
|
||||
MKDIR = mkdir
|
||||
PWD = pwd
|
||||
RM = rm -f
|
||||
SED = sed
|
||||
SORT = sort
|
||||
TEE = tee
|
||||
UNAME = uname
|
||||
UNIQ = uniq
|
||||
WC = wc
|
||||
ZIPEXE = zip
|
||||
|
||||
# Get OS name from uname (Cygwin inexplicably adds _NT-5.1)
|
||||
UNAME_S := $(shell $(UNAME) -s | $(CUT) -f1 -d_)
|
||||
|
||||
# Commands to run on paths to make mixed paths for java on windows
|
||||
ifeq ($(findstring CYGWIN,$(UNAME_S)), CYGWIN)
|
||||
# Location of developer shared files
|
||||
SLASH_JAVA = J:
|
||||
GETMIXEDPATH = cygpath -m
|
||||
PLATFORM = windows
|
||||
else
|
||||
# Location of developer shared files
|
||||
SLASH_JAVA = /java
|
||||
GETMIXEDPATH = $(ECHO)
|
||||
PLATFORM = unix # we only care about windows or bsd.
|
||||
ifeq ($(UNAME_S), Darwin)
|
||||
PLATFORM = bsd
|
||||
endif
|
||||
ifeq ($(findstring BSD,$(UNAME_S)), BSD)
|
||||
PLATFORM = bsd
|
||||
endif
|
||||
endif
|
||||
|
||||
# convert list of directories to dos paths
|
||||
define MixedDirs
|
||||
$(foreach i,$1,$(shell $(GETMIXEDPATH) "${i}"))
|
||||
endef
|
||||
|
||||
ifdef ALT_SLASH_JAVA
|
||||
SLASH_JAVA = $(ALT_SLASH_JAVA)
|
||||
endif
|
||||
|
||||
# Root of this test area (important to use full paths in some places)
|
||||
TEST_ROOT := $(shell $(PWD))
|
||||
|
||||
# Root of all test results
|
||||
ifdef TEST_OUTPUT_DIR
|
||||
$(shell $(MKDIR) -p $(TEST_OUTPUT_DIR)/jtreg)
|
||||
ABS_TEST_OUTPUT_DIR := \
|
||||
$(shell $(CD) $(TEST_OUTPUT_DIR)/jtreg && $(PWD))
|
||||
else
|
||||
ifdef ALT_OUTPUTDIR
|
||||
ABS_OUTPUTDIR = $(shell $(CD) $(ALT_OUTPUTDIR) && $(PWD))
|
||||
else
|
||||
ABS_OUTPUTDIR = $(shell $(CD) $(TEST_ROOT)/.. && $(PWD))
|
||||
endif
|
||||
|
||||
ABS_PLATFORM_BUILD_ROOT = $(ABS_OUTPUTDIR)
|
||||
ABS_TEST_OUTPUT_DIR := $(ABS_PLATFORM_BUILD_ROOT)/testoutput/$(UNIQUE_DIR)
|
||||
endif
|
||||
|
||||
# If unset, set up the PRODUCT_HOME variable to the jdk to test
|
||||
ifndef PRODUCT_HOME
|
||||
# Try to use images/jdk if it exists
|
||||
ABS_JDK_IMAGE = $(ABS_PLATFORM_BUILD_ROOT)/images/jdk
|
||||
PRODUCT_HOME := \
|
||||
$(shell \
|
||||
if [ -d $(ABS_JDK_IMAGE) ] ; then \
|
||||
$(ECHO) "$(ABS_JDK_IMAGE)"; \
|
||||
else \
|
||||
$(ECHO) "$(ABS_PLATFORM_BUILD_ROOT)"; \
|
||||
fi)
|
||||
PRODUCT_HOME := $(PRODUCT_HOME)
|
||||
endif
|
||||
|
||||
# On Windows, setup the _NT_SYMBOL_PATH if possible.
|
||||
ifeq ($(PLATFORM), windows)
|
||||
ifndef _NT_SYMBOL_PATH
|
||||
ifdef PRODUCT_SYMBOLS_HOME
|
||||
_NT_SYMBOL_PATH := \
|
||||
$(subst $(SPACE),;,$(strip $(call MixedDirs, $(sort $(dir $(wildcard \
|
||||
$(addprefix $(PRODUCT_SYMBOLS_HOME)/bin/, *.pdb */*.pdb)))))))
|
||||
export _NT_SYMBOL_PATH
|
||||
endif
|
||||
endif
|
||||
JTREG_BASIC_OPTIONS += -e:_NT_SYMBOL_PATH='$(_NT_SYMBOL_PATH)'
|
||||
endif
|
||||
|
||||
ifneq ($(NATIVE_TEST_PATH), )
|
||||
# jtreg -nativepath <dir>
|
||||
#
|
||||
# Local make tests will be TEST_IMAGE_DIR
|
||||
ifdef TEST_IMAGE_DIR
|
||||
TESTNATIVE_DIR = $(TEST_IMAGE_DIR)
|
||||
endif
|
||||
ifdef TESTNATIVE_DIR
|
||||
JTREG_NATIVE_PATH = -nativepath:$(shell $(GETMIXEDPATH) "$(TESTNATIVE_DIR)/$(NATIVE_TEST_PATH)")
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(USE_FAILURE_HANDLER), true)
|
||||
# jtreg failure handler config
|
||||
ifeq ($(FAILURE_HANDLER_DIR), )
|
||||
ifneq ($(TESTNATIVE_DIR), )
|
||||
FAILURE_HANDLER_DIR := $(TESTNATIVE_DIR)/failure_handler
|
||||
endif
|
||||
endif
|
||||
ifneq ($(FAILURE_HANDLER_DIR), )
|
||||
FAILURE_HANDLER_DIR_MIXED := $(shell $(GETMIXEDPATH) "$(FAILURE_HANDLER_DIR)")
|
||||
JTREG_FAILURE_HANDLER_OPTIONS := \
|
||||
-timeoutHandlerDir:$(FAILURE_HANDLER_DIR_MIXED)/jtregFailureHandler.jar \
|
||||
-observerDir:$(FAILURE_HANDLER_DIR_MIXED)/jtregFailureHandler.jar \
|
||||
-timeoutHandler:jdk.test.failurehandler.jtreg.GatherProcessInfoTimeoutHandler \
|
||||
-observer:jdk.test.failurehandler.jtreg.GatherDiagnosticInfoObserver \
|
||||
-timeoutHandlerTimeout:0
|
||||
ifeq ($(PLATFORM), windows)
|
||||
JTREG_FAILURE_HANDLER_OPTIONS += -J-Djava.library.path="$(FAILURE_HANDLER_DIR_MIXED)"
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
# How to create the test bundle (pass or fail, we want to create this)
|
||||
# Follow command with ";$(BUNDLE_UP_AND_EXIT)", so it always gets executed.
|
||||
ifneq ($(ARCHIVE_BUNDLE), )
|
||||
ZIP_UP_RESULTS = ( $(MKDIR) -p `$(DIRNAME) $(ARCHIVE_BUNDLE)` \
|
||||
&& $(CD) $(ABS_TEST_OUTPUT_DIR) \
|
||||
&& $(CHMOD) -R a+r . \
|
||||
&& $(ZIPEXE) -q -r $(ARCHIVE_BUNDLE) . ) ;
|
||||
CLEAN_ARCHIVE_BUNDLE = @$(RM) $(ARCHIVE_BUNDLE)
|
||||
endif
|
||||
|
||||
# AddressSanitizer
|
||||
ifeq ($(ASAN_ENABLED), yes)
|
||||
export ASAN_OPTIONS="handle_segv=0 detect_leaks=0"
|
||||
JTREG_BASIC_OPTIONS += -e:ASAN_OPTIONS=$(ASAN_OPTIONS)
|
||||
ifneq ($(DEVKIT_LIB_DIR),)
|
||||
export LD_LIBRARY_PATH:=$(LD_LIBRARY_PATH):$(DEVKIT_LIB_DIR)
|
||||
JTREG_BASIC_OPTIONS += -e:LD_LIBRARY_PATH=$(LD_LIBRARY_PATH)
|
||||
endif
|
||||
endif
|
||||
|
||||
# important results files
|
||||
SUMMARY_TXT = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/JTreport/text/summary.txt")
|
||||
STATS_TXT_NAME = Stats.txt
|
||||
STATS_TXT = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/$(STATS_TXT_NAME)")
|
||||
RUNLIST = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/runlist.txt")
|
||||
PASSLIST = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/passlist.txt")
|
||||
FAILLIST = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/faillist.txt")
|
||||
EXITCODE = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/exitcode.txt")
|
||||
|
||||
TESTEXIT = \
|
||||
if [ ! -s $(EXITCODE) ] ; then \
|
||||
$(ECHO) "ERROR: EXITCODE file not filled in."; \
|
||||
$(ECHO) "1" > $(EXITCODE); \
|
||||
fi ; \
|
||||
testExitCode=`$(CAT) $(EXITCODE)`; \
|
||||
$(ECHO) "EXIT CODE: $${testExitCode}"; \
|
||||
exit $${testExitCode}
|
||||
|
||||
ifeq ($(TREAT_EXIT_CODE_1_AS_0), true)
|
||||
ADJUST_EXIT_CODE := \
|
||||
if [ $${jtregExitCode} = 1 ] ; then \
|
||||
jtregExitCode=0; \
|
||||
fi
|
||||
else
|
||||
# colon is the shell no-op
|
||||
ADJUST_EXIT_CODE := :
|
||||
endif
|
||||
|
||||
BUNDLE_UP_AND_EXIT = \
|
||||
( \
|
||||
jtregExitCode=$$? && \
|
||||
_summary="$(SUMMARY_TXT)"; \
|
||||
$(ADJUST_EXIT_CODE) ; \
|
||||
$(RM) -f $(STATS_TXT) $(RUNLIST) $(PASSLIST) $(FAILLIST) $(EXITCODE); \
|
||||
$(ECHO) "$${jtregExitCode}" > $(EXITCODE); \
|
||||
if [ -r "$${_summary}" ] ; then \
|
||||
$(ECHO) "Summary: $(UNIQUE_DIR)" > $(STATS_TXT); \
|
||||
$(EXPAND) $${_summary} | $(EGREP) -v ' Not run\.' > $(RUNLIST); \
|
||||
$(EGREP) ' Passed\.' $(RUNLIST) \
|
||||
| $(EGREP) -v ' Error\.' \
|
||||
| $(EGREP) -v ' Failed\.' > $(PASSLIST); \
|
||||
( $(EGREP) ' Failed\.' $(RUNLIST); \
|
||||
$(EGREP) ' Error\.' $(RUNLIST); \
|
||||
$(EGREP) -v ' Passed\.' $(RUNLIST) ) \
|
||||
| $(SORT) | $(UNIQ) > $(FAILLIST); \
|
||||
if [ $${jtregExitCode} != 0 -o -s $(FAILLIST) ] ; then \
|
||||
$(EXPAND) $(FAILLIST) \
|
||||
| $(CUT) -d' ' -f1 \
|
||||
| $(SED) -e 's@^@FAILED: @' >> $(STATS_TXT); \
|
||||
if [ $${jtregExitCode} = 0 ] ; then \
|
||||
jtregExitCode=1; \
|
||||
fi; \
|
||||
fi; \
|
||||
runc="`$(CAT) $(RUNLIST) | $(WC) -l | $(AWK) '{print $$1;}'`"; \
|
||||
passc="`$(CAT) $(PASSLIST) | $(WC) -l | $(AWK) '{print $$1;}'`"; \
|
||||
failc="`$(CAT) $(FAILLIST) | $(WC) -l | $(AWK) '{print $$1;}'`"; \
|
||||
exclc="FIXME CODETOOLS-7900176"; \
|
||||
$(ECHO) "TEST STATS: name=$(UNIQUE_DIR) run=$${runc} pass=$${passc} fail=$${failc}" \
|
||||
>> $(STATS_TXT); \
|
||||
else \
|
||||
$(ECHO) "Missing file: $${_summary}" >> $(STATS_TXT); \
|
||||
fi; \
|
||||
if [ -f $(STATS_TXT) ] ; then \
|
||||
$(CAT) $(STATS_TXT); \
|
||||
fi; \
|
||||
$(ZIP_UP_RESULTS) \
|
||||
$(TESTEXIT) \
|
||||
)
|
||||
|
||||
################################################################
|
||||
|
||||
# Prep for output
|
||||
# Change execute permissions on shared library files.
|
||||
# Files in repositories should never have execute permissions, but
|
||||
# there are some tests that have pre-built shared libraries, and these
|
||||
# windows dll files must have execute permission. Adding execute
|
||||
# permission may happen automatically on windows when using certain
|
||||
# versions of mercurial but it cannot be guaranteed. And blindly
|
||||
# adding execute permission might be seen as a mercurial 'change', so
|
||||
# we avoid adding execute permission to repository files. But testing
|
||||
# from a plain source tree needs the chmod a+rx. Applying the chmod to
|
||||
# all shared libraries not just dll files. And with CYGWIN and sshd
|
||||
# service, you may need CYGWIN=ntsec for this to work.
|
||||
prep:
|
||||
@$(MKDIR) -p $(ABS_TEST_OUTPUT_DIR)
|
||||
@if [ ! -d $(TEST_ROOT)/../../.hg ] && [ ! -d $(TEST_ROOT)/../../../.hg ]; then \
|
||||
$(FIND) $(TEST_ROOT) \( -name \*.dll -o -name \*.DLL -o -name \*.so \) \
|
||||
-exec $(CHMOD) a+rx {} \; ; \
|
||||
fi
|
||||
|
||||
ifeq ($(CLEAN_BEFORE_PREP), true)
|
||||
prep: clean
|
||||
|
||||
endif
|
||||
|
||||
# Cleanup
|
||||
clean:
|
||||
@$(RM) -r $(ABS_TEST_OUTPUT_DIR)
|
||||
$(CLEAN_ARCHIVE_BUNDLE)
|
||||
|
||||
################################################################
|
||||
|
||||
# jtreg tests
|
||||
|
||||
# Expect JT_HOME to be set for jtreg tests. (home for jtreg)
|
||||
ifndef JT_HOME
|
||||
JT_HOME = $(SLASH_JAVA)/re/jtreg/$(USE_JTREG_VERSION)/promoted/latest/binaries/jtreg
|
||||
endif
|
||||
|
||||
# Problematic tests to be excluded
|
||||
EXTRA_PROBLEM_LISTS :=
|
||||
PROBLEM_LISTS := ProblemList.txt $(EXTRA_PROBLEM_LISTS)
|
||||
|
||||
# Create exclude list for this platform and arch
|
||||
ifdef NO_EXCLUDES
|
||||
JTREG_EXCLUSIONS =
|
||||
else
|
||||
JTREG_EXCLUSIONS = $(addprefix -exclude:, $(wildcard $(PROBLEM_LISTS)))
|
||||
endif
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
|
||||
# The TESTDIRS variable can be used to select the jtreg tests to run
|
||||
ifdef TESTDIRS
|
||||
TEST_SELECTION = $(TESTDIRS)
|
||||
endif
|
||||
|
||||
ifeq ($(UNAME_S), SunOS)
|
||||
NUM_CORES := $(shell LC_MESSAGES=C /usr/sbin/psrinfo -v | grep -c on-line)
|
||||
endif
|
||||
ifeq ($(UNAME_S), Linux)
|
||||
NUM_CORES := $(shell cat /proc/cpuinfo | grep -c processor)
|
||||
endif
|
||||
ifeq ($(UNAME_S), Darwin)
|
||||
NUM_CORES := $(shell /usr/sbin/sysctl -n hw.ncpu)
|
||||
endif
|
||||
ifeq ($(findstring CYGWIN,$(UNAME_S)), CYGWIN)
|
||||
ifneq ($(NUMBER_OF_PROCESSORS), )
|
||||
NUM_CORES := $(NUMBER_OF_PROCESSORS)
|
||||
else
|
||||
ifneq ($(HOTSPOT_BUILD_JOBS), )
|
||||
NUM_CORES := $(HOTSPOT_BUILD_JOBS)
|
||||
else
|
||||
NUM_CORES := 1 # fallback
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
ifndef CONCURRENCY_FACTOR
|
||||
CONCURRENCY_FACTOR = 1
|
||||
endif
|
||||
|
||||
# Concurrency based on min(cores / 2, 12) * CONCURRENCY_FACTOR
|
||||
CONCURRENCY := $(shell $(AWK) \
|
||||
'BEGIN { \
|
||||
c = $(NUM_CORES) / 2; \
|
||||
if (c > 12) c = 12; \
|
||||
c = c * $(CONCURRENCY_FACTOR); \
|
||||
if (c < 1) c = 1; \
|
||||
printf "%.0f", c; \
|
||||
}')
|
||||
JTREG_BASIC_OPTIONS += -concurrency:$(CONCURRENCY)
|
||||
|
||||
# Make sure MaxRAMPercentage is low enough to not cause OOM or swapping since
|
||||
# we may end up with a lot of JVM's
|
||||
MAX_RAM_PERCENTAGE := $(shell expr 25 / $(CONCURRENCY))
|
||||
JTREG_BASIC_OPTIONS += -vmoption:-XX:MaxRAMPercentage=$(MAX_RAM_PERCENTAGE)
|
||||
|
||||
ifdef EXTRA_JTREG_OPTIONS
|
||||
JTREG_BASIC_OPTIONS += $(EXTRA_JTREG_OPTIONS)
|
||||
endif
|
||||
|
||||
# Default JTREG to run
|
||||
JTREG = $(JT_HOME)/bin/jtreg
|
||||
# run in agentvm/othervm mode
|
||||
JTREG_BASIC_OPTIONS += $(JTREG_VM_TYPE)
|
||||
# Only run automatic tests
|
||||
JTREG_BASIC_OPTIONS += -a
|
||||
# Always turn on assertions
|
||||
ifeq ($(USE_JTREG_ASSERT), true)
|
||||
JTREG_ASSERT_OPTION = -ea -esa
|
||||
endif
|
||||
JTREG_BASIC_OPTIONS += $(JTREG_ASSERT_OPTION)
|
||||
# jtreg verbosity setting
|
||||
# Default is to report details on all failed or error tests, times too
|
||||
JTREG_VERBOSE ?= fail,error,time
|
||||
JTREG_BASIC_OPTIONS += $(if $(JTREG_VERBOSE),-v:$(JTREG_VERBOSE))
|
||||
# Retain all files for failing tests
|
||||
JTREG_BASIC_OPTIONS += -retain:fail,error
|
||||
# Ignore tests are not run and completely silent about it
|
||||
JTREG_IGNORE_OPTION = -ignore:quiet
|
||||
JTREG_BASIC_OPTIONS += $(JTREG_IGNORE_OPTION)
|
||||
# Multiply by 4 the timeout factor
|
||||
JTREG_TIMEOUT_OPTION = -timeoutFactor:4
|
||||
JTREG_BASIC_OPTIONS += $(JTREG_TIMEOUT_OPTION)
|
||||
ifeq ($(LIMIT_JTREG_VM_MEMORY), true)
|
||||
# Set the max memory for jtreg control vm
|
||||
JTREG_MEMORY_OPTION = -J-Xmx512m
|
||||
JTREG_BASIC_OPTIONS += $(JTREG_MEMORY_OPTION)
|
||||
# Set the max memory for jtreg target test vms
|
||||
JTREG_TESTVM_MEMORY_OPTION = -vmoption:-Xmx512m
|
||||
JTREG_TEST_OPTIONS += $(JTREG_TESTVM_MEMORY_OPTION)
|
||||
endif
|
||||
# Make it possible to specify the JIB_DATA_DIR for tests using the
|
||||
# JIB Artifact resolver
|
||||
JTREG_BASIC_OPTIONS += -e:JIB_DATA_DIR
|
||||
# Give tests access to JT_JAVA, see JDK-8141609
|
||||
JTREG_BASIC_OPTIONS += -e:JDK8_HOME=${JT_JAVA}
|
||||
# Give aot tests access to Visual Studio installation
|
||||
ifneq ($(VS120COMNTOOLS), )
|
||||
JTREG_BASIC_OPTIONS += -e:VS120COMNTOOLS="$(shell $(GETMIXEDPATH) "$(patsubst %\,%,$(VS120COMNTOOLS))")"
|
||||
endif
|
||||
|
||||
JTREG_BASIC_OPTIONS += -e:TEST_IMAGE_GRAAL_DIR=${TEST_IMAGE_DIR}/hotspot/jtreg/graal
|
||||
|
||||
# Set other vm and test options
|
||||
JTREG_TEST_OPTIONS += $(JAVA_ARGS:%=-javaoptions:%) $(JAVA_VM_ARGS:%=-vmoption:%)
|
||||
ifneq ($(JIB_HOME), )
|
||||
JTREG_BASIC_OPTIONS += -e:JIB_HOME=$(shell $(GETMIXEDPATH) "$(JIB_HOME)")
|
||||
endif
|
||||
ifeq ($(IGNORE_MARKED_TESTS), true)
|
||||
# Option to tell jtreg to not run tests marked with "ignore"
|
||||
ifeq ($(PLATFORM), windows)
|
||||
JTREG_KEY_OPTION = -k:!ignore
|
||||
else
|
||||
JTREG_KEY_OPTION = -k:\!ignore
|
||||
endif
|
||||
JTREG_BASIC_OPTIONS += $(JTREG_KEY_OPTION)
|
||||
endif
|
||||
|
||||
# Make sure jtreg exists
|
||||
ifeq ($(USE_WINDOWS_EXISTENCE_CHECK), true)
|
||||
jtreg_exists:
|
||||
test -d $(shell $(GETMIXEDPATH) "$(JT_HOME)")
|
||||
test -f $(shell $(GETMIXEDPATH) "$(JTREG)")
|
||||
|
||||
else
|
||||
jtreg_exists: $(JT_HOME)
|
||||
endif
|
||||
PHONY_LIST += jtreg_exists
|
||||
|
||||
# Run jtreg
|
||||
jtreg_tests: prep jtreg_exists $(PRODUCT_HOME) $(TEST_PREREQS)
|
||||
( \
|
||||
( JT_HOME=$(shell $(GETMIXEDPATH) "$(JT_HOME)"); \
|
||||
export JT_HOME; \
|
||||
$(shell $(GETMIXEDPATH) "$(JTREG)") \
|
||||
$(JTREG_BASIC_OPTIONS) \
|
||||
-r:$(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/JTreport") \
|
||||
-w:$(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/JTwork") \
|
||||
-jdk:$(shell $(GETMIXEDPATH) "$(PRODUCT_HOME)") \
|
||||
$(JTREG_NATIVE_PATH) \
|
||||
$(JTREG_FAILURE_HANDLER_OPTIONS) \
|
||||
$(JTREG_EXCLUSIONS) \
|
||||
$(JTREG_TEST_OPTIONS) \
|
||||
$(TEST_SELECTION) \
|
||||
) ; \
|
||||
$(BUNDLE_UP_AND_EXIT) \
|
||||
) 2>&1 | $(TEE) $(ABS_TEST_OUTPUT_DIR)/output.txt ; $(TESTEXIT)
|
||||
|
||||
PHONY_LIST += jtreg_tests
|
||||
|
||||
# Make it possible to call this with <component>_jtreg_tests
|
||||
%_jtreg_tests: jtreg_tests
|
||||
# Must have a fake recipe here to prevent make from matching any other rule
|
||||
|
||||
################################################################
|
||||
|
||||
# Phony targets (e.g. these are not filenames)
|
||||
.PHONY: all clean prep $(PHONY_LIST)
|
||||
|
||||
################################################################
|
@ -1,84 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 1995, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
#
|
||||
|
||||
NATIVE_TEST_PATH := hotspot/jtreg/native
|
||||
|
||||
CLEAN_BEFORE_PREP := true
|
||||
|
||||
USE_JTREG_VERSION := 4.1
|
||||
|
||||
USE_JTREG_ASSERT := false
|
||||
|
||||
LIMIT_JTREG_VM_MEMORY := false
|
||||
|
||||
IGNORE_MARKED_TESTS := true
|
||||
|
||||
# Include the common base file with most of the logic
|
||||
include ../../TestCommon.gmk
|
||||
|
||||
################################################################
|
||||
# Default make rule (runs jtreg_tests)
|
||||
all: hotspot_all
|
||||
@$(ECHO) "Testing completed successfully"
|
||||
|
||||
# Support "hotspot_" prefixed test make targets (too)
|
||||
# The hotspot_% targets are used by the top level Makefile
|
||||
# Unless explicitly defined below, hotspot_<x> is interpreted as a jtreg test group name
|
||||
hotspot_%:
|
||||
$(ECHO) "Running tests: $@"
|
||||
$(MAKE) -j 1 TEST_SELECTION=":$@" UNIQUE_DIR=$@ jtreg_tests;
|
||||
|
||||
################################################################
|
||||
|
||||
# Set up the directory in which the jvm directories live (client/, server/, etc.)
|
||||
ifeq ($(PLATFORM),windows)
|
||||
JVMS_DIR := $(PRODUCT_HOME)/bin
|
||||
else
|
||||
JVMS_DIR := $(PRODUCT_HOME)/lib
|
||||
endif
|
||||
|
||||
# Use the existance of a directory as a sign that jvm variant is available
|
||||
CANDIDATE_JVM_VARIANTS := client minimal server
|
||||
JVM_VARIANTS := $(strip $(foreach x,$(CANDIDATE_JVM_VARIANTS),$(if $(wildcard $(JVMS_DIR)/$(x)),$(x))))
|
||||
|
||||
################################################################
|
||||
|
||||
# Run the native gtest tests from the test image
|
||||
|
||||
define NEWLINE
|
||||
|
||||
|
||||
endef
|
||||
|
||||
|
||||
hotspot_gtest:
|
||||
$(foreach v, $(JVM_VARIANTS), \
|
||||
$(MAKE) hotspot_gtest$v $(NEWLINE) )
|
||||
|
||||
hotspot_gtestserver hotspot_gtestclient hotspot_gtestminimal: hotspot_gtest%:
|
||||
$(TESTNATIVE_DIR)/hotspot/gtest/$*/gtestLauncher \
|
||||
-jdk $(shell $(GETMIXEDPATH) "$(PRODUCT_HOME)")
|
||||
|
||||
PHONY_LIST += hotspot_gtest hotspot_gtestserver hotspot_gtestclient \
|
||||
hotspot_gtestminimal
|
@ -1,42 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 1995, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
default: all
|
||||
|
||||
USE_JTREG_VERSION := 4.1
|
||||
|
||||
include ../TestCommon.gmk
|
||||
|
||||
# Default make rule (runs default JAXP tests)
|
||||
all: jaxp_all
|
||||
@$(ECHO) "Testing completed successfully"
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
|
||||
jaxp_%:
|
||||
$(ECHO) "Running tests: $@"
|
||||
for each in $@; do \
|
||||
$(MAKE) -j 1 TEST_SELECTION=":$$each" UNIQUE_DIR=$$each jtreg_tests; \
|
||||
done
|
@ -1,44 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 1995, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
default: all
|
||||
|
||||
NATIVE_TEST_PATH := jdk/jtreg/native
|
||||
|
||||
USE_FAILURE_HANDLER := true
|
||||
|
||||
include ../TestCommon.gmk
|
||||
|
||||
# Default make rule (runs default jdk tests)
|
||||
all: jdk_default
|
||||
@$(ECHO) "Testing completed successfully"
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
|
||||
jdk_% core_% svc_%:
|
||||
$(ECHO) "Running tests: $@"
|
||||
for each in $@; do \
|
||||
$(MAKE) -j 1 TEST_SELECTION=":$$each" UNIQUE_DIR=$$each jtreg_tests; \
|
||||
done
|
@ -1,464 +0,0 @@
|
||||
#
|
||||
# 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.
|
||||
|
||||
# Get OS/ARCH specifics
|
||||
OSNAME = $(shell uname -s)
|
||||
ifeq ($(OSNAME), SunOS)
|
||||
SLASH_JAVA = /java
|
||||
PLATFORM = solaris
|
||||
ARCH = $(shell uname -p)
|
||||
ifeq ($(ARCH), i386)
|
||||
ARCH=i586
|
||||
endif
|
||||
endif
|
||||
ifeq ($(OSNAME), Linux)
|
||||
SLASH_JAVA = /java
|
||||
PLATFORM = linux
|
||||
ARCH = $(shell uname -m)
|
||||
ifeq ($(ARCH), i386)
|
||||
ARCH=i586
|
||||
endif
|
||||
endif
|
||||
ifeq ($(OSNAME), Darwin)
|
||||
PLATFORM = bsd
|
||||
ARCH = $(shell uname -m)
|
||||
ifeq ($(ARCH), i386)
|
||||
ARCH=i586
|
||||
endif
|
||||
endif
|
||||
ifeq ($(OSNAME), Windows_NT)
|
||||
# MKS
|
||||
PLATFORM=windows
|
||||
endif
|
||||
ifeq ($(PLATFORM),)
|
||||
PLATFORM = windows
|
||||
CYGPATH = | cygpath -m -s -f -
|
||||
endif
|
||||
|
||||
ifeq ($(PLATFORM), windows)
|
||||
SLASH_JAVA = J:
|
||||
ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)),ia64)
|
||||
ARCH=ia64
|
||||
else
|
||||
ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)),AMD64)
|
||||
ARCH=x64
|
||||
else
|
||||
ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)),EM64T)
|
||||
ARCH=x64
|
||||
else
|
||||
ARCH=i586
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
EXE_SUFFIX=.exe
|
||||
endif
|
||||
|
||||
# Root of this test area (important to use full paths in some places)
|
||||
TEST_ROOT := $(shell pwd $(CYGPATH) )
|
||||
|
||||
ifeq ($(PLATFORM), windows)
|
||||
SLASH_JAVA = J:
|
||||
else
|
||||
SLASH_JAVA = /java
|
||||
endif
|
||||
|
||||
# Default JTREG to run
|
||||
ifndef JTREG_HOME
|
||||
ifdef JT_HOME
|
||||
JTREG_HOME = $(JT_HOME)
|
||||
else
|
||||
JTREG_HOME = $(SLASH_JAVA)/re/jtreg/4.2/promoted/latest/
|
||||
endif
|
||||
endif
|
||||
JTREG = $(JTREG_HOME)/bin/jtreg
|
||||
JTDIFF = $(JTREG_HOME)/bin/jtdiff
|
||||
|
||||
# Problematic tests to be excluded
|
||||
PROBLEM_LISTS=ProblemList.txt
|
||||
|
||||
# Create exclude list for this platform and arch
|
||||
ifdef NO_EXCLUDES
|
||||
JTREG_EXCLUSIONS =
|
||||
else
|
||||
JTREG_EXCLUSIONS = $(PROBLEM_LISTS:%=-exclude:%)
|
||||
endif
|
||||
|
||||
# Default JCK to run
|
||||
ifndef JCK_HOME
|
||||
JCK_HOME = $(SLASH_JAVA)/re/jck/8/promoted/latest/binaries
|
||||
endif
|
||||
|
||||
# Default JDK for JTREG and JCK
|
||||
#
|
||||
# JT_JAVA is the version of java used to run jtreg/JCK.
|
||||
#
|
||||
ifndef JT_JAVA
|
||||
JT_JAVA = $(SLASH_JAVA)/re/jdk/1.9.0/archive/fcs/binaries/$(PLATFORM)-$(ARCH)
|
||||
endif
|
||||
|
||||
# Default JDK to test
|
||||
TESTJAVA = $(SLASH_JAVA)/re/jdk/1.9.0/promoted/latest/binaries/$(PLATFORM)-$(ARCH)
|
||||
|
||||
# PRODUCT_HOME is a variable pointing to a directory containing the output from
|
||||
# make/Makefile
|
||||
# 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)
|
||||
ifdef PRODUCT_HOME
|
||||
ifeq ($(shell [ -r $(PRODUCT_HOME)/dist/lib/classes.jar ]; echo $$?),0)
|
||||
TESTBOOTCLASSPATH = $(PRODUCT_HOME)/dist/lib/classes.jar
|
||||
endif
|
||||
ifeq ($(shell [ -r $(PRODUCT_HOME)/bin/javac$(EXE_SUFFIX) ]; echo $$?),0)
|
||||
TESTJAVA = $(PRODUCT_HOME)
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef TESTBOOTCLASSPATH
|
||||
JTREG_OPTIONS += -Xbootclasspath/p:$(TESTBOOTCLASSPATH)
|
||||
### In the following, -refvmoptions is an undocumented option
|
||||
### The following does not work JCK 7 b30 2/6/2010. Awaiting b31.
|
||||
JCK_OPTIONS += \
|
||||
-vmoptions:-Xbootclasspath/p:$(TESTBOOTCLASSPATH) \
|
||||
-refvmoptions:-Xbootclasspath/p:$(TESTBOOTCLASSPATH)
|
||||
endif
|
||||
|
||||
# Set the max memory for jtreg target test JVMs
|
||||
JTREG_TESTVM_MEMORY_OPTION = -vmoption:-Xmx768m
|
||||
JTREG_OPTIONS += $(JTREG_TESTVM_MEMORY_OPTION)
|
||||
|
||||
# Retain all files for failing tests
|
||||
JTREG_OPTIONS += -retain:fail,error
|
||||
|
||||
ifdef EXTRA_JTREG_OPTIONS
|
||||
JTREG_OPTIONS += $(EXTRA_JTREG_OPTIONS)
|
||||
endif
|
||||
|
||||
# Concurrency is the number of tests that can execute at once.
|
||||
# On an otherwise empty machine, suggest setting to (#cpus + 2)
|
||||
# If unset, the default is (#cpus)
|
||||
### RFE: determine and use #cpus
|
||||
ifdef CONCURRENCY
|
||||
JTREG_OPTIONS += -agentvm -concurrency:$(CONCURRENCY)
|
||||
else
|
||||
JTREG_OPTIONS += -agentvm
|
||||
endif
|
||||
|
||||
ifdef JCK_CONCURRENCY
|
||||
JCK_OPTIONS += -concurrency:$(JCK_CONCURRENCY)
|
||||
endif
|
||||
|
||||
# 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_GROUP_SIZE = 1000
|
||||
ifdef JCK_GROUP_SIZE
|
||||
JCK_COMPILER_OPTIONS += \
|
||||
-jtoptions:-Ejck.env.compiler.testCompile.groupMode.groupSize=$(JCK_GROUP_SIZE) \
|
||||
-jtoptions:-Ejck.env.compiler.compRefExecute.groupMode.groupSize=$(JCK_GROUP_SIZE)
|
||||
### 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)
|
||||
endif
|
||||
|
||||
# Timeouts
|
||||
ifdef JTREG_TIMEOUT_FACTOR
|
||||
JTREG_OPTIONS += -timeoutFactor:$(JTREG_TIMEOUT_FACTOR)
|
||||
endif
|
||||
|
||||
ifdef JCK_TIMEOUT_FACTOR
|
||||
JCK_OPTIONS += -timeout:$(JCK_TIMEOUT_FACTOR)
|
||||
endif
|
||||
|
||||
# Default verbosity setting for jtreg
|
||||
JTREG_VERBOSE ?= fail,error,time
|
||||
|
||||
# Default verbosity setting for jck
|
||||
JCK_VERBOSE ?= non-pass
|
||||
|
||||
# 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.
|
||||
JTREG_OPTIONS += $(ASSERTION_OPTIONS)
|
||||
JCK_OPTIONS += $(ASSERTION_OPTIONS:%=-vmoptions:%)
|
||||
|
||||
# Include shared options
|
||||
JCK_COMPILER_OPTIONS += $(JCK_OPTIONS)
|
||||
JCK_RUNTIME_OPTIONS += $(JCK_OPTIONS)
|
||||
|
||||
# Exit codes:
|
||||
# jtreg, jck: 0: OK, 1: tests failed, 2: tests error; 3+: SERIOUS
|
||||
FATAL_JTREG_EXIT = 3
|
||||
FATAL_JCK_EXIT = 3
|
||||
# jtdiff: 0: OK, 1: differences found; 2+: SERIOUS
|
||||
FATAL_JTDIFF_EXIT = 2
|
||||
#
|
||||
# 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.
|
||||
EXIT_IF_FATAL = status=$$?; if [ $$status -ge $(1) ]; then exit $$status ; fi
|
||||
|
||||
# Root of all test results
|
||||
TEST_OUTPUT_DIR ?= $(TEST_ROOT)/../build/$(PLATFORM)-$(ARCH)/test/langtools
|
||||
ABS_TEST_OUTPUT_DIR := \
|
||||
$(shell mkdir -p $(TEST_OUTPUT_DIR); \
|
||||
cd $(TEST_OUTPUT_DIR); \
|
||||
pwd $(CYGPATH))
|
||||
# Subdirectories for different test runs
|
||||
JTREG_OUTPUT_DIR = $(ABS_TEST_OUTPUT_DIR)/jtreg
|
||||
JCK_COMPILER_OUTPUT_DIR = $(ABS_TEST_OUTPUT_DIR)/jck-compiler
|
||||
JCK_RUNTIME_OUTPUT_DIR = $(ABS_TEST_OUTPUT_DIR)/jck-runtime-Xcompile
|
||||
|
||||
# Is the test JVM 32-bit?
|
||||
DATA_MODEL := \
|
||||
$(shell $(TESTJAVA)/bin/java -XshowSettings:properties -version 2>&1 | \
|
||||
grep 'sun\.arch\.data\.model' | \
|
||||
awk '{print $$3}')
|
||||
ifeq ($(DATA_MODEL), 32)
|
||||
# Set the GC options for test vms having a smaller address space
|
||||
JTREG_GC_OPTION = -vmoption:-XX:+UseSerialGC
|
||||
JTREG_OPTIONS += $(JTREG_GC_OPTION)
|
||||
endif
|
||||
|
||||
# Default make rule -- warning, may take a while
|
||||
all: jtreg-tests jck-compiler-tests jck-runtime-tests all-summary
|
||||
@echo "Testing completed successfully"
|
||||
|
||||
jtreg apt javac javadoc javah javap jdeps: jtreg-tests jtreg-summary
|
||||
@echo "Testing completed successfully"
|
||||
|
||||
jck-compiler: jck-compiler-tests jck-compiler-summary
|
||||
@echo "Testing completed successfully"
|
||||
|
||||
jck-runtime: jck-runtime-tests jck-runtime-summary
|
||||
@echo "Testing completed successfully"
|
||||
|
||||
# a way to select tests from outside
|
||||
# works for targets 'jtreg', 'jck-compiler', and 'jck-runtime'
|
||||
ifdef TEST_SELECTION
|
||||
JTREG_TESTDIRS = $(TEST_SELECTION)
|
||||
JCK_COMPILER_TESTDIRS = $(TEST_SELECTION)
|
||||
JCK_RUNTIME_TESTDIRS = $(TEST_SELECTION)
|
||||
endif
|
||||
|
||||
# convenience targets
|
||||
all: JTREG_TESTDIRS = .
|
||||
jtreg: JTREG_TESTDIRS ?= .
|
||||
apt: JTREG_TESTDIRS = tools/apt
|
||||
javac: JTREG_TESTDIRS = tools/javac
|
||||
javadoc: JTREG_TESTDIRS = tools/javadoc com/sun/javadoc
|
||||
javah: JTREG_TESTDIRS = tools/javah
|
||||
javap: JTREG_TESTDIRS = tools/javap
|
||||
jdeps: JTREG_TESTDIRS = tools/jdeps
|
||||
|
||||
|
||||
# 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_VERBOSE
|
||||
# Verbosity setting for jtreg
|
||||
# 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)
|
||||
#
|
||||
jtreg_tests: jtreg-tests
|
||||
jtreg-tests: check-jtreg FRC
|
||||
@rm -f -r $(JTREG_OUTPUT_DIR)/JTwork $(JTREG_OUTPUT_DIR)/JTreport \
|
||||
$(JTREG_OUTPUT_DIR)/diff.html $(JTREG_OUTPUT_DIR)/status.txt
|
||||
@mkdir -p $(JTREG_OUTPUT_DIR)
|
||||
( JT_JAVA=$(JT_JAVA) $(JTREG) \
|
||||
-a -ignore:quiet $(if $(JTREG_VERBOSE),-v:$(JTREG_VERBOSE)) \
|
||||
-r:$(JTREG_OUTPUT_DIR)/JTreport \
|
||||
-w:$(JTREG_OUTPUT_DIR)/JTwork \
|
||||
-jdk:$(TESTJAVA) \
|
||||
$(JAVA_ARGS:%=-vmoption:%) \
|
||||
$(JTREG_EXCLUSIONS) \
|
||||
$(JTREG_OPTIONS) \
|
||||
$(JTREG_TESTDIRS) \
|
||||
|| ( $(call EXIT_IF_FATAL,$(FATAL_JTREG_EXIT)) ; \
|
||||
echo $$status > $(JTREG_OUTPUT_DIR)/status.txt \
|
||||
) \
|
||||
) 2>&1 | tee $(JTREG_OUTPUT_DIR)/output.txt
|
||||
ifdef JTREG_REFERENCE
|
||||
JT_JAVA=$(JT_JAVA) $(JTDIFF) -o $(JTREG_OUTPUT_DIR)/diff.html \
|
||||
$(JTREG_REFERENCE) $(JTREG_OUTPUT_DIR)/JTreport \
|
||||
|| ( $(call EXIT_IF_FATAL,$(FATAL_JTDIFF_EXIT)) )
|
||||
endif
|
||||
|
||||
jtreg-summary: FRC
|
||||
@if [ -r $(JTREG_OUTPUT_DIR)/status.txt ]; then \
|
||||
echo ; echo "Summary of jtreg test failures" ; \
|
||||
cat $(JTREG_OUTPUT_DIR)/JTreport/text/summary.txt | \
|
||||
grep -v 'Not run' | grep -v 'Passed' ; \
|
||||
echo ; \
|
||||
$(EXIT) `cat $(JTREG_OUTPUT_DIR)/status.txt` ; \
|
||||
fi
|
||||
|
||||
# Check to make sure these directories exist
|
||||
check-jtreg: $(PRODUCT_HOME) $(JTREG)
|
||||
|
||||
|
||||
# Run JCK-compiler tests
|
||||
#
|
||||
# JCK_HOME
|
||||
# Installed location of JCK: should include JCK-compiler, and JCK-extras
|
||||
# Default is JCK 8.
|
||||
# JT_JAVA
|
||||
# Version of java used to run JCK. Should normally be the same as TESTJAVA
|
||||
# Default is JDK 7
|
||||
# TESTJAVA
|
||||
# Version of java to be tested.
|
||||
# JCK_VERBOSE
|
||||
# Verbosity setting for jtjck
|
||||
# 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)
|
||||
#
|
||||
jck-compiler-tests: check-jck FRC
|
||||
@rm -f -r $(JCK_COMPILER_OUTPUT_DIR)/work $(JCK_COMPILER_OUTPUT_DIR)/report \
|
||||
$(JCK_COMPILER_OUTPUT_DIR)/diff.html $(JCK_COMPILER_OUTPUT_DIR)/status.txt
|
||||
@mkdir -p $(JCK_COMPILER_OUTPUT_DIR)
|
||||
$(JT_JAVA)/bin/java -Xmx1024m \
|
||||
-jar $(JCK_HOME)/JCK-compiler-9/lib/jtjck.jar \
|
||||
$(if $(JCK_VERBOSE),$(if $(filter $(JCK_VERBOSE),summary),-v,-v:$(JCK_VERBOSE))) \
|
||||
-r:$(JCK_COMPILER_OUTPUT_DIR)/report \
|
||||
-w:$(JCK_COMPILER_OUTPUT_DIR)/work \
|
||||
-jdk:$(TESTJAVA) \
|
||||
$(JCK_COMPILER_OPTIONS) \
|
||||
$(JCK_COMPILER_TESTDIRS) \
|
||||
|| ( $(call EXIT_IF_FATAL,$(FATAL_JCK_EXIT)) ; \
|
||||
echo $$status > $(JCK_COMPILER_OUTPUT_DIR)/status.txt \
|
||||
)
|
||||
ifdef JCK_COMPILER_REFERENCE
|
||||
JT_JAVA=$(JT_JAVA) $(JTDIFF) -o $(JCK_COMPILER_OUTPUT_DIR)/diff.html \
|
||||
$(JCK_COMPILER_REFERENCE) $(JCK_COMPILER_OUTPUT_DIR)/report \
|
||||
|| ( $(call EXIT_IF_FATAL,$(FATAL_JTDIFF_EXIT)) )
|
||||
endif
|
||||
|
||||
jck-compiler-summary: FRC
|
||||
@if [ -r $(JCK_COMPILER_OUTPUT_DIR)/status.txt ]; then \
|
||||
echo ; echo "Summary of JCK-compiler test failures" ; \
|
||||
cat $(JCK_COMPILER_OUTPUT_DIR)/report/text/summary.txt | \
|
||||
grep -v 'Not run' | grep -v 'Passed' ; \
|
||||
echo ; \
|
||||
$(EXIT) `cat $(JCK_COMPILER_OUTPUT_DIR)/status.txt` ; \
|
||||
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_VERBOSE
|
||||
# Verbosity setting for jtjck
|
||||
# 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)
|
||||
#
|
||||
jck-runtime-tests: check-jck FRC
|
||||
@rm -f -r $(JCK_RUNTIME_OUTPUT_DIR)/work $(JCK_RUNTIME_OUTPUT_DIR)/report \
|
||||
$(JCK_RUNTIME_OUTPUT_DIR)/diff.html $(JCK_RUNTIME_OUTPUT_DIR)/status.txt
|
||||
@mkdir -p $(JCK_RUNTIME_OUTPUT_DIR)
|
||||
$(JT_JAVA)/bin/java -Xmx1024m \
|
||||
-jar $(JCK_HOME)/JCK-runtime-9/lib/jtjck.jar \
|
||||
$(if $(JCK_VERBOSE),$(if $(filter $(JCK_VERBOSE),summary),-v,-v:$(JCK_VERBOSE))) \
|
||||
-r:$(JCK_RUNTIME_OUTPUT_DIR)/report \
|
||||
-w:$(JCK_RUNTIME_OUTPUT_DIR)/work \
|
||||
-jdk:$(TESTJAVA) \
|
||||
-Xcompile \
|
||||
$(JCK_RUNTIME_OPTIONS) \
|
||||
$(JCK_RUNTIME_TESTDIRS) \
|
||||
|| ( $(call EXIT_IF_FATAL,$(FATAL_JCK_EXIT)) ; \
|
||||
echo $$status > $(JCK_RUNTIME_OUTPUT_DIR)/status.txt \
|
||||
)
|
||||
ifdef JCK_RUNTIME_REFERENCE
|
||||
JT_JAVA=$(JT_JAVA) $(JTDIFF) -o $(JCK_RUNTIME_OUTPUT_DIR)/diff.html \
|
||||
$(JCK_RUNTIME_REFERENCE) $(JCK_RUNTIME_OUTPUT_DIR)/report \
|
||||
|| ( $(call EXIT_IF_FATAL,$(FATAL_JTDIFF_EXIT)) )
|
||||
endif
|
||||
|
||||
jck-runtime-summary: FRC
|
||||
@if [ -r $(JCK_RUNTIME_OUTPUT_DIR)/status.txt ]; then \
|
||||
echo ; echo "Summary of JCK-runtime test failures" ; \
|
||||
cat $(JCK_RUNTIME_OUTPUT_DIR)/report/text/summary.txt | \
|
||||
grep -v 'Not run' | grep -v 'Passed' ; \
|
||||
echo ; \
|
||||
$(EXIT) `cat $(JCK_RUNTIME_OUTPUT_DIR)/status.txt` ; \
|
||||
fi
|
||||
|
||||
# Check to make sure these directories exist
|
||||
check-jck:
|
||||
@if [ ! -d '$(JCK_HOME)' ]; then \
|
||||
echo "JCK_HOME $(JCK_HOME) missing" ; \
|
||||
$(EXIT) 1 ; \
|
||||
fi
|
||||
@if [ ! -d '$(PRODUCT_HOME)' ]; then \
|
||||
echo "PRODUCT_HOME $(PRODUCT_HOME) missing" ; \
|
||||
$(EXIT) 1 ; \
|
||||
fi
|
||||
|
||||
all-summary: FRC
|
||||
@if [ -n "`find $(TEST_OUTPUT_DIR) -name status.txt`" ]; then
|
||||
echo ; echo "Summary of test failures" ; \
|
||||
cat `find $(TEST_OUTPUT_DIR) -name summary.txt` | \
|
||||
grep -v 'Not run' | grep -v 'Passed' ; \
|
||||
echo ; \
|
||||
$(EXIT) 1
|
||||
fi
|
||||
|
||||
# Cleanup
|
||||
clean:
|
||||
|
||||
# Used to force a target rules to run
|
||||
FRC:
|
||||
|
||||
# Phony targets (e.g. these are not filenames)
|
||||
.PHONY: all clean \
|
||||
jtreg javac javadoc javah javap jdeps jtreg-tests jtreg-summary check-jtreg \
|
||||
jck-compiler jck-compiler-tests jck-compiler-summary \
|
||||
jck-runtime jck-runtime-tests jck-runtime-summary check-jck
|
||||
|
||||
# No use of suffix rules
|
||||
.SUFFIXES:
|
||||
|
@ -1,43 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 1995, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
default: all
|
||||
|
||||
USE_FAILURE_HANDLER := true
|
||||
|
||||
include ../TestCommon.gmk
|
||||
|
||||
# Default make rule (runs default nashorn tests)
|
||||
all: nashorn_default
|
||||
@$(ECHO) "Testing completed successfully"
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
|
||||
nashorn_%:
|
||||
$(ECHO) "Running tests: $@"
|
||||
for each in $@; do \
|
||||
$(MAKE) -j 1 TEST_SELECTION=":$$each" UNIQUE_DIR=$$each jtreg_tests; \
|
||||
done
|
||||
|
Loading…
x
Reference in New Issue
Block a user