Makefile revision 5138
11e9368a226272085c337e9e74b79808c16fbdbaTinderbox User# Copyright (c) 1995, 2012, Oracle and/or its affiliates. All rights reserved.
75c0816e8295e180f4bc7f10db3d0d880383bc1cMark Andrews# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4a14ce5ba00ab7bc55c99ffdcf59c7a4ab902721Automatic Updater# This code is free software; you can redistribute it and/or modify it
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# under the terms of the GNU General Public License version 2 only, as
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# published by the Free Software Foundation. Oracle designates this
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# particular file as subject to the "Classpath" exception as provided
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# by Oracle in the LICENSE file that accompanied this code.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# This code is distributed in the hope that it will be useful, but WITHOUT
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# version 2 for more details (a copy is included in the LICENSE file that
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# accompanied this code).
ea94d370123a5892f6c47a97f21d1b28d44bb168Tinderbox User# You should have received a copy of the GNU General Public License version
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# 2 along with this work; if not, write to the Free Software Foundation,
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
e21a2904f02a03fa06b6db04d348f65fe9c67b2bMark Andrews# or visit www.oracle.com if you need additional information or have any
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Makefile to run various jdk tests
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Empty these to get rid of some default rules
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Utilities used
11e9368a226272085c337e9e74b79808c16fbdbaTinderbox User# Get OS name from uname
11e9368a226272085c337e9e74b79808c16fbdbaTinderbox User# Commands to run on paths to make mixed paths for java on windows
11e9368a226272085c337e9e74b79808c16fbdbaTinderbox User# Location of developer shared files
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Platform specific settings
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein # Check for unknown arch, try uname -p if uname -m says unknown
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein # Check for unknown arch, try uname -p if uname -m says unknown
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein # GNU Make or MKS overrides $(PROCESSOR_ARCHITECTURE) to always
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein # return "x86". Use the first word of $(PROCESSOR_IDENTIFIER) instead.
11e9368a226272085c337e9e74b79808c16fbdbaTinderbox User # These need to be different depending on MKS or CYGWIN
11e9368a226272085c337e9e74b79808c16fbdbaTinderbox User ifeq ($(findstring cygdrive,$(shell ($(CD) C:/ && $(PWD)))), )
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein OS_VERSION := $(shell $(UNAME) -s | $(CUT) -d'-' -f2)
11e9368a226272085c337e9e74b79808c16fbdbaTinderbox User# Only want major and minor numbers from os version
44d0f0256fbdce130a18655023c3b06bacacbd61Automatic UpdaterOS_VERSION := $(shell $(ECHO) "$(OS_VERSION)" | $(CUT) -d'.' -f1,2)
6f64d4ab8e68f9b2333bcbfc755396d29a4a9d7cAutomatic Updater# Name to use for x86_64 arch (historically amd64, but should change someday)
8168c2873909444bdf62325b29fe118a879b22fcTinderbox User#OS_ARCH_X64_NAME:=x64
8168c2873909444bdf62325b29fe118a879b22fcTinderbox User# Alternate arch names (in case this arch is known by a second name)
8168c2873909444bdf62325b29fe118a879b22fcTinderbox User# PROBLEM_LISTS may use either name.
8168c2873909444bdf62325b29fe118a879b22fcTinderbox User#OS_ARCH2-x64:=amd64
8168c2873909444bdf62325b29fe118a879b22fcTinderbox User# Try and use the arch names consistently
8168c2873909444bdf62325b29fe118a879b22fcTinderbox UserOS_ARCH:=$(patsubst x64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
8168c2873909444bdf62325b29fe118a879b22fcTinderbox UserOS_ARCH:=$(patsubst X64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
8168c2873909444bdf62325b29fe118a879b22fcTinderbox UserOS_ARCH:=$(patsubst AMD64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
8168c2873909444bdf62325b29fe118a879b22fcTinderbox UserOS_ARCH:=$(patsubst amd64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
6f64d4ab8e68f9b2333bcbfc755396d29a4a9d7cAutomatic UpdaterOS_ARCH:=$(patsubst x86_64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
44d0f0256fbdce130a18655023c3b06bacacbd61Automatic UpdaterOS_ARCH:=$(patsubst 86_64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
44d0f0256fbdce130a18655023c3b06bacacbd61Automatic UpdaterOS_ARCH:=$(patsubst 8664,$(OS_ARCH_X64_NAME),$(OS_ARCH))
8168c2873909444bdf62325b29fe118a879b22fcTinderbox UserOS_ARCH:=$(patsubst EM64T,$(OS_ARCH_X64_NAME),$(OS_ARCH))
8168c2873909444bdf62325b29fe118a879b22fcTinderbox UserOS_ARCH:=$(patsubst em64t,$(OS_ARCH_X64_NAME),$(OS_ARCH))
bbbf2e27d3a981163dab139497d6b2dc85449db0Tinderbox UserOS_ARCH:=$(patsubst intel64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
bbbf2e27d3a981163dab139497d6b2dc85449db0Tinderbox UserOS_ARCH:=$(patsubst Intel64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
bbbf2e27d3a981163dab139497d6b2dc85449db0Tinderbox UserOS_ARCH:=$(patsubst INTEL64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
8168c2873909444bdf62325b29fe118a879b22fcTinderbox User# Default ARCH_DATA_MODEL settings
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# If ARCH_DATA_MODEL is not defined, try and pick a reasonable default
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Platform directory name
d9184858dd5d7677050a813d444c281c56f697aaTinderbox User# Check ARCH_DATA_MODEL, adjust OS_ARCH accordingly on solaris
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein ARCH_DATA_MODEL=$(ARCH_DATA_MODEL) cannot be used with $(PLATFORM_OS)
d9184858dd5d7677050a813d444c281c56f697aaTinderbox User x:=$(warning "WARNING: $(ARCH_DATA_MODEL_ERROR)")
d9184858dd5d7677050a813d444c281c56f697aaTinderbox User x:=$(warning "WARNING: $(ARCH_DATA_MODEL_ERROR)")
d9184858dd5d7677050a813d444c281c56f697aaTinderbox User x:=$(warning "WARNING: $(ARCH_DATA_MODEL_ERROR)")
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein x:=$(warning "WARNING: $(ARCH_DATA_MODEL_ERROR)")
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein x:=$(warning "WARNING: $(ARCH_DATA_MODEL_ERROR)")
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein x:=$(warning "WARNING: $(ARCH_DATA_MODEL_ERROR)")
44d0f0256fbdce130a18655023c3b06bacacbd61Automatic Updater# Alternate OS_ARCH name (defaults to OS_ARCH)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Root of this test area (important to use full paths in some places)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Root of all test results
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein ABS_OUTPUTDIR = $(TEST_ROOT)/../build/$(PLATFORM_OS)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinABS_TEST_OUTPUT_DIR := $(ABS_PLATFORM_BUILD_ROOT)/testoutput/$(UNIQUE_DIR)
8168c2873909444bdf62325b29fe118a879b22fcTinderbox User# Expect JPRT to set PRODUCT_HOME (the product or jdk in this case to test)
7208386cd37a2092c70eddf80cf29519b16c4c80Mark Andrews # Try to use j2sdk-image if it exists
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein ABS_JDK_IMAGE = $(ABS_PLATFORM_BUILD_ROOT)/j2sdk-image
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Expect JPRT to set JPRT_PRODUCT_ARGS (e.g. -server etc.)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Should be passed into 'java' only.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Could include: -d64 -server -client OR any java option
8168c2873909444bdf62325b29fe118a879b22fcTinderbox User# Expect JPRT to set JPRT_PRODUCT_VM_ARGS (e.g. -Xcomp etc.)
8168c2873909444bdf62325b29fe118a879b22fcTinderbox User# Should be passed into anything running the vm (java, javac, javadoc, ...).
661e7fbf77adb6a251c188dba4aa51c1d6aeffe9Tinderbox User# Check JAVA_ARGS arguments based on ARCH_DATA_MODEL etc.
661e7fbf77adb6a251c188dba4aa51c1d6aeffe9Tinderbox User D64_ERROR_MESSAGE=Mismatch between ARCH_DATA_MODEL=$(ARCH_DATA_MODEL) and use of -d64 in JAVA_ARGS=$(JAVA_ARGS)
661e7fbf77adb6a251c188dba4aa51c1d6aeffe9Tinderbox User x:=$(warning "WARNING: $(D64_ERROR_MESSAGE)")
661e7fbf77adb6a251c188dba4aa51c1d6aeffe9Tinderbox User x:=$(warning "WARNING: $(D64_ERROR_MESSAGE)")
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User# Macro to run make and set the shared library permissions
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein$(MAKE) SHARED_LIBRARY_DIR=$1 UNIQUE_DIR=$@ shared_library_permissions
8168c2873909444bdf62325b29fe118a879b22fcTinderbox User# Expect JPRT to set JPRT_ARCHIVE_BUNDLE (path to zip bundle for results)
44d0f0256fbdce130a18655023c3b06bacacbd61Automatic UpdaterARCHIVE_BUNDLE = $(ABS_TEST_OUTPUT_DIR)/ARCHIVE_BUNDLE.zip
44d0f0256fbdce130a18655023c3b06bacacbd61Automatic Updater# How to create the test bundle (pass or fail, we want to create this)
661e7fbf77adb6a251c188dba4aa51c1d6aeffe9Tinderbox User# Follow command with ";$(BUNDLE_UP_AND_EXIT)", so it always gets executed.
661e7fbf77adb6a251c188dba4aa51c1d6aeffe9Tinderbox UserZIP_UP_RESULTS = ( $(MKDIR) -p `$(DIRNAME) $(ARCHIVE_BUNDLE)` \
661e7fbf77adb6a251c188dba4aa51c1d6aeffe9Tinderbox UserSUMMARY_TXT = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/JTreport/text/summary.txt
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinSTATS_TXT = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/$(STATS_TXT_NAME)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinRUNLIST = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/runlist.txt
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox UserPASSLIST = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/passlist.txt
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsFAILLIST = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/faillist.txt
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsEXITCODE = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/exitcode.txt
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews if [ ! -s $(EXITCODE) ] ; then \
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews $(ECHO) "ERROR: EXITCODE file not filled in."; \
f9aef05653eeb454c489d5bd2bde6daab774ad4aTinderbox User $(RM) -f $(STATS_TXT) $(RUNLIST) $(PASSLIST) $(FAILLIST) $(EXITCODE); \
922312472e2e05ebc64993d465999c5351b83036Automatic Updater $(ECHO) "$${jtregExitCode}" > $(EXITCODE); \
922312472e2e05ebc64993d465999c5351b83036Automatic Updater $(ECHO) "Summary: $(UNIQUE_DIR)" > $(STATS_TXT); \
50066670817cdf9e86c832066d73715232b29680Tinderbox User $(EXPAND) $${_summary} | $(EGREP) -v ' Not run\.' > $(RUNLIST); \
28b3569d6248168e6c00caab951521cc8141a49dAutomatic Updater | $(EGREP) -v ' Failed\.' > $(PASSLIST); \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews if [ $${jtregExitCode} != 0 -o -s $(FAILLIST) ] ; then \
2cbb4ab75757fbb656997a82c14ca07db37d481aAutomatic Updater | $(SED) -e 's@^@FAILED: @' >> $(STATS_TXT); \
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater if [ $${jtregExitCode} = 0 ] ; then \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews runc="`$(CAT) $(RUNLIST) | $(WC) -l | $(AWK) '{print $$1;}'`"; \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews passc="`$(CAT) $(PASSLIST) | $(WC) -l | $(AWK) '{print $$1;}'`"; \
c3dc968140ab7f04795acc7835e4e89ccb0c0a27Tinderbox User failc="`$(CAT) $(FAILLIST) | $(WC) -l | $(AWK) '{print $$1;}'`"; \
c3dc968140ab7f04795acc7835e4e89ccb0c0a27Tinderbox User exclc="`$(CAT) $(EXCLUDELIST) | $(WC) -l | $(AWK) '{print $$1;}'`"; \
c3dc968140ab7f04795acc7835e4e89ccb0c0a27Tinderbox User $(ECHO) "TEST STATS: name=$(UNIQUE_DIR) run=$${runc} pass=$${passc} fail=$${failc} excluded=$${exclc}" \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $(ECHO) "Missing file: $${_summary}" >> $(STATS_TXT); \
e2e4d321999340802f77adaacd19c797d04b4b95Automatic Updater################################################################
b6b8f8a0362da8c749021c4b6376cfb96047912bTinderbox User# Default make rule (runs jtreg_tests)
0c6ada0a814f3c5417daa1654129bc2af56ed504Automatic Updater# Prep for output
9b469e3c59015b1a4899c9d8395168126fe094fdAutomatic Updater################################################################
e2e4d321999340802f77adaacd19c797d04b4b95Automatic Updater# Expect JT_HOME to be set for jtreg tests. (home for jtreg)
e2e4d321999340802f77adaacd19c797d04b4b95Automatic Updater JT_HOME = $(SLASH_JAVA)/re/jtreg/4.1/promoted/latest/binaries/jtreg
e2e4d321999340802f77adaacd19c797d04b4b95Automatic Updater# Expect JPRT to set TESTDIRS to the jtreg test dirs
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Agentvm settings (default is false)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# With agentvm, you cannot use -javaoptions?
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein EXTRA_JTREG_OPTIONS += $(JTREG_AGENTVM_OPTION) $(JAVA_ARGS) $(JAVA_ARGS:%=-vmoption:%)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein JTREG_TEST_OPTIONS = $(JAVA_VM_ARGS:%=-vmoption:%)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein JTREG_TEST_OPTIONS = $(JAVA_ARGS:%=-javaoptions:%) $(JAVA_VM_ARGS:%=-vmoption:%)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein EXTRA_JTREG_OPTIONS += -concurrency:$(CONCURRENCY)
30c0c7470d5bfabd8f43c563f4eca636d06cc484Tinderbox User# Some tests annoy me and fail frequently
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinPROBLEM_LISTS=$(PROBLEM_LIST) $(wildcard closed/$(PROBLEM_LIST))
@$(SummaryInfo)
@$(SummaryInfo)
@$(SummaryInfo)
@$(SummaryInfo)
@$(SummaryInfo)
@$(SummaryInfo)
JTREG_BASIC_OPTIONS += -a
export JT_HOME; \
# The jtjck.jar utility to use to run the tests
# Phony targets (e.g. these are not filenames)