Makefile revision 6117
1N/A#
1N/A# Copyright (c) 1995, 2012, Oracle and/or its affiliates. All rights reserved.
1N/A# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
1N/A#
1N/A# This code is free software; you can redistribute it and/or modify it
1N/A# under the terms of the GNU General Public License version 2 only, as
1N/A# published by the Free Software Foundation. Oracle designates this
1N/A# particular file as subject to the "Classpath" exception as provided
1N/A# by Oracle in the LICENSE file that accompanied this code.
1N/A#
1N/A# This code is distributed in the hope that it will be useful, but WITHOUT
1N/A# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1N/A# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
1N/A# version 2 for more details (a copy is included in the LICENSE file that
1N/A# accompanied this code).
1N/A#
1N/A# You should have received a copy of the GNU General Public License version
1N/A# 2 along with this work; if not, write to the Free Software Foundation,
1N/A# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
1N/A#
1N/A# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
1N/A# or visit www.oracle.com if you need additional information or have any
1N/A# questions.
1N/A#
1N/A
1N/A#
1N/A# Makefile to run various jdk tests
1N/A#
1N/A
1N/A# Empty these to get rid of some default rules
1N/A.SUFFIXES:
1N/A.SUFFIXES: .java
1N/ACO=
1N/AGET=
1N/A
1N/A# Utilities used
1N/AAWK = awk
1N/ACAT = cat
1N/ACD = cd
1N/ACHMOD = chmod
1N/ACP = cp
1N/ACUT = cut
1N/ADIRNAME = dirname
1N/AECHO = echo
1N/AEGREP = egrep
1N/AEXPAND = expand
1N/AFIND = find
1N/AMKDIR = mkdir
1N/APWD = pwd
1N/ASED = sed
1N/ASORT = sort
1N/ATEE = tee
1N/AUNAME = uname
1N/AUNIQ = uniq
1N/AWC = wc
1N/AZIP = zip
1N/A
1N/A# Get OS name from uname
1N/AUNAME_S := $(shell $(UNAME) -s)
1N/A
1N/A# Commands to run on paths to make mixed paths for java on windows
1N/AGETMIXEDPATH=$(ECHO)
1N/A
1N/A# Location of developer shared files
1N/ASLASH_JAVA = /java
1N/A
1N/A# Platform specific settings
1N/Aifeq ($(UNAME_S), SunOS)
1N/A OS_NAME = solaris
1N/A OS_ARCH := $(shell $(UNAME) -p)
1N/A OS_VERSION := $(shell $(UNAME) -r)
1N/Aendif
1N/Aifeq ($(UNAME_S), Linux)
1N/A OS_NAME = linux
1N/A OS_ARCH := $(shell $(UNAME) -m)
1N/A # Check for unknown arch, try uname -p if uname -m says unknown
1N/A ifeq ($(OS_ARCH),unknown)
1N/A OS_ARCH := $(shell $(UNAME) -p)
1N/A endif
1N/A OS_VERSION := $(shell $(UNAME) -r)
1N/Aendif
1N/Aifeq ($(UNAME_S), Darwin)
1N/A OS_NAME = macosx
1N/A OS_ARCH := $(shell $(UNAME) -m)
1N/A # Check for unknown arch, try uname -p if uname -m says unknown
1N/A ifeq ($(OS_ARCH),unknown)
1N/A OS_ARCH := $(shell $(UNAME) -p)
1N/A endif
1N/A OS_VERSION := $(shell $(UNAME) -r)
1N/Aendif
1N/Aifeq ($(OS_NAME),)
1N/A OS_NAME = windows
1N/A # GNU Make or MKS overrides $(PROCESSOR_ARCHITECTURE) to always
1N/A # return "x86". Use the first word of $(PROCESSOR_IDENTIFIER) instead.
1N/A ifeq ($(PROCESSOR_IDENTIFIER),)
1N/A PROC_ARCH:=$(shell $(UNAME) -m)
1N/A else
1N/A PROC_ARCH:=$(word 1, $(PROCESSOR_IDENTIFIER))
1N/A endif
1N/A OS_ARCH:=$(PROC_ARCH)
1N/A SLASH_JAVA = J:
1N/A EXESUFFIX = .exe
1N/A # These need to be different depending on MKS or CYGWIN
1N/A ifeq ($(findstring cygdrive,$(shell ($(CD) C:/ && $(PWD)))), )
1N/A GETMIXEDPATH = dosname -s
1N/A OS_VERSION := $(shell $(UNAME) -r)
1N/A else
1N/A GETMIXEDPATH = cygpath -m -s
1N/A OS_VERSION := $(shell $(UNAME) -s | $(CUT) -d'-' -f2)
1N/A endif
1N/Aendif
1N/A
1N/A# Only want major and minor numbers from os version
1N/AOS_VERSION := $(shell $(ECHO) "$(OS_VERSION)" | $(CUT) -d'.' -f1,2)
1N/A
1N/A# Name to use for x86_64 arch (historically amd64, but should change someday)
1N/AOS_ARCH_X64_NAME:=amd64
1N/A#OS_ARCH_X64_NAME:=x64
1N/A
1N/A# Alternate arch names (in case this arch is known by a second name)
1N/A# PROBLEM_LISTS may use either name.
1N/AOS_ARCH2-amd64:=x64
1N/A#OS_ARCH2-x64:=amd64
1N/A
1N/A# Try and use the arch names consistently
1N/AOS_ARCH:=$(patsubst x64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
1N/AOS_ARCH:=$(patsubst X64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
1N/AOS_ARCH:=$(patsubst AMD64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
1N/AOS_ARCH:=$(patsubst amd64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
1N/AOS_ARCH:=$(patsubst x86_64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
1N/AOS_ARCH:=$(patsubst 86_64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
1N/AOS_ARCH:=$(patsubst 8664,$(OS_ARCH_X64_NAME),$(OS_ARCH))
1N/AOS_ARCH:=$(patsubst EM64T,$(OS_ARCH_X64_NAME),$(OS_ARCH))
1N/AOS_ARCH:=$(patsubst em64t,$(OS_ARCH_X64_NAME),$(OS_ARCH))
1N/AOS_ARCH:=$(patsubst intel64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
1N/AOS_ARCH:=$(patsubst Intel64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
1N/AOS_ARCH:=$(patsubst INTEL64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
1N/AOS_ARCH:=$(patsubst IA64,ia64,$(OS_ARCH))
1N/AOS_ARCH:=$(patsubst X86,i586,$(OS_ARCH))
1N/AOS_ARCH:=$(patsubst x86,i586,$(OS_ARCH))
1N/AOS_ARCH:=$(patsubst i386,i586,$(OS_ARCH))
1N/AOS_ARCH:=$(patsubst i486,i586,$(OS_ARCH))
1N/AOS_ARCH:=$(patsubst i686,i586,$(OS_ARCH))
1N/AOS_ARCH:=$(patsubst 386,i586,$(OS_ARCH))
1N/AOS_ARCH:=$(patsubst 486,i586,$(OS_ARCH))
1N/AOS_ARCH:=$(patsubst 586,i586,$(OS_ARCH))
1N/AOS_ARCH:=$(patsubst 686,i586,$(OS_ARCH))
1N/A
1N/A# Default ARCH_DATA_MODEL settings
1N/AARCH_DATA_MODEL-i586 = 32
1N/AARCH_DATA_MODEL-$(OS_ARCH_X64_NAME) = 64
1N/AARCH_DATA_MODEL-ia64 = 64
1N/AARCH_DATA_MODEL-sparc = 32
1N/AARCH_DATA_MODEL-sparcv9 = 64
1N/A
1N/A# If ARCH_DATA_MODEL is not defined, try and pick a reasonable default
1N/Aifndef ARCH_DATA_MODEL
1N/A ARCH_DATA_MODEL:=$(ARCH_DATA_MODEL-$(OS_ARCH))
1N/Aendif
1N/Aifndef ARCH_DATA_MODEL
1N/A ARCH_DATA_MODEL=32
1N/Aendif
1N/A
1N/A# Platform directory name
1N/APLATFORM_OS = $(OS_NAME)-$(OS_ARCH)
1N/A
1N/A# Check ARCH_DATA_MODEL, adjust OS_ARCH accordingly on solaris
1N/AARCH_DATA_MODEL_ERROR= \
1N/A ARCH_DATA_MODEL=$(ARCH_DATA_MODEL) cannot be used with $(PLATFORM_OS)
1N/Aifeq ($(ARCH_DATA_MODEL),64)
1N/A ifeq ($(PLATFORM_OS),solaris-i586)
1N/A OS_ARCH=$(OS_ARCH_X64_NAME)
1N/A endif
1N/A ifeq ($(PLATFORM_OS),solaris-sparc)
1N/A OS_ARCH=sparcv9
1N/A endif
1N/A ifeq ($(OS_ARCH),i586)
1N/A x:=$(warning "WARNING: $(ARCH_DATA_MODEL_ERROR)")
1N/A endif
1N/A ifeq ($(OS_ARCH),sparc)
1N/A x:=$(warning "WARNING: $(ARCH_DATA_MODEL_ERROR)")
1N/A endif
1N/Aelse
1N/A ifeq ($(ARCH_DATA_MODEL),32)
1N/A ifeq ($(OS_ARCH),$(OS_ARCH_X64_NAME))
1N/A x:=$(warning "WARNING: $(ARCH_DATA_MODEL_ERROR)")
1N/A endif
1N/A ifeq ($(OS_ARCH),ia64)
1N/A x:=$(warning "WARNING: $(ARCH_DATA_MODEL_ERROR)")
1N/A endif
1N/A ifeq ($(OS_ARCH),sparcv9)
1N/A x:=$(warning "WARNING: $(ARCH_DATA_MODEL_ERROR)")
1N/A endif
1N/A else
1N/A x:=$(warning "WARNING: $(ARCH_DATA_MODEL_ERROR)")
1N/A endif
1N/Aendif
1N/A
1N/A# Alternate OS_ARCH name (defaults to OS_ARCH)
1N/AOS_ARCH2:=$(OS_ARCH2-$(OS_ARCH))
1N/Aifeq ($(OS_ARCH2),)
1N/A OS_ARCH2:=$(OS_ARCH)
1N/Aendif
1N/A
1N/A# Root of this test area (important to use full paths in some places)
1N/ATEST_ROOT := $(shell $(PWD))
1N/A
1N/A# Root of all test results
1N/Aifdef ALT_OUTPUTDIR
1N/A ABS_OUTPUTDIR = $(ALT_OUTPUTDIR)
1N/Aelse
1N/A ABS_OUTPUTDIR = $(TEST_ROOT)/../build/$(PLATFORM_OS)
1N/Aendif
1N/AABS_PLATFORM_BUILD_ROOT = $(ABS_OUTPUTDIR)
1N/AABS_TEST_OUTPUT_DIR := $(ABS_PLATFORM_BUILD_ROOT)/testoutput/$(UNIQUE_DIR)
1N/A
1N/A# Expect JPRT to set PRODUCT_HOME (the product or jdk in this case to test)
1N/Aifndef PRODUCT_HOME
1N/A # Try to use j2sdk-image if it exists
1N/A ABS_JDK_IMAGE = $(ABS_PLATFORM_BUILD_ROOT)/j2sdk-image
1N/A PRODUCT_HOME := \
1N/A $(shell \
1N/A if [ -d $(ABS_JDK_IMAGE) ] ; then \
1N/A $(ECHO) "$(ABS_JDK_IMAGE)"; \
1N/A else \
1N/A $(ECHO) "$(ABS_PLATFORM_BUILD_ROOT)"; \
1N/A fi)
1N/A PRODUCT_HOME := $(PRODUCT_HOME)
1N/Aendif
1N/A
1N/A# Expect JPRT to set JPRT_PRODUCT_ARGS (e.g. -server etc.)
1N/A# Should be passed into 'java' only.
1N/A# Could include: -d64 -server -client OR any java option
1N/Aifdef JPRT_PRODUCT_ARGS
1N/A JAVA_ARGS = $(JPRT_PRODUCT_ARGS)
1N/Aendif
1N/A
1N/A# Expect JPRT to set JPRT_PRODUCT_VM_ARGS (e.g. -Xcomp etc.)
1N/A# Should be passed into anything running the vm (java, javac, javadoc, ...).
1N/Aifdef JPRT_PRODUCT_VM_ARGS
1N/A JAVA_VM_ARGS = $(JPRT_PRODUCT_VM_ARGS)
1N/Aendif
1N/A
1N/A# Check JAVA_ARGS arguments based on ARCH_DATA_MODEL etc.
1N/Aifeq ($(OS_NAME),solaris)
1N/A D64_ERROR_MESSAGE=Mismatch between ARCH_DATA_MODEL=$(ARCH_DATA_MODEL) and use of -d64 in JAVA_ARGS=$(JAVA_ARGS)
1N/A ifeq ($(ARCH_DATA_MODEL),32)
1N/A ifneq ($(findstring -d64,$(JAVA_ARGS)),)
1N/A x:=$(warning "WARNING: $(D64_ERROR_MESSAGE)")
1N/A endif
1N/A endif
1N/A ifeq ($(ARCH_DATA_MODEL),64)
1N/A ifeq ($(findstring -d64,$(JAVA_ARGS)),)
1N/A x:=$(warning "WARNING: $(D64_ERROR_MESSAGE)")
1N/A endif
1N/A endif
1N/Aendif
1N/A
1N/A# Macro to run make and set the shared library permissions
1N/Adefine SharedLibraryPermissions
1N/A$(MAKE) SHARED_LIBRARY_DIR=$1 UNIQUE_DIR=$@ shared_library_permissions
1N/Aendef
1N/A
1N/A# Expect JPRT to set JPRT_ARCHIVE_BUNDLE (path to zip bundle for results)
1N/AARCHIVE_BUNDLE = $(ABS_TEST_OUTPUT_DIR)/ARCHIVE_BUNDLE.zip
1N/Aifdef JPRT_ARCHIVE_BUNDLE
1N/A ARCHIVE_BUNDLE = $(JPRT_ARCHIVE_BUNDLE)
1N/Aendif
1N/A
1N/A# How to create the test bundle (pass or fail, we want to create this)
1N/A# Follow command with ";$(BUNDLE_UP_AND_EXIT)", so it always gets executed.
1N/AZIP_UP_RESULTS = ( $(MKDIR) -p `$(DIRNAME) $(ARCHIVE_BUNDLE)` \
1N/A && $(CD) $(ABS_TEST_OUTPUT_DIR) \
1N/A && $(CHMOD) -R a+r . \
1N/A && $(ZIP) -q -r $(ARCHIVE_BUNDLE) . )
1N/ASUMMARY_TXT = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/JTreport/text/summary.txt
1N/ASTATS_TXT_NAME = Stats.txt
1N/ASTATS_TXT = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/$(STATS_TXT_NAME)
1N/ARUNLIST = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/runlist.txt
1N/APASSLIST = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/passlist.txt
1N/AFAILLIST = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/faillist.txt
1N/AEXITCODE = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/exitcode.txt
1N/A
1N/ATESTEXIT = \
1N/A if [ ! -s $(EXITCODE) ] ; then \
1N/A $(ECHO) "ERROR: EXITCODE file not filled in."; \
1N/A $(ECHO) "1" > $(EXITCODE); \
1N/A fi ; \
1N/A testExitCode=`$(CAT) $(EXITCODE)`; \
1N/A $(ECHO) "EXIT CODE: $${testExitCode}"; \
1N/A exit $${testExitCode}
1N/A
1N/ABUNDLE_UP_AND_EXIT = \
1N/A( \
1N/A jtregExitCode=$$? && \
1N/A _summary="$(SUMMARY_TXT)"; \
1N/A $(RM) -f $(STATS_TXT) $(RUNLIST) $(PASSLIST) $(FAILLIST) $(EXITCODE); \
1N/A $(ECHO) "$${jtregExitCode}" > $(EXITCODE); \
1N/A if [ -r "$${_summary}" ] ; then \
1N/A $(ECHO) "Summary: $(UNIQUE_DIR)" > $(STATS_TXT); \
1N/A $(EXPAND) $${_summary} | $(EGREP) -v ' Not run\.' > $(RUNLIST); \
1N/A $(EGREP) ' Passed\.' $(RUNLIST) \
1N/A | $(EGREP) -v ' Error\.' \
1N/A | $(EGREP) -v ' Failed\.' > $(PASSLIST); \
1N/A ( $(EGREP) ' Failed\.' $(RUNLIST); \
1N/A $(EGREP) ' Error\.' $(RUNLIST); \
1N/A $(EGREP) -v ' Passed\.' $(RUNLIST) ) \
1N/A | $(SORT) | $(UNIQ) > $(FAILLIST); \
1N/A if [ $${jtregExitCode} != 0 -o -s $(FAILLIST) ] ; then \
1N/A $(EXPAND) $(FAILLIST) \
1N/A | $(CUT) -d' ' -f1 \
1N/A | $(SED) -e 's@^@FAILED: @' >> $(STATS_TXT); \
1N/A if [ $${jtregExitCode} = 0 ] ; then \
1N/A jtregExitCode=1; \
1N/A fi; \
1N/A fi; \
1N/A runc="`$(CAT) $(RUNLIST) | $(WC) -l | $(AWK) '{print $$1;}'`"; \
1N/A passc="`$(CAT) $(PASSLIST) | $(WC) -l | $(AWK) '{print $$1;}'`"; \
1N/A failc="`$(CAT) $(FAILLIST) | $(WC) -l | $(AWK) '{print $$1;}'`"; \
1N/A exclc="`$(CAT) $(EXCLUDELIST) | $(WC) -l | $(AWK) '{print $$1;}'`"; \
1N/A $(ECHO) "TEST STATS: name=$(UNIQUE_DIR) run=$${runc} pass=$${passc} fail=$${failc} excluded=$${exclc}" \
1N/A >> $(STATS_TXT); \
1N/A else \
1N/A $(ECHO) "Missing file: $${_summary}" >> $(STATS_TXT); \
1N/A fi; \
1N/A if [ -f $(STATS_TXT) ] ; then \
1N/A $(CAT) $(STATS_TXT); \
1N/A fi; \
1N/A $(ZIP_UP_RESULTS) ; \
1N/A $(TESTEXIT) \
1N/A)
1N/A
1N/A################################################################
1N/A
1N/A# Default make rule (runs jtreg_tests)
1N/Aall: jtreg_tests
1N/A @$(ECHO) "Testing completed successfully"
1N/A
1N/A# Prep for output
1N/Aprep: clean
1N/A @$(MKDIR) -p $(ABS_TEST_OUTPUT_DIR)
1N/A @$(MKDIR) -p `$(DIRNAME) $(ARCHIVE_BUNDLE)`
1N/A
1N/A# Cleanup
1N/Aclean:
1N/A $(RM) -r $(ABS_TEST_OUTPUT_DIR)
1N/A $(RM) $(ARCHIVE_BUNDLE)
1N/A
1N/A################################################################
1N/A
1N/A# jtreg tests
1N/A
1N/A# Expect JT_HOME to be set for jtreg tests. (home for jtreg)
1N/Aifndef JT_HOME
1N/A JT_HOME = $(SLASH_JAVA)/re/jtreg/4.1/promoted/latest/binaries/jtreg
1N/A ifdef JPRT_JTREG_HOME
1N/A JT_HOME = $(JPRT_JTREG_HOME)
1N/A endif
1N/Aendif
1N/A
1N/A# Expect JPRT to set TESTDIRS to the jtreg test dirs
1N/Aifndef TESTDIRS
1N/A TESTDIRS = demo
1N/Aendif
1N/A
1N/A# Agentvm settings (default is false)
1N/Aifndef USE_JTREG_AGENTVM
1N/A USE_JTREG_AGENTVM=false
1N/Aendif
1N/A# With agentvm, you cannot use -javaoptions?
1N/Aifeq ($(USE_JTREG_AGENTVM),true)
1N/A JTREG_AGENTVM_OPTION = -agentvm
1N/A EXTRA_JTREG_OPTIONS += $(JTREG_AGENTVM_OPTION) $(JAVA_ARGS) $(JAVA_ARGS:%=-vmoption:%)
1N/A JTREG_TEST_OPTIONS = $(JAVA_VM_ARGS:%=-vmoption:%)
1N/Aelse
1N/A JTREG_TEST_OPTIONS = $(JAVA_ARGS:%=-javaoptions:%) $(JAVA_VM_ARGS:%=-vmoption:%)
1N/Aendif
1N/A
1N/Aifdef CONCURRENCY
1N/A EXTRA_JTREG_OPTIONS += -concurrency:$(CONCURRENCY)
1N/Aendif
1N/A
1N/A# Some tests annoy me and fail frequently
1N/APROBLEM_LIST=ProblemList.txt
1N/APROBLEM_LISTS=$(PROBLEM_LIST) $(wildcard closed/$(PROBLEM_LIST))
1N/AEXCLUDELIST=$(ABS_TEST_OUTPUT_DIR)/excludelist.txt
1N/A
1N/A# Create exclude list for this platform and arch
1N/Aifdef NO_EXCLUDES
1N/A$(EXCLUDELIST): $(PROBLEM_LISTS) $(TEST_DEPENDENCIES)
1N/A @$(ECHO) "NOTHING_EXCLUDED" > $@
1N/Aelse
1N/A$(EXCLUDELIST): $(PROBLEM_LISTS) $(TEST_DEPENDENCIES)
1N/A @$(RM) $@ $@.temp1 $@.temp2
1N/A @(($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- '$(OS_NAME)-all' ) ;\
1N/A ($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- '$(PLATFORM_OS)' ) ;\
1N/A ($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- '$(OS_NAME)-$(OS_ARCH2)' ) ;\
1N/A ($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- '$(OS_NAME)-$(OS_VERSION)') ;\
1N/A ($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- 'generic-$(OS_ARCH)' ) ;\
1N/A ($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- 'generic-$(OS_ARCH2)' ) ;\
1N/A ($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- 'generic-all' ) ;\
1N/A ($(ECHO) "#") ;\
1N/A ) | $(SED) -e 's@^[\ ]*@@' \
1N/A | $(EGREP) -v '^#' > $@.temp1
1N/A for tdir in $(TESTDIRS) SOLARIS_10_SH_BUG_NO_EMPTY_FORS ; do \
1N/A ( ( $(CAT) $@.temp1 | $(EGREP) "^$${tdir}" ) ; $(ECHO) "#" ) >> $@.temp2 ; \
1N/A done
1N/A @$(ECHO) "# at least one line" >> $@.temp2
1N/A @( $(EGREP) -v '^#' $@.temp2 ; true ) > $@
1N/A @$(ECHO) "Excluding list contains `$(EXPAND) $@ | $(WC) -l` items"
1N/Aendif
1N/A
1N/A# Select list of directories that exist
1N/Adefine TestDirs
1N/A$(foreach i,$1,$(wildcard ${i})) $(foreach i,$1,$(wildcard closed/${i}))
1N/Aendef
1N/A# Running batches of tests with or without agentvm
1N/Adefine RunAgentvmBatch
1N/A$(ECHO) "Running tests in agentvm mode: $?"
1N/A$(MAKE) TEST_DEPENDENCIES="$?" TESTDIRS="$?" USE_JTREG_AGENTVM=true UNIQUE_DIR=$@ jtreg_tests
1N/Aendef
1N/Adefine RunOthervmBatch
1N/A$(ECHO) "Running tests in othervm mode: $?"
1N/A$(MAKE) TEST_DEPENDENCIES="$?" TESTDIRS="$?" USE_JTREG_AGENTVM=false UNIQUE_DIR=$@ jtreg_tests
1N/Aendef
1N/Adefine SummaryInfo
1N/A$(ECHO) "########################################################"
1N/A$(CAT) $(?:%=$(ABS_TEST_OUTPUT_DIR)/%/$(STATS_TXT_NAME))
1N/A$(ECHO) "########################################################"
1N/Aendef
1N/A
1N/A# ------------------------------------------------------------------
1N/A
1N/A# Batches of tests (somewhat arbitrary assigments to jdk_* targets)
1N/AJDK_ALL_TARGETS =
1N/A
1N/A# Stable othervm testruns (minus items from PROBLEM_LIST)
1N/A# Using samevm has problems, and doesn't help performance as much as others.
1N/AJDK_ALL_TARGETS += jdk_awt
1N/Ajdk_awt: $(call TestDirs, com/sun/awt java/awt sun/awt \
1N/A javax/imageio javax/print sun/pisces)
1N/A $(call RunOthervmBatch)
1N/A
1N/A# Stable samevm testruns (minus items from PROBLEM_LIST)
1N/AJDK_ALL_TARGETS += jdk_beans1
1N/Ajdk_beans1: $(call TestDirs, \
1N/A java/beans/beancontext java/beans/PropertyChangeSupport \
1N/A java/beans/Introspector java/beans/Performance \
1N/A java/beans/VetoableChangeSupport java/beans/Statement)
1N/A $(call RunAgentvmBatch)
1N/A
1N/A# Stable othervm testruns (minus items from PROBLEM_LIST)
1N/A# Using samevm has serious problems with these tests
1N/AJDK_ALL_TARGETS += jdk_beans2
1N/Ajdk_beans2: $(call TestDirs, \
1N/A java/beans/Beans java/beans/EventHandler java/beans/XMLDecoder \
1N/A java/beans/PropertyEditor)
1N/A $(call RunOthervmBatch)
1N/A
1N/A# Stable othervm testruns (minus items from PROBLEM_LIST)
1N/A# Using agentvm has serious problems with these tests
1N/AJDK_ALL_TARGETS += jdk_beans3
1N/Ajdk_beans3: $(call TestDirs, java/beans/XMLEncoder)
1N/A $(call RunOthervmBatch)
1N/A
1N/A# All beans tests
1N/Ajdk_beans: jdk_beans1 jdk_beans2 jdk_beans3
1N/A @$(SummaryInfo)
1N/A
1N/A# Stable agentvm testruns (minus items from PROBLEM_LIST)
1N/AJDK_ALL_TARGETS += jdk_io
1N/Ajdk_io: $(call TestDirs, java/io)
1N/A $(call RunAgentvmBatch)
1N/A
1N/A# Stable othervm testruns (minus items from PROBLEM_LIST)
1N/A# Using agentvm has serious problems with these tests
1N/Aifdef OPENJDK
1N/Ajdk_jfr:
1N/Aelse
1N/AJDK_ALL_TARGETS += jdk_jfr
1N/Ajdk_jfr: $(call TestDirs, com/oracle/jfr)
1N/A $(call RunOthervmBatch)
1N/Aendif
1N/A
1N/A# Stable agentvm testruns (minus items from PROBLEM_LIST)
1N/AJDK_ALL_TARGETS += jdk_lang
1N/Ajdk_lang: $(call TestDirs, java/lang sun/invoke sun/misc vm)
1N/A $(call RunAgentvmBatch)
1N/A
1N/A# Stable othervm testruns (minus items from PROBLEM_LIST)
1N/A# Using agentvm has serious problems with these tests
1N/AJDK_ALL_TARGETS += jdk_jmx
1N/Ajdk_jmx: $(call TestDirs, javax/management com/sun/jmx)
1N/A $(call RunOthervmBatch)
1N/A
1N/A# Stable othervm testruns (minus items from PROBLEM_LIST)
1N/A# Using agentvm has serious problems with these tests
1N/AJDK_ALL_TARGETS += jdk_management
1N/Ajdk_management: $(call TestDirs, com/sun/management sun/management)
1N/A $(call RunOthervmBatch)
1N/A
1N/A# Stable samevm testruns (minus items from PROBLEM_LIST)
1N/AJDK_ALL_TARGETS += jdk_math
1N/Ajdk_math: $(call TestDirs, java/math)
1N/A $(call RunAgentvmBatch)
# Stable samevm testruns (minus items from PROBLEM_LIST)
JDK_ALL_TARGETS += jdk_other
jdk_other: $(call TestDirs, \
demo/jvmti demo/zipfs \
javax/naming com/sun/jndi \
javax/script \
java/sql javax/sql \
javax/smartcardio \
javax/xml/soap \
javax/xml/jaxp \
com/sun/xml \
javax/xml/ws com/sun/internal/ws \
com/sun/org/apache/xerces \
com/sun/corba \
com/sun/tracing \
sun/usagetracker)
$(call RunAgentvmBatch)
# Stable samevm testruns (minus items from PROBLEM_LIST)
JDK_ALL_TARGETS += jdk_net
jdk_net: $(call TestDirs, com/sun/net java/net sun/net com/oracle/net)
$(call RunAgentvmBatch)
# Stable samevm testruns (minus items from PROBLEM_LIST)
jdk_nio: $(call TestDirs, java/nio sun/nio com/oracle/nio)
$(call SharedLibraryPermissions,java/nio/channels)
$(call RunAgentvmBatch)
# Stable samevm testruns (minus items from PROBLEM_LIST)
jdk_sctp: $(call TestDirs, com/sun/nio/sctp)
$(call RunAgentvmBatch)
# Stable othervm testruns (minus items from PROBLEM_LIST)
# Using samevm has serious problems with these tests
JDK_ALL_TARGETS += jdk_rmi
jdk_rmi: $(call TestDirs, java/rmi sun/rmi javax/rmi/ssl)
$(call RunOthervmBatch)
# Stable samevm testruns (minus items from PROBLEM_LIST)
JDK_ALL_TARGETS += jdk_security1
jdk_security1: $(call TestDirs, java/security)
$(call RunAgentvmBatch)
# Stable othervm testruns (minus items from PROBLEM_LIST)
# Using samevm has serious problems with these tests
JDK_ALL_TARGETS += jdk_security2
jdk_security2: $(call TestDirs, javax/crypto com/sun/crypto)
$(call RunAgentvmBatch)
# Stable othervm testruns (minus items from PROBLEM_LIST)
# Using samevm has serious problems with these tests
JDK_ALL_TARGETS += jdk_security3
jdk_security3: $(call TestDirs, com/sun/security lib/security \
javax/security sun/security \
com/sun/org/apache/xml/internal/security \
com/oracle/security)
$(call SharedLibraryPermissions,sun/security)
$(call RunAgentvmBatch)
# All security tests
jdk_security: jdk_security1 jdk_security2 jdk_security3
@$(SummaryInfo)
# Stable samevm testruns (minus items from PROBLEM_LIST)
JDK_ALL_TARGETS += jdk_sound
jdk_sound: $(call TestDirs, javax/sound)
$(call RunAgentvmBatch)
# Stable othervm testruns (minus items from PROBLEM_LIST)
# Using samevm has problems, and doesn't help performance as much as others.
JDK_ALL_TARGETS += jdk_swing
jdk_swing: $(call TestDirs, javax/swing sun/java2d \
demo/jfc com/sun/java/swing)
$(call RunOthervmBatch)
# Stable samevm testruns (minus items from PROBLEM_LIST)
JDK_ALL_TARGETS += jdk_text
jdk_text: $(call TestDirs, java/text sun/text)
$(call RunAgentvmBatch)
# Stable samevm testruns (minus items from PROBLEM_LIST)
JDK_ALL_TARGETS += jdk_jdi
jdk_jdi: $(call TestDirs, com/sun/jdi)
$(call RunAgentvmBatch)
# Stable othervm testruns (minus items from PROBLEM_LIST)
# Using samevm has serious problems with these tests
JDK_ALL_TARGETS += jdk_tools
jdk_tools: $(call TestDirs, \
com/sun/tools sun/jvmstat sun/tools tools \
com/sun/tracing)
$(call SharedLibraryPermissions,tools/launcher)
$(call RunAgentvmBatch)
# Stable samevm testruns (minus items from PROBLEM_LIST)
JDK_ALL_TARGETS += jdk_util
jdk_util: $(call TestDirs, java/util sun/util)
$(call RunAgentvmBatch)
# ------------------------------------------------------------------
# Run all tests
FILTER_OUT_LIST=jdk_awt jdk_rmi jdk_swing
JDK_ALL_STABLE_TARGETS := $(filter-out $(FILTER_OUT_LIST), $(JDK_ALL_TARGETS))
jdk_all: $(JDK_ALL_STABLE_TARGETS)
@$(SummaryInfo)
# These are all phony targets
PHONY_LIST += $(JDK_ALL_TARGETS)
# ------------------------------------------------------------------
# Default JTREG to run (win32 script works for everybody)
JTREG = $(JT_HOME)/win32/bin/jtreg
# Add any extra options (agentvm etc.)
JTREG_BASIC_OPTIONS += $(EXTRA_JTREG_OPTIONS)
# Only run automatic tests
JTREG_BASIC_OPTIONS += -a
# Always turn on assertions
JTREG_ASSERT_OPTION = -ea -esa
JTREG_BASIC_OPTIONS += $(JTREG_ASSERT_OPTION)
# Report details on all failed or error tests, times too
JTREG_BASIC_OPTIONS += -v:fail,error,time
# 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)
# Multiple by 4 the timeout numbers
JTREG_TIMEOUT_OPTION = -timeoutFactor:4
JTREG_BASIC_OPTIONS += $(JTREG_TIMEOUT_OPTION)
# Boost the max memory for jtreg to avoid gc thrashing
JTREG_MEMORY_OPTION = -J-Xmx512m
JTREG_BASIC_OPTIONS += $(JTREG_MEMORY_OPTION)
# Make sure jtreg exists
$(JTREG): $(JT_HOME)
# Run jtreg
jtreg_tests: prep $(PRODUCT_HOME) $(JTREG) $(EXCLUDELIST)
@$(EXPAND) $(EXCLUDELIST) \
| $(CUT) -d' ' -f1 \
| $(SED) -e 's@^@Excluding: @'
( \
( 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)") \
-exclude:$(shell $(GETMIXEDPATH) "$(EXCLUDELIST)") \
$(JTREG_TEST_OPTIONS) \
$(TESTDIRS) \
) ; $(BUNDLE_UP_AND_EXIT) \
) 2>&1 | $(TEE) $(ABS_TEST_OUTPUT_DIR)/output.txt ; $(TESTEXIT)
# Rule that may 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.
# Used on select directories and applying the chmod to all shared libraries
# not just dll files. On windows, this may not work with MKS if the files
# were installed with CYGWIN unzip or untar (MKS chmod may not do anything).
# And with CYGWIN and sshd service, you may need CYGWIN=ntsec for this to work.
#
shared_library_permissions: $(SHARED_LIBRARY_DIR)
if [ ! -d $(TEST_ROOT)/../.hg ] ; then \
$(FIND) $< \( -name \*.dll -o -name \*.DLL -o -name \*.so \) \
-exec $(CHMOD) a+rx {} \; ; \
fi
PHONY_LIST += jtreg_tests shared_library_permissions
################################################################
# packtest
# Expect JPRT to set JPRT_PACKTEST_HOME.
PACKTEST_HOME = /net/jprt-web.sfbay.sun.com/jprt/allproducts/packtest
ifdef JPRT_PACKTEST_HOME
PACKTEST_HOME = $(JPRT_PACKTEST_HOME)
endif
packtest: prep $(PACKTEST_HOME)/ptest $(PRODUCT_HOME)
( $(CD) $(PACKTEST_HOME) && \
$(PACKTEST_HOME)/ptest \
-t "$(PRODUCT_HOME)" \
$(PACKTEST_STRESS_OPTION) \
$(EXTRA_PACKTEST_OPTIONS) \
-W $(ABS_TEST_OUTPUT_DIR) \
$(JAVA_ARGS:%=-J %) \
$(JAVA_VM_ARGS:%=-J %) \
) ; $(BUNDLE_UP_AND_EXIT)
packtest_stress: PACKTEST_STRESS_OPTION=-s
packtest_stress: packtest
PHONY_LIST += packtest packtest_stress
################################################################
# perftest to collect statistics
# Expect JPRT to set JPRT_PACKTEST_HOME.
PERFTEST_HOME = $(TEST_ROOT)/perf
ifdef JPRT_PERFTEST_HOME
PERFTEST_HOME = $(JPRT_PERFTEST_HOME)
endif
perftest: ( $(PERFTEST_HOME)/perftest \
-t $(shell $(GETMIXEDPATH) "$(PRODUCT_HOME)") \
-w $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)") \
-h $(PERFTEST_HOME) \
) ; $(BUNDLE_UP_AND_EXIT)
PHONY_LIST += perftest
################################################################
# vmsqe tests
# Expect JPRT to set JPRT_VMSQE_HOME.
VMSQE_HOME = $(SLASH_JAVA)/sqe/comp/vm/testbase/sqe/vm/current/build/latest/vm
ifdef JPRT_VMSQE_HOME
VMSQE_HOME = $(JPRT_VMSQE_HOME)
endif
# Expect JPRT to set JPRT_RUNVMSQE_HOME.
RUNVMSQE_HOME = /net/jprt-web.sfbay.sun.com/jprt/allproducts/runvmsqe
ifdef JPRT_RUNVMSQE_HOME
RUNVMSQE_HOME = $(JPRT_RUNVMSQE_HOME)
endif
# Expect JPRT to set JPRT_TONGA3_HOME.
TONGA3_HOME = $(SLASH_JAVA)/sqe/tools/gtee/harness/tonga
ifdef JPRT_TONGA3_HOME
TONGA3_HOME = $(JPRT_TONGA3_HOME)
endif
RUNVMSQE_BIN = $(RUNVMSQE_HOME)/bin/runvmsqe
vmsqe_tests: prep $(VMSQE_HOME)/vm $(TONGA3_HOME) $(RUNVMSQE_BIN) $(PRODUCT_HOME)
$(RM) -r $(ABS_TEST_OUTPUT_DIR)/vmsqe
( $(CD) $(ABS_TEST_OUTPUT_DIR) && \
$(RUNVMSQE_BIN) \
-jdk "$(PRODUCT_HOME)" \
-o "$(ABS_TEST_OUTPUT_DIR)/vmsqe" \
-testbase "$(VMSQE_HOME)/vm" \
-tonga "$(TONGA3_HOME)" \
-tongajdk "$(ALT_BOOTDIR)" \
$(JAVA_ARGS) \
$(JAVA_VM_ARGS) \
$(RUNVMSQE_TEST_OPTION) \
$(EXTRA_RUNVMSQE_OPTIONS) \
) ; $(BUNDLE_UP_AND_EXIT)
vmsqe_jdwp: RUNVMSQE_TEST_OPTION=-jdwp
vmsqe_jdwp: vmsqe_tests
vmsqe_jdi: RUNVMSQE_TEST_OPTION=-jdi
vmsqe_jdi: vmsqe_tests
vmsqe_jdb: RUNVMSQE_TEST_OPTION=-jdb
vmsqe_jdb: vmsqe_tests
vmsqe_quick-jdi: RUNVMSQE_TEST_OPTION=-quick-jdi
vmsqe_quick-jdi: vmsqe_tests
vmsqe_sajdi: RUNVMSQE_TEST_OPTION=-sajdi
vmsqe_sajdi: vmsqe_tests
vmsqe_jvmti: RUNVMSQE_TEST_OPTION=-jvmti
vmsqe_jvmti: vmsqe_tests
vmsqe_hprof: RUNVMSQE_TEST_OPTION=-hprof
vmsqe_hprof: vmsqe_tests
vmsqe_monitoring: RUNVMSQE_TEST_OPTION=-monitoring
vmsqe_monitoring: vmsqe_tests
PHONY_LIST += vmsqe_jdwp vmsqe_jdi vmsqe_jdb vmsqe_quick-jdi vmsqe_sajdi \
vmsqe_jvmti vmsqe_hprof vmsqe_monitoring vmsqe_tests
################################################################
# jck tests
# Default is to use jck 7 from /java/re
JCK7_DEFAULT_HOME = $(SLASH_JAVA)/re/jck/7/promoted/latest/binaries
# Expect JPRT to set JPRT_JCK7COMPILER_HOME.
JCK7COMPILER_HOME = $(JCK7_DEFAULT_HOME)/JCK-compiler-7
ifdef JPRT_JCK7COMPILER_HOME
JCK7COMPILER_HOME = $(JPRT_JCK7COMPILER_HOME)/JCK-compiler-7
endif
# Expect JPRT to set JPRT_JCK7RUNTIME_HOME.
JCK7RUNTIME_HOME = $(JCK7_DEFAULT_HOME)/JCK-runtime-7
ifdef JPRT_JCK7RUNTIME_HOME
JCK7RUNTIME_HOME = $(JPRT_JCK7RUNTIME_HOME)/JCK-runtime-7
endif
# Expect JPRT to set JPRT_JCK7DEVTOOLS_HOME.
JCK7DEVTOOLS_HOME = $(JCK7_DEFAULT_HOME)/JCK-devtools-7
ifdef JPRT_JCK7DEVTOOLS_HOME
JCK7DEVTOOLS_HOME = $(JPRT_JCK7DEVTOOLS_HOME)/JCK-devtools-7
endif
# The jtjck.jar utility to use to run the tests
JTJCK_JAR = $(JCK_HOME)/lib/jtjck.jar
JTJCK_JAVA_ARGS = -XX:MaxPermSize=256m -Xmx512m
JTJCK_OPTIONS = -headless -v
# Default tests to run
ifndef JCK_COMPILER_TESTS
JCK_COMPILER_TESTS =
endif
ifndef JCK_RUNTIME_TESTS
JCK_RUNTIME_TESTS =
endif
ifndef JCK_DEVTOOLS_TESTS
JCK_DEVTOOLS_TESTS =
endif
# Generic rule used to run jck tests
_generic_jck_tests: prep $(PRODUCT_HOME) $(EXCLUDELIST)
@$(EXPAND) $(EXCLUDELIST) \
| $(CUT) -d' ' -f1 \
| $(SED) -e 's@^@Excluding: @'
( $(CD) $(ABS_TEST_OUTPUT_DIR) && \
$(PRODUCT_HOME)/bin/java $(JTJCK_JAVA_ARGS) \
-jar "$(JTJCK_JAR)" \
$(JTJCK_OPTIONS) \
-r:$(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/JTreport \
-w:$(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/JTwork \
-jdk:$(shell $(GETMIXEDPATH) "$(PRODUCT_HOME)") \
$(TESTDIRS) \
) ; $(BUNDLE_UP_AND_EXIT)
# JCK7 compiler tests
jck7compiler:
$(MAKE) UNIQUE_DIR=$@ \
JCK_HOME=$(JCK7COMPILER_HOME) \
TESTDIRS="$(JCK_COMPILER_TESTS)" \
_generic_jck_tests
# JCK7 runtime tests
jck7runtime:
$(MAKE) UNIQUE_DIR=$@ \
JCK_HOME=$(JCK7RUNTIME_HOME) \
TESTDIRS="$(JCK_RUNTIME_TESTS)" \
_generic_jck_tests
# JCK7 devtools tests
jck7devtools:
$(MAKE) UNIQUE_DIR=$@ \
JCK_HOME=$(JCK7DEVTOOLS_HOME) \
TESTDIRS="$(JCK_DEVTOOLS_TESTS)" \
_generic_jck_tests
# Run all 3 sets of JCK7 tests
jck_all: jck7runtime jck7devtools jck7compiler
PHONY_LIST += jck_all _generic_jck_tests \
jck7compiler jck7runtime jck7devtools
################################################################
# Phony targets (e.g. these are not filenames)
.PHONY: all clean prep $(PHONY_LIST)
################################################################