Makefile revision 328
4944N/A#
4944N/A# Copyright 1995-2008 Sun Microsystems, Inc. All Rights Reserved.
4944N/A# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4944N/A#
4944N/A# This code is free software; you can redistribute it and/or modify it
4944N/A# under the terms of the GNU General Public License version 2 only, as
4944N/A# published by the Free Software Foundation.
4944N/A#
4944N/A# This code is distributed in the hope that it will be useful, but WITHOUT
4944N/A# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
4944N/A# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
4944N/A# version 2 for more details (a copy is included in the LICENSE file that
4944N/A# accompanied this code).
4944N/A#
4944N/A# You should have received a copy of the GNU General Public License version
4944N/A# 2 along with this work; if not, write to the Free Software Foundation,
4944N/A# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
4944N/A#
4944N/A# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
4944N/A# CA 95054 USA or visit www.sun.com if you need additional information or
4944N/A# have any questions.
4944N/A#
5680N/A#
4944N/A
6931N/A#
5680N/A# Makefile to run various jdk tests
4944N/A#
4944N/A
4944N/A# Get OS/ARCH specifics
4944N/AOSNAME = $(shell uname -s)
4944N/ASLASH_JAVA = /java
4944N/Aifeq ($(OSNAME), SunOS)
4944N/A PLATFORM = solaris
4944N/A ARCH = $(shell uname -p)
4944N/A ifeq ($(ARCH), i386)
4944N/A ARCH=i586
4944N/A endif
4944N/Aendif
4944N/Aifeq ($(OSNAME), Linux)
4944N/A PLATFORM = linux
4944N/A ARCH = $(shell uname -m)
4944N/A ifeq ($(ARCH), i386)
4944N/A ARCH = i586
4944N/A endif
4944N/Aendif
5680N/Aifeq ($(OSNAME), Windows_NT)
5680N/A PLATFORM = windows
5680N/A SLASH_JAVA = J:
4944N/A ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)),ia64)
5680N/A ARCH = ia64
5680N/A else
5680N/A ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)),AMD64)
5680N/A ARCH = x64
5680N/A else
4944N/A ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)),EM64T)
4944N/A ARCH = x64
5680N/A else
5680N/A ARCH = i586
4944N/A endif
6931N/A endif
6931N/A endif
6931N/A EXESUFFIX = .exe
6931N/Aendif
6931N/A
4944N/A# Utilities used
4944N/ACD = cd
5680N/ACP = cp
5680N/AECHO = echo
4944N/AMKDIR = mkdir
4944N/AZIP = zip
4944N/A
4944N/A# Root of this test area (important to use full paths in some places)
4944N/ATEST_ROOT := $(shell pwd)
4944N/A
4944N/A# Root of all test results
5795N/AABS_BUILD_ROOT = $(TEST_ROOT)/../build/$(PLATFORM)-$(ARCH)
5795N/AABS_TEST_OUTPUT_DIR = $(ABS_BUILD_ROOT)/testoutput
5795N/A
5680N/A# Expect JPRT to set PRODUCT_HOME (the product or jdk in this case to test)
4944N/Aifndef PRODUCT_HOME
5680N/A # Try to use j2sdk-image if it exists
5680N/A ABS_JDK_IMAGE = $(ABS_BUILD_ROOT)/j2sdk-image
5680N/A PRODUCT_HOME := \
4944N/A $(shell \
4944N/A if [ -d $(ABS_JDK_IMAGE) ] ; then \
6931N/A $(ECHO) "$(ABS_JDK_IMAGE)"; \
6931N/A else \
4944N/A $(ECHO) "$(ABS_BUILD_ROOT)" ; \
fi)
endif
# Expect JPRT to set JAVA_ARGS (e.g. -server etc.)
JAVA_OPTIONS =
ifdef JAVA_ARGS
JAVA_OPTIONS = $(JAVA_ARGS)
endif
# Expect JPRT to set JPRT_ARCHIVE_BUNDLE (path to zip bundle for results)
ARCHIVE_BUNDLE = $(ABS_TEST_OUTPUT_DIR)/ARCHIVE_BUNDLE.zip
ifdef JPRT_ARCHIVE_BUNDLE
ARCHIVE_BUNDLE = $(JPRT_ARCHIVE_BUNDLE)
endif
# How to create the test bundle (pass or fail, we want to create this)
BUNDLE_UP = ( $(MKDIR) -p `dirname $(ARCHIVE_BUNDLE)` \
&& $(CD) $(ABS_TEST_OUTPUT_DIR) \
&& $(ZIP) -q -r $(ARCHIVE_BUNDLE) . )
BUNDLE_UP_FAILED = ( exitCode=$$? && $(BUNDLE_UP) && exit $${exitCode} )
################################################################
# Default make rule (runs jtreg_tests)
all: jtreg_tests
@$(ECHO) "Testing completed successfully"
# Prep for output
prep: clean
@$(MKDIR) -p $(ABS_TEST_OUTPUT_DIR)
@$(MKDIR) -p `dirname $(ARCHIVE_BUNDLE)`
# Cleanup
clean:
$(RM) -r $(ABS_TEST_OUTPUT_DIR)
$(RM) $(ARCHIVE_BUNDLE)
################################################################
# jtreg tests
# Expect JT_HOME to be set for jtreg tests. (home for jtreg)
JT_HOME = $(SLASH_JAVA)/re/jtreg/4.0/promoted/latest/binaries/jtreg
ifdef JPRT_JTREG_HOME
JT_HOME = $(JPRT_JTREG_HOME)
endif
# Expect JPRT to set TESTDIRS to the jtreg test dirs
JTREG_TESTDIRS = demo/jvmti/gctest demo/jvmti/hprof
ifdef TESTDIRS
JTREG_TESTDIRS = $(TESTDIRS)
endif
# Default JTREG to run (win32 script works for everybody)
JTREG = $(JT_HOME)/win32/bin/jtreg
# Option to tell jtreg to not run tests marked with "ignore"
ifeq ($(PLATFORM), windows)
JTREG_KEY_OPTION = -k:!ignore
else
JTREG_KEY_OPTION = -k:\!ignore
endif
#EXTRA_JTREG_OPTIONS =
jtreg_tests: prep $(JT_HOME) $(PRODUCT_HOME) $(JTREG)
$(JTREG) -a -v:fail,error \
$(JTREG_KEY_OPTION) \
$(EXTRA_JTREG_OPTIONS) \
-r:$(ABS_TEST_OUTPUT_DIR)/JTreport \
-w:$(ABS_TEST_OUTPUT_DIR)/JTwork \
-jdk:$(PRODUCT_HOME) \
$(JAVA_OPTIONS:%=-vmoption:%) \
$(JTREG_TESTDIRS) \
|| $(BUNDLE_UP_FAILED)
$(BUNDLE_UP)
PHONY_LIST += jtreg_tests
################################################################
# 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
#EXTRA_PACKTEST_OPTIONS =
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_OPTIONS:%=-J %) \
) || $(BUNDLE_UP_FAILED)
$(BUNDLE_UP)
packtest_stress: PACKTEST_STRESS_OPTION=-s
packtest_stress: packtest
PHONY_LIST += packtest packtest_stress
################################################################
# Phony targets (e.g. these are not filenames)
.PHONY: all clean prep $(PHONY_LIST)
################################################################