Makefile revision 4634
0N/A#
1472N/A# Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved.
0N/A# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A#
0N/A# This code is free software; you can redistribute it and/or modify it
0N/A# under the terms of the GNU General Public License version 2 only, as
0N/A# published by the Free Software Foundation. Oracle designates this
0N/A# particular file as subject to the "Classpath" exception as provided
0N/A# by Oracle in the LICENSE file that accompanied this code.
0N/A#
0N/A# This code is distributed in the hope that it will be useful, but WITHOUT
0N/A# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A# version 2 for more details (a copy is included in the LICENSE file that
0N/A# accompanied this code).
0N/A#
0N/A# You should have received a copy of the GNU General Public License version
0N/A# 2 along with this work; if not, write to the Free Software Foundation,
1472N/A# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
1472N/A#
1472N/A# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
0N/A# or visit www.oracle.com if you need additional information or have any
0N/A# questions.
0N/A#
0N/A
0N/A#
0N/A# Makefile to run various jdk tests
107N/A#
107N/A
107N/A# Empty these to get rid of some default rules
107N/A.SUFFIXES:
107N/A.SUFFIXES: .java
107N/ACO=
107N/AGET=
107N/A
107N/A# Utilities used
107N/AAWK = awk
107N/ACAT = cat
107N/ACD = cd
107N/ACHMOD = chmod
107N/ACP = cp
0N/ACUT = cut
0N/ADIRNAME = dirname
0N/AECHO = echo
0N/AEGREP = egrep
0N/AEXPAND = expand
0N/AFIND = find
0N/AMKDIR = mkdir
0N/APWD = pwd
0N/ASED = sed
0N/ASORT = sort
0N/ATEE = tee
0N/AUNAME = uname
0N/AUNIQ = uniq
0N/AWC = wc
0N/AZIP = zip
0N/A
1349N/A# Get OS name from uname
107N/AUNAME_S := $(shell $(UNAME) -s)
1349N/A
1349N/A# Commands to run on paths to make mixed paths for java on windows
1349N/AGETMIXEDPATH=$(ECHO)
0N/A
0N/A# Location of developer shared files
0N/ASLASH_JAVA = /java
0N/A
107N/A# Platform specific settings
107N/Aifeq ($(UNAME_S), SunOS)
107N/A OS_NAME = solaris
0N/A OS_ARCH := $(shell $(UNAME) -p)
0N/A OS_VERSION := $(shell $(UNAME) -r)
107N/Aendif
0N/Aifeq ($(UNAME_S), Linux)
107N/A OS_NAME = linux
0N/A OS_ARCH := $(shell $(UNAME) -m)
107N/A # Check for unknown arch, try uname -p if uname -m says unknown
0N/A ifeq ($(OS_ARCH),unknown)
107N/A OS_ARCH := $(shell $(UNAME) -p)
0N/A endif
0N/A OS_VERSION := $(shell $(UNAME) -r)
0N/Aendif
0N/Aifeq ($(UNAME_S), Darwin)
0N/A OS_NAME = macosx
0N/A OS_ARCH := $(shell $(UNAME) -m)
0N/A # Check for unknown arch, try uname -p if uname -m says unknown
0N/A ifeq ($(OS_ARCH),unknown)
0N/A OS_ARCH := $(shell $(UNAME) -p)
0N/A endif
0N/A OS_VERSION := $(shell $(UNAME) -r)
0N/Aendif
0N/Aifeq ($(OS_NAME),)
0N/A OS_NAME = windows
0N/A # GNU Make or MKS overrides $(PROCESSOR_ARCHITECTURE) to always
0N/A # return "x86". Use the first word of $(PROCESSOR_IDENTIFIER) instead.
0N/A ifeq ($(PROCESSOR_IDENTIFIER),)
0N/A PROC_ARCH:=$(shell $(UNAME) -m)
0N/A else
0N/A PROC_ARCH:=$(word 1, $(PROCESSOR_IDENTIFIER))
0N/A endif
0N/A OS_ARCH:=$(PROC_ARCH)
0N/A SLASH_JAVA = J:
0N/A EXESUFFIX = .exe
0N/A # These need to be different depending on MKS or CYGWIN
0N/A ifeq ($(findstring cygdrive,$(shell ($(CD) C:/ && $(PWD)))), )
0N/A GETMIXEDPATH = dosname -s
107N/A OS_VERSION := $(shell $(UNAME) -r)
0N/A else
107N/A GETMIXEDPATH = cygpath -m -s
107N/A OS_VERSION := $(shell $(UNAME) -s | $(CUT) -d'-' -f2)
0N/A endif
107N/Aendif
0N/A
0N/A# Only want major and minor numbers from os version
0N/AOS_VERSION := $(shell $(ECHO) "$(OS_VERSION)" | $(CUT) -d'.' -f1,2)
0N/A
107N/A# Name to use for x86_64 arch (historically amd64, but should change someday)
0N/AOS_ARCH_X64_NAME:=amd64
0N/A#OS_ARCH_X64_NAME:=x64
0N/A
0N/A# Alternate arch names (in case this arch is known by a second name)
107N/A# PROBLEM_LISTS may use either name.
107N/AOS_ARCH2-amd64:=x64
107N/A#OS_ARCH2-x64:=amd64
1349N/A
107N/A# Try and use the arch names consistently
107N/AOS_ARCH:=$(patsubst x64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
1349N/AOS_ARCH:=$(patsubst X64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
1349N/AOS_ARCH:=$(patsubst AMD64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
1349N/AOS_ARCH:=$(patsubst amd64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
1349N/AOS_ARCH:=$(patsubst x86_64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
107N/AOS_ARCH:=$(patsubst 86_64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
1349N/AOS_ARCH:=$(patsubst 8664,$(OS_ARCH_X64_NAME),$(OS_ARCH))
107N/AOS_ARCH:=$(patsubst EM64T,$(OS_ARCH_X64_NAME),$(OS_ARCH))
1349N/AOS_ARCH:=$(patsubst em64t,$(OS_ARCH_X64_NAME),$(OS_ARCH))
1349N/AOS_ARCH:=$(patsubst intel64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
0N/AOS_ARCH:=$(patsubst Intel64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
0N/AOS_ARCH:=$(patsubst INTEL64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
107N/AOS_ARCH:=$(patsubst IA64,ia64,$(OS_ARCH))
1349N/AOS_ARCH:=$(patsubst X86,i586,$(OS_ARCH))
1349N/AOS_ARCH:=$(patsubst x86,i586,$(OS_ARCH))
1349N/AOS_ARCH:=$(patsubst i386,i586,$(OS_ARCH))
1349N/AOS_ARCH:=$(patsubst i486,i586,$(OS_ARCH))
1349N/AOS_ARCH:=$(patsubst i686,i586,$(OS_ARCH))
1349N/AOS_ARCH:=$(patsubst 386,i586,$(OS_ARCH))
1349N/AOS_ARCH:=$(patsubst 486,i586,$(OS_ARCH))
1349N/AOS_ARCH:=$(patsubst 586,i586,$(OS_ARCH))
1349N/AOS_ARCH:=$(patsubst 686,i586,$(OS_ARCH))
1349N/A
1349N/A# Default ARCH_DATA_MODEL settings
1349N/AARCH_DATA_MODEL-i586 = 32
1349N/AARCH_DATA_MODEL-$(OS_ARCH_X64_NAME) = 64
1349N/AARCH_DATA_MODEL-ia64 = 64
1349N/AARCH_DATA_MODEL-sparc = 32
1349N/AARCH_DATA_MODEL-sparcv9 = 64
1349N/A
1349N/A# If ARCH_DATA_MODEL is not defined, try and pick a reasonable default
107N/Aifndef ARCH_DATA_MODEL
0N/A ARCH_DATA_MODEL:=$(ARCH_DATA_MODEL-$(OS_ARCH))
0N/Aendif
1349N/Aifndef ARCH_DATA_MODEL
0N/A ARCH_DATA_MODEL=32
0N/Aendif
0N/A
0N/A# Platform directory name
0N/APLATFORM_OS = $(OS_NAME)-$(OS_ARCH)
0N/A
0N/A# Check ARCH_DATA_MODEL, adjust OS_ARCH accordingly on solaris
0N/AARCH_DATA_MODEL_ERROR= \
107N/A ARCH_DATA_MODEL=$(ARCH_DATA_MODEL) cannot be used with $(PLATFORM_OS)
1349N/Aifeq ($(ARCH_DATA_MODEL),64)
1349N/A ifeq ($(PLATFORM_OS),solaris-i586)
1349N/A OS_ARCH=$(OS_ARCH_X64_NAME)
0N/A endif
0N/A ifeq ($(PLATFORM_OS),solaris-sparc)
0N/A OS_ARCH=sparcv9
0N/A endif
107N/A ifeq ($(OS_ARCH),i586)
107N/A x:=$(warning "WARNING: $(ARCH_DATA_MODEL_ERROR)")
107N/A endif
107N/A ifeq ($(OS_ARCH),sparc)
107N/A x:=$(warning "WARNING: $(ARCH_DATA_MODEL_ERROR)")
107N/A endif
107N/Aelse
107N/A ifeq ($(ARCH_DATA_MODEL),32)
107N/A ifeq ($(OS_ARCH),$(OS_ARCH_X64_NAME))
107N/A x:=$(warning "WARNING: $(ARCH_DATA_MODEL_ERROR)")
107N/A endif
107N/A ifeq ($(OS_ARCH),ia64)
107N/A x:=$(warning "WARNING: $(ARCH_DATA_MODEL_ERROR)")
107N/A endif
107N/A ifeq ($(OS_ARCH),sparcv9)
107N/A x:=$(warning "WARNING: $(ARCH_DATA_MODEL_ERROR)")
107N/A endif
107N/A else
107N/A x:=$(warning "WARNING: $(ARCH_DATA_MODEL_ERROR)")
107N/A endif
107N/Aendif
107N/A
107N/A# Alternate OS_ARCH name (defaults to OS_ARCH)
107N/AOS_ARCH2:=$(OS_ARCH2-$(OS_ARCH))
107N/Aifeq ($(OS_ARCH2),)
107N/A OS_ARCH2:=$(OS_ARCH)
107N/Aendif
107N/A
107N/A# Root of this test area (important to use full paths in some places)
107N/ATEST_ROOT := $(shell $(PWD))
107N/A
107N/A# Root of all test results
107N/Aifdef ALT_OUTPUTDIR
107N/A ABS_OUTPUTDIR = $(ALT_OUTPUTDIR)
107N/Aelse
107N/A ABS_OUTPUTDIR = $(TEST_ROOT)/../build/$(PLATFORM_OS)
107N/Aendif
107N/AABS_PLATFORM_BUILD_ROOT = $(ABS_OUTPUTDIR)
107N/AABS_TEST_OUTPUT_DIR := $(ABS_PLATFORM_BUILD_ROOT)/testoutput/$(UNIQUE_DIR)
107N/A
107N/A# Expect JPRT to set PRODUCT_HOME (the product or jdk in this case to test)
107N/Aifndef PRODUCT_HOME
107N/A # Try to use j2sdk-image if it exists
107N/A ABS_JDK_IMAGE = $(ABS_PLATFORM_BUILD_ROOT)/j2sdk-image
0N/A PRODUCT_HOME := \
107N/A $(shell \
0N/A if [ -d $(ABS_JDK_IMAGE) ] ; then \
0N/A $(ECHO) "$(ABS_JDK_IMAGE)"; \
0N/A else \
0N/A $(ECHO) "$(ABS_PLATFORM_BUILD_ROOT)"; \
107N/A fi)
107N/A PRODUCT_HOME := $(PRODUCT_HOME)
107N/Aendif
107N/A
107N/A# Expect JPRT to set JPRT_PRODUCT_ARGS (e.g. -server etc.)
107N/A# Should be passed into 'java' only.
107N/A# Could include: -d64 -server -client OR any java option
107N/Aifdef JPRT_PRODUCT_ARGS
107N/A JAVA_ARGS = $(JPRT_PRODUCT_ARGS)
107N/Aendif
107N/A
0N/A# Expect JPRT to set JPRT_PRODUCT_VM_ARGS (e.g. -Xcomp etc.)
107N/A# Should be passed into anything running the vm (java, javac, javadoc, ...).
107N/Aifdef JPRT_PRODUCT_VM_ARGS
107N/A JAVA_VM_ARGS = $(JPRT_PRODUCT_VM_ARGS)
107N/Aendif
107N/A
107N/A# Check JAVA_ARGS arguments based on ARCH_DATA_MODEL etc.
107N/Aifeq ($(OS_NAME),solaris)
107N/A D64_ERROR_MESSAGE=Mismatch between ARCH_DATA_MODEL=$(ARCH_DATA_MODEL) and use of -d64 in JAVA_ARGS=$(JAVA_ARGS)
107N/A ifeq ($(ARCH_DATA_MODEL),32)
107N/A ifneq ($(findstring -d64,$(JAVA_ARGS)),)
107N/A x:=$(warning "WARNING: $(D64_ERROR_MESSAGE)")
107N/A endif
107N/A endif
107N/A ifeq ($(ARCH_DATA_MODEL),64)
107N/A ifeq ($(findstring -d64,$(JAVA_ARGS)),)
107N/A x:=$(warning "WARNING: $(D64_ERROR_MESSAGE)")
107N/A endif
107N/A endif
107N/Aendif
0N/A
107N/A# Macro to run make and set the shared library permissions
107N/Adefine SharedLibraryPermissions
107N/A$(MAKE) SHARED_LIBRARY_DIR=$1 UNIQUE_DIR=$@ shared_library_permissions
107N/Aendef
107N/A
107N/A# Expect JPRT to set JPRT_ARCHIVE_BUNDLE (path to zip bundle for results)
107N/AARCHIVE_BUNDLE = $(ABS_TEST_OUTPUT_DIR)/ARCHIVE_BUNDLE.zip
107N/Aifdef JPRT_ARCHIVE_BUNDLE
107N/A ARCHIVE_BUNDLE = $(JPRT_ARCHIVE_BUNDLE)
107N/Aendif
107N/A
107N/A# How to create the test bundle (pass or fail, we want to create this)
107N/A# Follow command with ";$(BUNDLE_UP_AND_EXIT)", so it always gets executed.
107N/AZIP_UP_RESULTS = ( $(MKDIR) -p `$(DIRNAME) $(ARCHIVE_BUNDLE)` \
107N/A && $(CD) $(ABS_TEST_OUTPUT_DIR) \
107N/A && $(CHMOD) -R a+r . \
107N/A && $(ZIP) -q -r $(ARCHIVE_BUNDLE) . )
107N/ASUMMARY_TXT = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/JTreport/text/summary.txt
107N/ASTATS_TXT_NAME = Stats.txt
107N/ASTATS_TXT = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/$(STATS_TXT_NAME)
0N/ARUNLIST = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/runlist.txt
0N/APASSLIST = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/passlist.txt
107N/AFAILLIST = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/faillist.txt
107N/AEXITCODE = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/exitcode.txt
0N/A
0N/ATESTEXIT = \
107N/A if [ ! -s $(EXITCODE) ] ; then \
0N/A $(ECHO) "ERROR: EXITCODE file not filled in."; \
0N/A $(ECHO) "1" > $(EXITCODE); \
0N/A fi ; \
107N/A testExitCode=`$(CAT) $(EXITCODE)`; \
107N/A $(ECHO) "EXIT CODE: $${testExitCode}"; \
107N/A exit $${testExitCode}
107N/A
107N/ABUNDLE_UP_AND_EXIT = \
0N/A( \
107N/A jtregExitCode=$$? && \
107N/A _summary="$(SUMMARY_TXT)"; \
107N/A $(RM) -f $(STATS_TXT) $(RUNLIST) $(PASSLIST) $(FAILLIST) $(EXITCODE); \
107N/A $(ECHO) "$${jtregExitCode}" > $(EXITCODE); \
107N/A if [ -r "$${_summary}" ] ; then \
0N/A $(ECHO) "Summary: $(UNIQUE_DIR)" > $(STATS_TXT); \
107N/A $(EXPAND) $${_summary} | $(EGREP) -v ' Not run\.' > $(RUNLIST); \
107N/A $(EGREP) ' Passed\.' $(RUNLIST) \
0N/A | $(EGREP) -v ' Error\.' \
0N/A | $(EGREP) -v ' Failed\.' > $(PASSLIST); \
107N/A ( $(EGREP) ' Failed\.' $(RUNLIST); \
107N/A $(EGREP) ' Error\.' $(RUNLIST); \
107N/A $(EGREP) -v ' Passed\.' $(RUNLIST) ) \
107N/A | $(SORT) | $(UNIQ) > $(FAILLIST); \
0N/A if [ $${jtregExitCode} != 0 -o -s $(FAILLIST) ] ; then \
107N/A $(EXPAND) $(FAILLIST) \
107N/A | $(CUT) -d' ' -f1 \
107N/A | $(SED) -e 's@^@FAILED: @' >> $(STATS_TXT); \
107N/A if [ $${jtregExitCode} = 0 ] ; then \
107N/A jtregExitCode=1; \
107N/A fi; \
0N/A fi; \
107N/A runc="`$(CAT) $(RUNLIST) | $(WC) -l | $(AWK) '{print $$1;}'`"; \
107N/A passc="`$(CAT) $(PASSLIST) | $(WC) -l | $(AWK) '{print $$1;}'`"; \
107N/A failc="`$(CAT) $(FAILLIST) | $(WC) -l | $(AWK) '{print $$1;}'`"; \
107N/A exclc="`$(CAT) $(EXCLUDELIST) | $(WC) -l | $(AWK) '{print $$1;}'`"; \
107N/A $(ECHO) "TEST STATS: name=$(UNIQUE_DIR) run=$${runc} pass=$${passc} fail=$${failc} excluded=$${exclc}" \
0N/A >> $(STATS_TXT); \
107N/A else \
107N/A $(ECHO) "Missing file: $${_summary}" >> $(STATS_TXT); \
107N/A fi; \
0N/A if [ -f $(STATS_TXT) ] ; then \
1349N/A $(CAT) $(STATS_TXT); \
0N/A fi; \
107N/A $(ZIP_UP_RESULTS) ; \
0N/A $(TESTEXIT) \
107N/A)
107N/A
0N/A################################################################
1349N/A
1349N/A# Default make rule (runs jtreg_tests)
107N/Aall: jtreg_tests
107N/A @$(ECHO) "Testing completed successfully"
107N/A
107N/A# Prep for output
0N/Aprep: clean
107N/A @$(MKDIR) -p $(ABS_TEST_OUTPUT_DIR)
107N/A @$(MKDIR) -p `$(DIRNAME) $(ARCHIVE_BUNDLE)`
0N/A
107N/A# Cleanup
107N/Aclean:
107N/A $(RM) -r $(ABS_TEST_OUTPUT_DIR)
107N/A $(RM) $(ARCHIVE_BUNDLE)
107N/A
107N/A################################################################
0N/A
0N/A# jtreg tests
107N/A
107N/A# Expect JT_HOME to be set for jtreg tests. (home for jtreg)
0N/Aifndef JT_HOME
0N/A JT_HOME = $(SLASH_JAVA)/re/jtreg/4.0/promoted/latest/binaries/jtreg
0N/A ifdef JPRT_JTREG_HOME
0N/A JT_HOME = $(JPRT_JTREG_HOME)
0N/A endif
0N/Aendif
0N/A
0N/A# Expect JPRT to set TESTDIRS to the jtreg test dirs
0N/Aifndef TESTDIRS
0N/A TESTDIRS = demo
0N/Aendif
0N/A
0N/A# Samevm settings (default is false)
0N/Aifndef USE_JTREG_SAMEVM
0N/A USE_JTREG_SAMEVM=false
0N/Aendif
0N/A# With samevm, you cannot use -javaoptions?
107N/Aifeq ($(USE_JTREG_SAMEVM),true)
107N/A JTREG_SAMEVM_OPTION = -samevm
107N/A EXTRA_JTREG_OPTIONS += $(JTREG_SAMEVM_OPTION) $(JAVA_ARGS) $(JAVA_ARGS:%=-vmoption:%)
0N/A JTREG_TEST_OPTIONS = $(JAVA_VM_ARGS:%=-vmoption:%)
0N/Aelse
107N/A JTREG_TEST_OPTIONS = $(JAVA_ARGS:%=-javaoptions:%) $(JAVA_VM_ARGS:%=-vmoption:%)
0N/Aendif
0N/A
0N/A# Some tests annoy me and fail frequently
0N/APROBLEM_LIST=ProblemList.txt
0N/APROBLEM_LISTS=$(PROBLEM_LIST) $(wildcard closed/$(PROBLEM_LIST))
0N/AEXCLUDELIST=$(ABS_TEST_OUTPUT_DIR)/excludelist.txt
0N/A
107N/A# Create exclude list for this platform and arch
107N/Aifdef NO_EXCLUDES
107N/A$(EXCLUDELIST): $(PROBLEM_LISTS) $(TEST_DEPENDENCIES)
107N/A @$(ECHO) "NOTHING_EXCLUDED" > $@
107N/Aelse
107N/A$(EXCLUDELIST): $(PROBLEM_LISTS) $(TEST_DEPENDENCIES)
0N/A @$(RM) $@ $@.temp1 $@.temp2
0N/A @(($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- '$(OS_NAME)-all' ) ;\
0N/A ($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- '$(PLATFORM_OS)' ) ;\
107N/A ($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- '$(OS_NAME)-$(OS_ARCH2)' ) ;\
107N/A ($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- '$(OS_NAME)-$(OS_VERSION)') ;\
107N/A ($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- 'generic-$(OS_ARCH)' ) ;\
107N/A ($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- 'generic-$(OS_ARCH2)' ) ;\
107N/A ($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- 'generic-all' ) ;\
107N/A ($(ECHO) "#") ;\
107N/A ) | $(SED) -e 's@^[\ ]*@@' \
107N/A | $(EGREP) -v '^#' > $@.temp1
0N/A for tdir in $(TESTDIRS) SOLARIS_10_SH_BUG_NO_EMPTY_FORS ; do \
0N/A ( ( $(CAT) $@.temp1 | $(EGREP) "^$${tdir}" ) ; $(ECHO) "#" ) >> $@.temp2 ; \
0N/A done
107N/A @$(ECHO) "# at least one line" >> $@.temp2
107N/A @( $(EGREP) -v '^#' $@.temp2 ; true ) > $@
107N/A @$(ECHO) "Excluding list contains `$(EXPAND) $@ | $(WC) -l` items"
107N/Aendif
107N/A
107N/A# Select list of directories that exist
107N/Adefine TestDirs
107N/A$(foreach i,$1,$(wildcard ${i})) $(foreach i,$1,$(wildcard closed/${i}))
107N/Aendef
107N/A# Running batches of tests with or without samevm
107N/Adefine RunSamevmBatch
107N/A$(ECHO) "Running tests in samevm mode: $?"
107N/A$(MAKE) TEST_DEPENDENCIES="$?" TESTDIRS="$?" USE_JTREG_SAMEVM=true UNIQUE_DIR=$@ jtreg_tests
107N/Aendef
107N/Adefine RunOthervmBatch
107N/A$(ECHO) "Running tests in othervm mode: $?"
107N/A$(MAKE) TEST_DEPENDENCIES="$?" TESTDIRS="$?" USE_JTREG_SAMEVM=false UNIQUE_DIR=$@ jtreg_tests
107N/Aendef
107N/Adefine SummaryInfo
107N/A$(ECHO) "########################################################"
107N/A$(CAT) $(?:%=$(ABS_TEST_OUTPUT_DIR)/%/$(STATS_TXT_NAME))
107N/A$(ECHO) "########################################################"
107N/Aendef
107N/A
107N/A# ------------------------------------------------------------------
0N/A
0N/A# Batches of tests (somewhat arbitrary assigments to jdk_* targets)
0N/AJDK_ALL_TARGETS =
0N/A
0N/A# Stable othervm testruns (minus items from PROBLEM_LIST)
0N/A# Using samevm has problems, and doesn't help performance as much as others.
0N/AJDK_ALL_TARGETS += jdk_awt
0N/Ajdk_awt: $(call TestDirs, com/sun/awt java/awt sun/awt)
0N/A $(call RunOthervmBatch)
0N/A
0N/A# Stable samevm testruns (minus items from PROBLEM_LIST)
0N/AJDK_ALL_TARGETS += jdk_beans1
0N/Ajdk_beans1: $(call TestDirs, \
107N/A java/beans/beancontext java/beans/PropertyChangeSupport \
0N/A java/beans/Introspector java/beans/Performance \
0N/A java/beans/VetoableChangeSupport java/beans/Statement)
0N/A $(call RunSamevmBatch)
0N/A
0N/A# Stable othervm testruns (minus items from PROBLEM_LIST)
0N/A# Using samevm has serious problems with these tests
0N/AJDK_ALL_TARGETS += jdk_beans2
0N/Ajdk_beans2: $(call TestDirs, \
0N/A java/beans/Beans java/beans/EventHandler java/beans/XMLDecoder \
0N/A java/beans/PropertyEditor)
0N/A $(call RunOthervmBatch)
0N/A
0N/A# Stable othervm testruns (minus items from PROBLEM_LIST)
0N/A# Using samevm has serious problems with these tests
0N/AJDK_ALL_TARGETS += jdk_beans3
0N/Ajdk_beans3: $(call TestDirs, java/beans/XMLEncoder)
0N/A $(call RunOthervmBatch)
0N/A
0N/A# All beans tests
0N/Ajdk_beans: jdk_beans1 jdk_beans2 jdk_beans3
0N/A @$(SummaryInfo)
0N/A
0N/A# Stable samevm testruns (minus items from PROBLEM_LIST)
0N/AJDK_ALL_TARGETS += jdk_io
0N/Ajdk_io: $(call TestDirs, java/io)
0N/A $(call RunSamevmBatch)
0N/A
0N/A# Stable samevm testruns (minus items from PROBLEM_LIST)
0N/AJDK_ALL_TARGETS += jdk_lang
0N/Ajdk_lang: $(call TestDirs, java/lang)
0N/A $(call RunSamevmBatch)
0N/A
0N/A# Stable othervm testruns (minus items from PROBLEM_LIST)
0N/A# Using samevm has serious problems with these tests
0N/AJDK_ALL_TARGETS += jdk_management1
0N/Ajdk_management1: $(call TestDirs, javax/management)
0N/A $(call RunOthervmBatch)
0N/A
0N/A# Stable othervm testruns (minus items from PROBLEM_LIST)
0N/A# Using samevm has serious problems with these tests
0N/AJDK_ALL_TARGETS += jdk_management2
0N/Ajdk_management2: $(call TestDirs, com/sun/jmx com/sun/management sun/management)
0N/A $(call RunOthervmBatch)
0N/A
0N/A# All management tests
0N/Ajdk_management: jdk_management1 jdk_management2
0N/A @$(SummaryInfo)
0N/A
0N/A# Stable samevm testruns (minus items from PROBLEM_LIST)
0N/AJDK_ALL_TARGETS += jdk_math
0N/Ajdk_math: $(call TestDirs, java/math)
0N/A $(call RunSamevmBatch)
0N/A
0N/A# Stable samevm testruns (minus items from PROBLEM_LIST)
0N/AJDK_ALL_TARGETS += jdk_misc
0N/Ajdk_misc: $(call TestDirs, \
0N/A demo javax/imageio javax/naming javax/print javax/script \
0N/A javax/smartcardio javax/sound com/sun/java com/sun/jndi \
0N/A com/sun/org com/sun/xml sun/misc sun/pisces)
0N/A $(call RunSamevmBatch)
0N/A
0N/A# Stable samevm testruns (minus items from PROBLEM_LIST)
0N/AJDK_ALL_TARGETS += jdk_net
0N/Ajdk_net: $(call TestDirs, com/sun/net java/net sun/net)
0N/A $(call RunSamevmBatch)
0N/A
0N/A# Stable samevm testruns (minus items from PROBLEM_LIST)
0N/AJDK_ALL_TARGETS += jdk_nio1
0N/Ajdk_nio1: $(call TestDirs, java/nio/file)
0N/A $(call RunSamevmBatch)
0N/A
107N/A# Stable samevm testruns (minus items from PROBLEM_LIST)
107N/AJDK_ALL_TARGETS += jdk_nio2
107N/Ajdk_nio2: $(call TestDirs, java/nio/Buffer java/nio/ByteOrder \
107N/A java/nio/channels java/nio/MappedByteBuffer)
107N/A $(call SharedLibraryPermissions,java/nio/channels)
0N/A $(call RunSamevmBatch)
0N/A
0N/A# Stable samevm testruns (minus items from PROBLEM_LIST)
0N/AJDK_ALL_TARGETS += jdk_nio3
0N/Ajdk_nio3: $(call TestDirs, sun/nio)
0N/A $(call RunSamevmBatch)
0N/A
0N/A# All nio tests
0N/Ajdk_nio: jdk_nio1 jdk_nio2 jdk_nio3
107N/A @$(SummaryInfo)
0N/A
0N/A# Stable samevm testruns (minus items from PROBLEM_LIST)
107N/Ajdk_sctp: $(call TestDirs, com/sun/nio/sctp)
0N/A $(call RunSamevmBatch)
0N/A
0N/A# Stable othervm testruns (minus items from PROBLEM_LIST)
0N/A# Using samevm has serious problems with these tests
0N/AJDK_ALL_TARGETS += jdk_rmi
0N/Ajdk_rmi: $(call TestDirs, java/rmi javax/rmi sun/rmi)
0N/A $(call RunOthervmBatch)
0N/A
107N/A# Stable samevm testruns (minus items from PROBLEM_LIST)
0N/AJDK_ALL_TARGETS += jdk_security1
0N/Ajdk_security1: $(call TestDirs, java/security)
0N/A $(call RunSamevmBatch)
0N/A
0N/A# Stable othervm testruns (minus items from PROBLEM_LIST)
107N/A# Using samevm has serious problems with these tests
0N/AJDK_ALL_TARGETS += jdk_security2
0N/Ajdk_security2: $(call TestDirs, javax/crypto com/sun/crypto)
0N/A $(call RunOthervmBatch)
0N/A
0N/A# Stable othervm testruns (minus items from PROBLEM_LIST)
0N/A# Using samevm has serious problems with these tests
0N/AJDK_ALL_TARGETS += jdk_security3
107N/Ajdk_security3: $(call TestDirs, com/sun/security lib/security \
0N/A javax/security sun/security)
0N/A $(call SharedLibraryPermissions,sun/security)
0N/A $(call RunOthervmBatch)
0N/A
107N/A# All security tests
0N/Ajdk_security: jdk_security1 jdk_security2 jdk_security3
0N/A @$(SummaryInfo)
0N/A
0N/A# Stable othervm testruns (minus items from PROBLEM_LIST)
0N/A# Using samevm has problems, and doesn't help performance as much as others.
0N/AJDK_ALL_TARGETS += jdk_swing
0N/Ajdk_swing: $(call TestDirs, javax/swing sun/java2d)
0N/A $(call RunOthervmBatch)
0N/A
0N/A# Stable samevm testruns (minus items from PROBLEM_LIST)
0N/AJDK_ALL_TARGETS += jdk_text
0N/Ajdk_text: $(call TestDirs, java/text sun/text)
0N/A $(call RunSamevmBatch)
0N/A
0N/A# Stable samevm testruns (minus items from PROBLEM_LIST)
0N/AJDK_ALL_TARGETS += jdk_tools1
0N/Ajdk_tools1: $(call TestDirs, com/sun/jdi)
0N/A $(call RunSamevmBatch)
0N/A
0N/A# Stable othervm testruns (minus items from PROBLEM_LIST)
0N/A# Using samevm has serious problems with these tests
0N/AJDK_ALL_TARGETS += jdk_tools2
107N/Ajdk_tools2: $(call TestDirs, \
107N/A com/sun/tools sun/jvmstat sun/tools tools vm \
0N/A com/sun/servicetag com/sun/tracing)
107N/A $(call SharedLibraryPermissions,tools/launcher)
0N/A $(call RunSamevmBatch)
107N/A
107N/A# All tools tests
107N/Ajdk_tools: jdk_tools1 jdk_tools2
107N/A @$(SummaryInfo)
107N/A
107N/A# Stable samevm testruns (minus items from PROBLEM_LIST)
107N/AJDK_ALL_TARGETS += jdk_util
107N/Ajdk_util: $(call TestDirs, java/util sun/util)
107N/A $(call RunSamevmBatch)
107N/A
0N/A# ------------------------------------------------------------------
0N/A
0N/A# Run all tests
0N/AFILTER_OUT_LIST=jdk_awt jdk_rmi jdk_swing
0N/AJDK_ALL_STABLE_TARGETS := $(filter-out $(FILTER_OUT_LIST), $(JDK_ALL_TARGETS))
0N/Ajdk_all: $(JDK_ALL_STABLE_TARGETS)
0N/A @$(SummaryInfo)
0N/A
0N/A# These are all phony targets
0N/APHONY_LIST += $(JDK_ALL_TARGETS)
0N/A
107N/A# ------------------------------------------------------------------
0N/A
107N/A# Default JTREG to run (win32 script works for everybody)
0N/AJTREG = $(JT_HOME)/win32/bin/jtreg
0N/A# Add any extra options (samevm etc.)
0N/AJTREG_BASIC_OPTIONS += $(EXTRA_JTREG_OPTIONS)
0N/A# Only run automatic tests
0N/AJTREG_BASIC_OPTIONS += -a
0N/A# Always turn on assertions
107N/AJTREG_ASSERT_OPTION = -ea -esa
0N/AJTREG_BASIC_OPTIONS += $(JTREG_ASSERT_OPTION)
0N/A# Report details on all failed or error tests, times too
0N/AJTREG_BASIC_OPTIONS += -v:fail,error,time
0N/A# Retain all files for failing tests
0N/AJTREG_BASIC_OPTIONS += -retain:fail,error
0N/A# Ignore tests are not run and completely silent about it
0N/AJTREG_IGNORE_OPTION = -ignore:quiet
0N/AJTREG_BASIC_OPTIONS += $(JTREG_IGNORE_OPTION)
0N/A# Multiple by 4 the timeout numbers
0N/AJTREG_TIMEOUT_OPTION = -timeoutFactor:4
0N/AJTREG_BASIC_OPTIONS += $(JTREG_TIMEOUT_OPTION)
0N/A# Boost the max memory for jtreg to avoid gc thrashing
0N/AJTREG_MEMORY_OPTION = -J-Xmx512m
0N/AJTREG_BASIC_OPTIONS += $(JTREG_MEMORY_OPTION)
0N/A
0N/A# Make sure jtreg exists
0N/A$(JTREG): $(JT_HOME)
0N/A
0N/A# Run jtreg
0N/Ajtreg_tests: prep $(PRODUCT_HOME) $(JTREG) $(EXCLUDELIST)
0N/A @$(EXPAND) $(EXCLUDELIST) \
0N/A | $(CUT) -d' ' -f1 \
0N/A | $(SED) -e 's@^@Excluding: @'
0N/A ( \
0N/A ( JT_HOME=$(shell $(GETMIXEDPATH) "$(JT_HOME)"); \
0N/A export JT_HOME; \
0N/A $(shell $(GETMIXEDPATH) "$(JTREG)") \
0N/A $(JTREG_BASIC_OPTIONS) \
0N/A -r:$(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/JTreport \
0N/A -w:$(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/JTwork \
0N/A -jdk:$(shell $(GETMIXEDPATH) "$(PRODUCT_HOME)") \
0N/A -exclude:$(shell $(GETMIXEDPATH) "$(EXCLUDELIST)") \
1409N/A $(JTREG_TEST_OPTIONS) \
0N/A $(TESTDIRS) \
0N/A ) ; $(BUNDLE_UP_AND_EXIT) \
0N/A ) 2>&1 | $(TEE) $(ABS_TEST_OUTPUT_DIR)/output.txt ; $(TESTEXIT)
0N/A
0N/A# 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)
################################################################