Makefile revision 5138
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein#
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.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein#
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#
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).
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein#
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#
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# questions.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein#
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein#
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Makefile to run various jdk tests
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein#
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Empty these to get rid of some default rules
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein.SUFFIXES:
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein.SUFFIXES: .java
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinCO=
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinGET=
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Utilities used
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinAWK = awk
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinCAT = cat
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinCD = cd
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinCHMOD = chmod
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinCP = cp
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinCUT = cut
5fa6a064b8301e4f274bd132fd577def59e4fb4cTinderbox UserDIRNAME = dirname
5fa6a064b8301e4f274bd132fd577def59e4fb4cTinderbox UserECHO = echo
11e9368a226272085c337e9e74b79808c16fbdbaTinderbox UserEGREP = egrep
75c0816e8295e180f4bc7f10db3d0d880383bc1cMark AndrewsEXPAND = expand
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinFIND = find
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinMKDIR = mkdir
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinPWD = pwd
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinSED = sed
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinSORT = sort
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinTEE = tee
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinUNAME = uname
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinUNIQ = uniq
11e9368a226272085c337e9e74b79808c16fbdbaTinderbox UserWC = wc
11e9368a226272085c337e9e74b79808c16fbdbaTinderbox UserZIP = zip
11e9368a226272085c337e9e74b79808c16fbdbaTinderbox User
11e9368a226272085c337e9e74b79808c16fbdbaTinderbox User# Get OS name from uname
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinUNAME_S := $(shell $(UNAME) -s)
11e9368a226272085c337e9e74b79808c16fbdbaTinderbox User
11e9368a226272085c337e9e74b79808c16fbdbaTinderbox User# Commands to run on paths to make mixed paths for java on windows
11e9368a226272085c337e9e74b79808c16fbdbaTinderbox UserGETMIXEDPATH=$(ECHO)
11e9368a226272085c337e9e74b79808c16fbdbaTinderbox User
11e9368a226272085c337e9e74b79808c16fbdbaTinderbox User# Location of developer shared files
11e9368a226272085c337e9e74b79808c16fbdbaTinderbox UserSLASH_JAVA = /java
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Platform specific settings
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrewsifeq ($(UNAME_S), SunOS)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein OS_NAME = solaris
11e9368a226272085c337e9e74b79808c16fbdbaTinderbox User OS_ARCH := $(shell $(UNAME) -p)
11e9368a226272085c337e9e74b79808c16fbdbaTinderbox User OS_VERSION := $(shell $(UNAME) -r)
11e9368a226272085c337e9e74b79808c16fbdbaTinderbox Userendif
11e9368a226272085c337e9e74b79808c16fbdbaTinderbox Userifeq ($(UNAME_S), Linux)
11e9368a226272085c337e9e74b79808c16fbdbaTinderbox User OS_NAME = linux
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein OS_ARCH := $(shell $(UNAME) -m)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein # Check for unknown arch, try uname -p if uname -m says unknown
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein ifeq ($(OS_ARCH),unknown)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein OS_ARCH := $(shell $(UNAME) -p)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein endif
11e9368a226272085c337e9e74b79808c16fbdbaTinderbox User OS_VERSION := $(shell $(UNAME) -r)
11e9368a226272085c337e9e74b79808c16fbdbaTinderbox Userendif
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinifeq ($(UNAME_S), Darwin)
11e9368a226272085c337e9e74b79808c16fbdbaTinderbox User OS_NAME = macosx
11e9368a226272085c337e9e74b79808c16fbdbaTinderbox User OS_ARCH := $(shell $(UNAME) -m)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein # Check for unknown arch, try uname -p if uname -m says unknown
11e9368a226272085c337e9e74b79808c16fbdbaTinderbox User ifeq ($(OS_ARCH),unknown)
11e9368a226272085c337e9e74b79808c16fbdbaTinderbox User OS_ARCH := $(shell $(UNAME) -p)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein endif
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein OS_VERSION := $(shell $(UNAME) -r)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinendif
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinifeq ($(OS_NAME),)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein OS_NAME = windows
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein # GNU Make or MKS overrides $(PROCESSOR_ARCHITECTURE) to always
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein # return "x86". Use the first word of $(PROCESSOR_IDENTIFIER) instead.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein ifeq ($(PROCESSOR_IDENTIFIER),)
11e9368a226272085c337e9e74b79808c16fbdbaTinderbox User PROC_ARCH:=$(shell $(UNAME) -m)
11e9368a226272085c337e9e74b79808c16fbdbaTinderbox User else
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein PROC_ARCH:=$(word 1, $(PROCESSOR_IDENTIFIER))
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein endif
11e9368a226272085c337e9e74b79808c16fbdbaTinderbox User OS_ARCH:=$(PROC_ARCH)
11e9368a226272085c337e9e74b79808c16fbdbaTinderbox User SLASH_JAVA = J:
11e9368a226272085c337e9e74b79808c16fbdbaTinderbox User EXESUFFIX = .exe
11e9368a226272085c337e9e74b79808c16fbdbaTinderbox User # These need to be different depending on MKS or CYGWIN
11e9368a226272085c337e9e74b79808c16fbdbaTinderbox User ifeq ($(findstring cygdrive,$(shell ($(CD) C:/ && $(PWD)))), )
11e9368a226272085c337e9e74b79808c16fbdbaTinderbox User GETMIXEDPATH = dosname -s
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein OS_VERSION := $(shell $(UNAME) -r)
11e9368a226272085c337e9e74b79808c16fbdbaTinderbox User else
11e9368a226272085c337e9e74b79808c16fbdbaTinderbox User GETMIXEDPATH = cygpath -m -s
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein OS_VERSION := $(shell $(UNAME) -s | $(CUT) -d'-' -f2)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein endif
11e9368a226272085c337e9e74b79808c16fbdbaTinderbox Userendif
11e9368a226272085c337e9e74b79808c16fbdbaTinderbox User
11e9368a226272085c337e9e74b79808c16fbdbaTinderbox User# Only want major and minor numbers from os version
44d0f0256fbdce130a18655023c3b06bacacbd61Automatic UpdaterOS_VERSION := $(shell $(ECHO) "$(OS_VERSION)" | $(CUT) -d'.' -f1,2)
6f64d4ab8e68f9b2333bcbfc755396d29a4a9d7cAutomatic Updater
6f64d4ab8e68f9b2333bcbfc755396d29a4a9d7cAutomatic Updater# Name to use for x86_64 arch (historically amd64, but should change someday)
8168c2873909444bdf62325b29fe118a879b22fcTinderbox UserOS_ARCH_X64_NAME:=amd64
8168c2873909444bdf62325b29fe118a879b22fcTinderbox User#OS_ARCH_X64_NAME:=x64
8168c2873909444bdf62325b29fe118a879b22fcTinderbox User
8168c2873909444bdf62325b29fe118a879b22fcTinderbox User# Alternate arch names (in case this arch is known by a second name)
8168c2873909444bdf62325b29fe118a879b22fcTinderbox User# PROBLEM_LISTS may use either name.
8168c2873909444bdf62325b29fe118a879b22fcTinderbox UserOS_ARCH2-amd64:=x64
8168c2873909444bdf62325b29fe118a879b22fcTinderbox User#OS_ARCH2-x64:=amd64
8168c2873909444bdf62325b29fe118a879b22fcTinderbox User
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 UserOS_ARCH:=$(patsubst IA64,ia64,$(OS_ARCH))
8168c2873909444bdf62325b29fe118a879b22fcTinderbox UserOS_ARCH:=$(patsubst X86,i586,$(OS_ARCH))
8168c2873909444bdf62325b29fe118a879b22fcTinderbox UserOS_ARCH:=$(patsubst x86,i586,$(OS_ARCH))
8168c2873909444bdf62325b29fe118a879b22fcTinderbox UserOS_ARCH:=$(patsubst i386,i586,$(OS_ARCH))
8168c2873909444bdf62325b29fe118a879b22fcTinderbox UserOS_ARCH:=$(patsubst i486,i586,$(OS_ARCH))
8168c2873909444bdf62325b29fe118a879b22fcTinderbox UserOS_ARCH:=$(patsubst i686,i586,$(OS_ARCH))
8168c2873909444bdf62325b29fe118a879b22fcTinderbox UserOS_ARCH:=$(patsubst 386,i586,$(OS_ARCH))
44d0f0256fbdce130a18655023c3b06bacacbd61Automatic UpdaterOS_ARCH:=$(patsubst 486,i586,$(OS_ARCH))
bcf15a19ae0efa72a22cdfb50666a3c6ce39eb9fTinderbox UserOS_ARCH:=$(patsubst 586,i586,$(OS_ARCH))
44d0f0256fbdce130a18655023c3b06bacacbd61Automatic UpdaterOS_ARCH:=$(patsubst 686,i586,$(OS_ARCH))
8168c2873909444bdf62325b29fe118a879b22fcTinderbox User
8168c2873909444bdf62325b29fe118a879b22fcTinderbox User# Default ARCH_DATA_MODEL settings
bcf15a19ae0efa72a22cdfb50666a3c6ce39eb9fTinderbox UserARCH_DATA_MODEL-i586 = 32
11e9368a226272085c337e9e74b79808c16fbdbaTinderbox UserARCH_DATA_MODEL-$(OS_ARCH_X64_NAME) = 64
bcf15a19ae0efa72a22cdfb50666a3c6ce39eb9fTinderbox UserARCH_DATA_MODEL-ia64 = 64
11e9368a226272085c337e9e74b79808c16fbdbaTinderbox UserARCH_DATA_MODEL-sparc = 32
11e9368a226272085c337e9e74b79808c16fbdbaTinderbox UserARCH_DATA_MODEL-sparcv9 = 64
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# If ARCH_DATA_MODEL is not defined, try and pick a reasonable default
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrewsifndef ARCH_DATA_MODEL
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein ARCH_DATA_MODEL:=$(ARCH_DATA_MODEL-$(OS_ARCH))
11e9368a226272085c337e9e74b79808c16fbdbaTinderbox Userendif
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinifndef ARCH_DATA_MODEL
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein ARCH_DATA_MODEL=32
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrewsendif
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Platform directory name
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinPLATFORM_OS = $(OS_NAME)-$(OS_ARCH)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
d9184858dd5d7677050a813d444c281c56f697aaTinderbox User# Check ARCH_DATA_MODEL, adjust OS_ARCH accordingly on solaris
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinARCH_DATA_MODEL_ERROR= \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein ARCH_DATA_MODEL=$(ARCH_DATA_MODEL) cannot be used with $(PLATFORM_OS)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinifeq ($(ARCH_DATA_MODEL),64)
d9184858dd5d7677050a813d444c281c56f697aaTinderbox User ifeq ($(PLATFORM_OS),solaris-i586)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein OS_ARCH=$(OS_ARCH_X64_NAME)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein endif
d9184858dd5d7677050a813d444c281c56f697aaTinderbox User ifeq ($(PLATFORM_OS),solaris-sparc)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein OS_ARCH=sparcv9
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein endif
d9184858dd5d7677050a813d444c281c56f697aaTinderbox User ifeq ($(OS_ARCH),i586)
d9184858dd5d7677050a813d444c281c56f697aaTinderbox User x:=$(warning "WARNING: $(ARCH_DATA_MODEL_ERROR)")
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein endif
d9184858dd5d7677050a813d444c281c56f697aaTinderbox User ifeq ($(OS_ARCH),sparc)
d9184858dd5d7677050a813d444c281c56f697aaTinderbox User x:=$(warning "WARNING: $(ARCH_DATA_MODEL_ERROR)")
d9184858dd5d7677050a813d444c281c56f697aaTinderbox User endif
d9184858dd5d7677050a813d444c281c56f697aaTinderbox Userelse
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein ifeq ($(ARCH_DATA_MODEL),32)
d9184858dd5d7677050a813d444c281c56f697aaTinderbox User ifeq ($(OS_ARCH),$(OS_ARCH_X64_NAME))
d9184858dd5d7677050a813d444c281c56f697aaTinderbox User x:=$(warning "WARNING: $(ARCH_DATA_MODEL_ERROR)")
d9184858dd5d7677050a813d444c281c56f697aaTinderbox User endif
d9184858dd5d7677050a813d444c281c56f697aaTinderbox User ifeq ($(OS_ARCH),ia64)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein x:=$(warning "WARNING: $(ARCH_DATA_MODEL_ERROR)")
d9184858dd5d7677050a813d444c281c56f697aaTinderbox User endif
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein ifeq ($(OS_ARCH),sparcv9)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein x:=$(warning "WARNING: $(ARCH_DATA_MODEL_ERROR)")
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein endif
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein else
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein x:=$(warning "WARNING: $(ARCH_DATA_MODEL_ERROR)")
a1ad6695ed6f988406cf155aa26376f84f73bcb9Automatic Updater endif
8168c2873909444bdf62325b29fe118a879b22fcTinderbox Userendif
a1ad6695ed6f988406cf155aa26376f84f73bcb9Automatic Updater
44d0f0256fbdce130a18655023c3b06bacacbd61Automatic Updater# Alternate OS_ARCH name (defaults to OS_ARCH)
8168c2873909444bdf62325b29fe118a879b22fcTinderbox UserOS_ARCH2:=$(OS_ARCH2-$(OS_ARCH))
2895f101b5585a19015ac2c2c1e1812ac467fa12Automatic Updaterifeq ($(OS_ARCH2),)
8168c2873909444bdf62325b29fe118a879b22fcTinderbox User OS_ARCH2:=$(OS_ARCH)
44d0f0256fbdce130a18655023c3b06bacacbd61Automatic Updaterendif
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Root of this test area (important to use full paths in some places)
8168c2873909444bdf62325b29fe118a879b22fcTinderbox UserTEST_ROOT := $(shell $(PWD))
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Root of all test results
8168c2873909444bdf62325b29fe118a879b22fcTinderbox Userifdef ALT_OUTPUTDIR
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein ABS_OUTPUTDIR = $(ALT_OUTPUTDIR)
8168c2873909444bdf62325b29fe118a879b22fcTinderbox Userelse
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein ABS_OUTPUTDIR = $(TEST_ROOT)/../build/$(PLATFORM_OS)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinendif
8168c2873909444bdf62325b29fe118a879b22fcTinderbox UserABS_PLATFORM_BUILD_ROOT = $(ABS_OUTPUTDIR)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinABS_TEST_OUTPUT_DIR := $(ABS_PLATFORM_BUILD_ROOT)/testoutput/$(UNIQUE_DIR)
8168c2873909444bdf62325b29fe118a879b22fcTinderbox User
8168c2873909444bdf62325b29fe118a879b22fcTinderbox User# Expect JPRT to set PRODUCT_HOME (the product or jdk in this case to test)
8168c2873909444bdf62325b29fe118a879b22fcTinderbox Userifndef PRODUCT_HOME
7208386cd37a2092c70eddf80cf29519b16c4c80Mark Andrews # Try to use j2sdk-image if it exists
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein ABS_JDK_IMAGE = $(ABS_PLATFORM_BUILD_ROOT)/j2sdk-image
507151045be68c671ffd4e2f37e17cdfa0376fc4Automatic Updater PRODUCT_HOME := \
507151045be68c671ffd4e2f37e17cdfa0376fc4Automatic Updater $(shell \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein if [ -d $(ABS_JDK_IMAGE) ] ; then \
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews $(ECHO) "$(ABS_JDK_IMAGE)"; \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein else \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein $(ECHO) "$(ABS_PLATFORM_BUILD_ROOT)"; \
8168c2873909444bdf62325b29fe118a879b22fcTinderbox User fi)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein PRODUCT_HOME := $(PRODUCT_HOME)
8168c2873909444bdf62325b29fe118a879b22fcTinderbox Userendif
8168c2873909444bdf62325b29fe118a879b22fcTinderbox User
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
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinifdef JPRT_PRODUCT_ARGS
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein JAVA_ARGS = $(JPRT_PRODUCT_ARGS)
8168c2873909444bdf62325b29fe118a879b22fcTinderbox Userendif
8168c2873909444bdf62325b29fe118a879b22fcTinderbox User
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, ...).
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinifdef JPRT_PRODUCT_VM_ARGS
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User JAVA_VM_ARGS = $(JPRT_PRODUCT_VM_ARGS)
661e7fbf77adb6a251c188dba4aa51c1d6aeffe9Tinderbox Userendif
661e7fbf77adb6a251c188dba4aa51c1d6aeffe9Tinderbox User
661e7fbf77adb6a251c188dba4aa51c1d6aeffe9Tinderbox User# Check JAVA_ARGS arguments based on ARCH_DATA_MODEL etc.
661e7fbf77adb6a251c188dba4aa51c1d6aeffe9Tinderbox Userifeq ($(OS_NAME),solaris)
661e7fbf77adb6a251c188dba4aa51c1d6aeffe9Tinderbox User D64_ERROR_MESSAGE=Mismatch between ARCH_DATA_MODEL=$(ARCH_DATA_MODEL) and use of -d64 in JAVA_ARGS=$(JAVA_ARGS)
661e7fbf77adb6a251c188dba4aa51c1d6aeffe9Tinderbox User ifeq ($(ARCH_DATA_MODEL),32)
661e7fbf77adb6a251c188dba4aa51c1d6aeffe9Tinderbox User ifneq ($(findstring -d64,$(JAVA_ARGS)),)
661e7fbf77adb6a251c188dba4aa51c1d6aeffe9Tinderbox User x:=$(warning "WARNING: $(D64_ERROR_MESSAGE)")
661e7fbf77adb6a251c188dba4aa51c1d6aeffe9Tinderbox User endif
661e7fbf77adb6a251c188dba4aa51c1d6aeffe9Tinderbox User endif
661e7fbf77adb6a251c188dba4aa51c1d6aeffe9Tinderbox User ifeq ($(ARCH_DATA_MODEL),64)
661e7fbf77adb6a251c188dba4aa51c1d6aeffe9Tinderbox User ifeq ($(findstring -d64,$(JAVA_ARGS)),)
661e7fbf77adb6a251c188dba4aa51c1d6aeffe9Tinderbox User x:=$(warning "WARNING: $(D64_ERROR_MESSAGE)")
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User endif
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User endif
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox Userendif
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User# Macro to run make and set the shared library permissions
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox Userdefine SharedLibraryPermissions
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein$(MAKE) SHARED_LIBRARY_DIR=$1 UNIQUE_DIR=$@ shared_library_permissions
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox Userendef
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User
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
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox Userifdef JPRT_ARCHIVE_BUNDLE
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User ARCHIVE_BUNDLE = $(JPRT_ARCHIVE_BUNDLE)
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox Userendif
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User
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 User && $(CD) $(ABS_TEST_OUTPUT_DIR) \
661e7fbf77adb6a251c188dba4aa51c1d6aeffe9Tinderbox User && $(CHMOD) -R a+r . \
661e7fbf77adb6a251c188dba4aa51c1d6aeffe9Tinderbox User && $(ZIP) -q -r $(ARCHIVE_BUNDLE) . )
661e7fbf77adb6a251c188dba4aa51c1d6aeffe9Tinderbox UserSUMMARY_TXT = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/JTreport/text/summary.txt
661e7fbf77adb6a251c188dba4aa51c1d6aeffe9Tinderbox UserSTATS_TXT_NAME = Stats.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
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsTESTEXIT = \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews if [ ! -s $(EXITCODE) ] ; then \
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews $(ECHO) "ERROR: EXITCODE file not filled in."; \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $(ECHO) "1" > $(EXITCODE); \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews fi ; \
e108f2ec640e1acb54999c0ade58af606149956dTinderbox User testExitCode=`$(CAT) $(EXITCODE)`; \
6d382c9fcec316a84a237779fb64bb471b6f9d43Tinderbox User $(ECHO) "EXIT CODE: $${testExitCode}"; \
6d382c9fcec316a84a237779fb64bb471b6f9d43Tinderbox User exit $${testExitCode}
f9aef05653eeb454c489d5bd2bde6daab774ad4aTinderbox User
f9aef05653eeb454c489d5bd2bde6daab774ad4aTinderbox UserBUNDLE_UP_AND_EXIT = \
f9aef05653eeb454c489d5bd2bde6daab774ad4aTinderbox User( \
f9aef05653eeb454c489d5bd2bde6daab774ad4aTinderbox User jtregExitCode=$$? && \
f9aef05653eeb454c489d5bd2bde6daab774ad4aTinderbox User _summary="$(SUMMARY_TXT)"; \
f9aef05653eeb454c489d5bd2bde6daab774ad4aTinderbox User $(RM) -f $(STATS_TXT) $(RUNLIST) $(PASSLIST) $(FAILLIST) $(EXITCODE); \
922312472e2e05ebc64993d465999c5351b83036Automatic Updater $(ECHO) "$${jtregExitCode}" > $(EXITCODE); \
922312472e2e05ebc64993d465999c5351b83036Automatic Updater if [ -r "$${_summary}" ] ; then \
922312472e2e05ebc64993d465999c5351b83036Automatic Updater $(ECHO) "Summary: $(UNIQUE_DIR)" > $(STATS_TXT); \
50066670817cdf9e86c832066d73715232b29680Tinderbox User $(EXPAND) $${_summary} | $(EGREP) -v ' Not run\.' > $(RUNLIST); \
50066670817cdf9e86c832066d73715232b29680Tinderbox User $(EGREP) ' Passed\.' $(RUNLIST) \
50066670817cdf9e86c832066d73715232b29680Tinderbox User | $(EGREP) -v ' Error\.' \
28b3569d6248168e6c00caab951521cc8141a49dAutomatic Updater | $(EGREP) -v ' Failed\.' > $(PASSLIST); \
28b3569d6248168e6c00caab951521cc8141a49dAutomatic Updater ( $(EGREP) ' Failed\.' $(RUNLIST); \
28b3569d6248168e6c00caab951521cc8141a49dAutomatic Updater $(EGREP) ' Error\.' $(RUNLIST); \
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews $(EGREP) -v ' Passed\.' $(RUNLIST) ) \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews | $(SORT) | $(UNIQ) > $(FAILLIST); \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews if [ $${jtregExitCode} != 0 -o -s $(FAILLIST) ] ; then \
2cbb4ab75757fbb656997a82c14ca07db37d481aAutomatic Updater $(EXPAND) $(FAILLIST) \
2cbb4ab75757fbb656997a82c14ca07db37d481aAutomatic Updater | $(CUT) -d' ' -f1 \
2cbb4ab75757fbb656997a82c14ca07db37d481aAutomatic Updater | $(SED) -e 's@^@FAILED: @' >> $(STATS_TXT); \
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater if [ $${jtregExitCode} = 0 ] ; then \
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater jtregExitCode=1; \
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater fi; \
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews fi; \
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}" \
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews >> $(STATS_TXT); \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews else \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $(ECHO) "Missing file: $${_summary}" >> $(STATS_TXT); \
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews fi; \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews if [ -f $(STATS_TXT) ] ; then \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $(CAT) $(STATS_TXT); \
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews fi; \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $(ZIP_UP_RESULTS) ; \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $(TESTEXIT) \
e2e4d321999340802f77adaacd19c797d04b4b95Automatic Updater)
e2e4d321999340802f77adaacd19c797d04b4b95Automatic Updater
e2e4d321999340802f77adaacd19c797d04b4b95Automatic Updater################################################################
b6b8f8a0362da8c749021c4b6376cfb96047912bTinderbox User
b6b8f8a0362da8c749021c4b6376cfb96047912bTinderbox User# Default make rule (runs jtreg_tests)
b6b8f8a0362da8c749021c4b6376cfb96047912bTinderbox Userall: jtreg_tests
0c6ada0a814f3c5417daa1654129bc2af56ed504Automatic Updater @$(ECHO) "Testing completed successfully"
0c6ada0a814f3c5417daa1654129bc2af56ed504Automatic Updater
0c6ada0a814f3c5417daa1654129bc2af56ed504Automatic Updater# Prep for output
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrewsprep: clean
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews @$(MKDIR) -p $(ABS_TEST_OUTPUT_DIR)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews @$(MKDIR) -p `$(DIRNAME) $(ARCHIVE_BUNDLE)`
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Cleanup
9b469e3c59015b1a4899c9d8395168126fe094fdAutomatic Updaterclean:
9b469e3c59015b1a4899c9d8395168126fe094fdAutomatic Updater $(RM) -r $(ABS_TEST_OUTPUT_DIR)
9b469e3c59015b1a4899c9d8395168126fe094fdAutomatic Updater $(RM) $(ARCHIVE_BUNDLE)
9b469e3c59015b1a4899c9d8395168126fe094fdAutomatic Updater
9b469e3c59015b1a4899c9d8395168126fe094fdAutomatic Updater################################################################
9b469e3c59015b1a4899c9d8395168126fe094fdAutomatic Updater
e2e4d321999340802f77adaacd19c797d04b4b95Automatic Updater# jtreg tests
e2e4d321999340802f77adaacd19c797d04b4b95Automatic Updater
e2e4d321999340802f77adaacd19c797d04b4b95Automatic Updater# Expect JT_HOME to be set for jtreg tests. (home for jtreg)
e2e4d321999340802f77adaacd19c797d04b4b95Automatic Updaterifndef JT_HOME
e2e4d321999340802f77adaacd19c797d04b4b95Automatic Updater JT_HOME = $(SLASH_JAVA)/re/jtreg/4.1/promoted/latest/binaries/jtreg
e2e4d321999340802f77adaacd19c797d04b4b95Automatic Updater ifdef JPRT_JTREG_HOME
e2e4d321999340802f77adaacd19c797d04b4b95Automatic Updater JT_HOME = $(JPRT_JTREG_HOME)
fdd80e9a55c70b36a3bf3e409b86897301c44ff8Automatic Updater endif
fdd80e9a55c70b36a3bf3e409b86897301c44ff8Automatic Updaterendif
fdd80e9a55c70b36a3bf3e409b86897301c44ff8Automatic Updater
e2e4d321999340802f77adaacd19c797d04b4b95Automatic Updater# Expect JPRT to set TESTDIRS to the jtreg test dirs
e2e4d321999340802f77adaacd19c797d04b4b95Automatic Updaterifndef TESTDIRS
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews TESTDIRS = demo
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinendif
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Agentvm settings (default is false)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinifndef USE_JTREG_AGENTVM
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein USE_JTREG_AGENTVM=false
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinendif
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# With agentvm, you cannot use -javaoptions?
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinifeq ($(USE_JTREG_AGENTVM),true)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein JTREG_AGENTVM_OPTION = -agentvm
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein EXTRA_JTREG_OPTIONS += $(JTREG_AGENTVM_OPTION) $(JAVA_ARGS) $(JAVA_ARGS:%=-vmoption:%)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein JTREG_TEST_OPTIONS = $(JAVA_VM_ARGS:%=-vmoption:%)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinelse
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein JTREG_TEST_OPTIONS = $(JAVA_ARGS:%=-javaoptions:%) $(JAVA_VM_ARGS:%=-vmoption:%)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinendif
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinifdef CONCURRENCY
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein EXTRA_JTREG_OPTIONS += -concurrency:$(CONCURRENCY)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinendif
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
30c0c7470d5bfabd8f43c563f4eca636d06cc484Tinderbox User# Some tests annoy me and fail frequently
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinPROBLEM_LIST=ProblemList.txt
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinPROBLEM_LISTS=$(PROBLEM_LIST) $(wildcard closed/$(PROBLEM_LIST))
EXCLUDELIST=$(ABS_TEST_OUTPUT_DIR)/excludelist.txt
# Create exclude list for this platform and arch
ifdef NO_EXCLUDES
$(EXCLUDELIST): $(PROBLEM_LISTS) $(TEST_DEPENDENCIES)
@$(ECHO) "NOTHING_EXCLUDED" > $@
else
$(EXCLUDELIST): $(PROBLEM_LISTS) $(TEST_DEPENDENCIES)
@$(RM) $@ $@.temp1 $@.temp2
@(($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- '$(OS_NAME)-all' ) ;\
($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- '$(PLATFORM_OS)' ) ;\
($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- '$(OS_NAME)-$(OS_ARCH2)' ) ;\
($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- '$(OS_NAME)-$(OS_VERSION)') ;\
($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- 'generic-$(OS_ARCH)' ) ;\
($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- 'generic-$(OS_ARCH2)' ) ;\
($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- 'generic-all' ) ;\
($(ECHO) "#") ;\
) | $(SED) -e 's@^[\ ]*@@' \
| $(EGREP) -v '^#' > $@.temp1
for tdir in $(TESTDIRS) SOLARIS_10_SH_BUG_NO_EMPTY_FORS ; do \
( ( $(CAT) $@.temp1 | $(EGREP) "^$${tdir}" ) ; $(ECHO) "#" ) >> $@.temp2 ; \
done
@$(ECHO) "# at least one line" >> $@.temp2
@( $(EGREP) -v '^#' $@.temp2 ; true ) > $@
@$(ECHO) "Excluding list contains `$(EXPAND) $@ | $(WC) -l` items"
endif
# Select list of directories that exist
define TestDirs
$(foreach i,$1,$(wildcard ${i})) $(foreach i,$1,$(wildcard closed/${i}))
endef
# Running batches of tests with or without agentvm
define RunAgentvmBatch
$(ECHO) "Running tests in agentvm mode: $?"
$(MAKE) TEST_DEPENDENCIES="$?" TESTDIRS="$?" USE_JTREG_AGENTVM=true UNIQUE_DIR=$@ jtreg_tests
endef
define RunOthervmBatch
$(ECHO) "Running tests in othervm mode: $?"
$(MAKE) TEST_DEPENDENCIES="$?" TESTDIRS="$?" USE_JTREG_AGENTVM=false UNIQUE_DIR=$@ jtreg_tests
endef
define SummaryInfo
$(ECHO) "########################################################"
$(CAT) $(?:%=$(ABS_TEST_OUTPUT_DIR)/%/$(STATS_TXT_NAME))
$(ECHO) "########################################################"
endef
# ------------------------------------------------------------------
# Batches of tests (somewhat arbitrary assigments to jdk_* targets)
JDK_ALL_TARGETS =
# 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_awt
jdk_awt: $(call TestDirs, com/sun/awt java/awt sun/awt \
javax/imageio javax/print sun/pisces)
$(call RunOthervmBatch)
# Stable samevm testruns (minus items from PROBLEM_LIST)
JDK_ALL_TARGETS += jdk_beans1
jdk_beans1: $(call TestDirs, \
java/beans/beancontext java/beans/PropertyChangeSupport \
java/beans/Introspector java/beans/Performance \
java/beans/VetoableChangeSupport java/beans/Statement)
$(call RunAgentvmBatch)
# Stable othervm testruns (minus items from PROBLEM_LIST)
# Using samevm has serious problems with these tests
JDK_ALL_TARGETS += jdk_beans2
jdk_beans2: $(call TestDirs, \
java/beans/Beans java/beans/EventHandler java/beans/XMLDecoder \
java/beans/PropertyEditor)
$(call RunOthervmBatch)
# Stable othervm testruns (minus items from PROBLEM_LIST)
# Using agentvm has serious problems with these tests
JDK_ALL_TARGETS += jdk_beans3
jdk_beans3: $(call TestDirs, java/beans/XMLEncoder)
$(call RunOthervmBatch)
# All beans tests
jdk_beans: jdk_beans1 jdk_beans2 jdk_beans3
@$(SummaryInfo)
# Stable agentvm testruns (minus items from PROBLEM_LIST)
JDK_ALL_TARGETS += jdk_io
jdk_io: $(call TestDirs, java/io)
$(call RunAgentvmBatch)
# Stable othervm testruns (minus items from PROBLEM_LIST)
# Using agentvm has serious problems with these tests
ifdef OPENJDK
jdk_jfr:
else
JDK_ALL_TARGETS += jdk_jfr
jdk_jfr: $(call TestDirs, com/oracle/jfr)
$(call RunOthervmBatch)
endif
# Stable agentvm testruns (minus items from PROBLEM_LIST)
JDK_ALL_TARGETS += jdk_lang
jdk_lang: $(call TestDirs, java/lang)
$(call RunAgentvmBatch)
# Stable othervm testruns (minus items from PROBLEM_LIST)
# Using agentvm has serious problems with these tests
JDK_ALL_TARGETS += jdk_management1
jdk_management1: $(call TestDirs, javax/management)
$(call RunOthervmBatch)
# Stable othervm testruns (minus items from PROBLEM_LIST)
# Using agentvm has serious problems with these tests
JDK_ALL_TARGETS += jdk_management2
jdk_management2: $(call TestDirs, com/sun/jmx com/sun/management sun/management)
$(call RunOthervmBatch)
# All management tests
jdk_management: jdk_management1 jdk_management2
@$(SummaryInfo)
# Stable samevm testruns (minus items from PROBLEM_LIST)
JDK_ALL_TARGETS += jdk_math
jdk_math: $(call TestDirs, java/math)
$(call RunAgentvmBatch)
# Stable samevm testruns (minus items from PROBLEM_LIST)
JDK_ALL_TARGETS += jdk_misc
jdk_misc: $(call TestDirs, \
demo/jvmti demo/zipfs javax/naming javax/script \
javax/smartcardio com/sun/jndi com/sun/xml sun/misc)
$(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)
$(call RunAgentvmBatch)
# Stable samevm testruns (minus items from PROBLEM_LIST)
JDK_ALL_TARGETS += jdk_nio1
jdk_nio1: $(call TestDirs, java/nio/file)
$(call RunAgentvmBatch)
# Stable samevm testruns (minus items from PROBLEM_LIST)
JDK_ALL_TARGETS += jdk_nio2
jdk_nio2: $(call TestDirs, java/nio/Buffer java/nio/ByteOrder \
java/nio/channels java/nio/MappedByteBuffer)
$(call SharedLibraryPermissions,java/nio/channels)
$(call RunAgentvmBatch)
# Stable samevm testruns (minus items from PROBLEM_LIST)
JDK_ALL_TARGETS += jdk_nio3
jdk_nio3: $(call TestDirs, sun/nio)
$(call RunAgentvmBatch)
# All nio tests
jdk_nio: jdk_nio1 jdk_nio2 jdk_nio3
@$(SummaryInfo)
# 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 javax/rmi sun/rmi)
$(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 RunOthervmBatch)
# 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/ucrypto)
$(call SharedLibraryPermissions,sun/security)
$(call RunOthervmBatch)
# 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_tools1
jdk_tools1: $(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_tools2
jdk_tools2: $(call TestDirs, \
com/sun/tools sun/jvmstat sun/tools tools vm \
com/sun/servicetag com/sun/tracing)
$(call SharedLibraryPermissions,tools/launcher)
$(call RunAgentvmBatch)
# All tools tests
jdk_tools: jdk_tools1 jdk_tools2
@$(SummaryInfo)
# 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)
################################################################