test/Makefile

Tue, 03 Feb 2009 08:10:28 -0800

author
twisti
date
Tue, 03 Feb 2009 08:10:28 -0800
changeset 995
b79faa366fbd
parent 763
68e0443dfd9c
child 1014
0fbdb4381b99
permissions
-rw-r--r--

6799452: HotSpot tests Makefile should take care of ALT_SLASH_JAVA
Summary: The HotSpot tests Makefile has a hardcoded SLASH_JAVA which makes it difficult to run the tests on non-Sun build machines which do not have a /java infrastructure.
Reviewed-by: kamg

duke@435 1 #
ohair@763 2 # Copyright 1995-2008 Sun Microsystems, Inc. All Rights Reserved.
duke@435 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@435 4 #
duke@435 5 # This code is free software; you can redistribute it and/or modify it
duke@435 6 # under the terms of the GNU General Public License version 2 only, as
duke@435 7 # published by the Free Software Foundation.
duke@435 8 #
duke@435 9 # This code is distributed in the hope that it will be useful, but WITHOUT
duke@435 10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@435 11 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@435 12 # version 2 for more details (a copy is included in the LICENSE file that
duke@435 13 # accompanied this code).
duke@435 14 #
duke@435 15 # You should have received a copy of the GNU General Public License version
duke@435 16 # 2 along with this work; if not, write to the Free Software Foundation,
duke@435 17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@435 18 #
duke@435 19 # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
duke@435 20 # CA 95054 USA or visit www.sun.com if you need additional information or
duke@435 21 # have any questions.
ohair@763 22 #
duke@435 23 #
duke@435 24
duke@435 25 #
ohair@763 26 # Makefile to run various jdk tests
duke@435 27 #
duke@435 28
ohair@763 29 # Get OS/ARCH specifics
duke@435 30 OSNAME = $(shell uname -s)
duke@435 31 ifeq ($(OSNAME), SunOS)
duke@435 32 PLATFORM = solaris
twisti@995 33 SLASH_JAVA = /java
duke@435 34 ARCH = $(shell uname -p)
duke@435 35 ifeq ($(ARCH), i386)
duke@435 36 ARCH=i586
duke@435 37 endif
duke@435 38 endif
duke@435 39 ifeq ($(OSNAME), Linux)
duke@435 40 PLATFORM = linux
twisti@995 41 SLASH_JAVA = /java
duke@435 42 ARCH = $(shell uname -m)
duke@435 43 ifeq ($(ARCH), i386)
ohair@763 44 ARCH = i586
duke@435 45 endif
duke@435 46 endif
duke@435 47 ifeq ($(OSNAME), Windows_NT)
duke@435 48 PLATFORM = windows
ohair@763 49 SLASH_JAVA = J:
duke@435 50 ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)),ia64)
ohair@763 51 ARCH = ia64
duke@435 52 else
duke@435 53 ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)),AMD64)
ohair@763 54 ARCH = x64
duke@435 55 else
duke@435 56 ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)),EM64T)
ohair@763 57 ARCH = x64
duke@435 58 else
ohair@763 59 ARCH = i586
duke@435 60 endif
duke@435 61 endif
duke@435 62 endif
ohair@763 63 EXESUFFIX = .exe
duke@435 64 endif
duke@435 65
twisti@995 66 ifdef ALT_SLASH_JAVA
twisti@995 67 SLASH_JAVA = $(ALT_SLASH_JAVA)
twisti@995 68 endif
twisti@995 69
ohair@763 70 # Utilities used
ohair@763 71 CD = cd
ohair@763 72 CP = cp
ohair@763 73 ECHO = echo
ohair@763 74 MKDIR = mkdir
ohair@763 75 ZIP = zip
duke@435 76
ohair@763 77 # Root of this test area (important to use full paths in some places)
ohair@763 78 TEST_ROOT := $(shell pwd)
ohair@763 79
ohair@763 80 # Root of all test results
ohair@763 81 ABS_BUILD_ROOT = $(TEST_ROOT)/../build/$(PLATFORM)-$(ARCH)
ohair@763 82 ABS_TEST_OUTPUT_DIR = $(ABS_BUILD_ROOT)/testoutput
ohair@763 83
ohair@763 84 # Expect JPRT to set PRODUCT_HOME (the product or jdk in this case to test)
ohair@763 85 ifndef PRODUCT_HOME
ohair@763 86 # Try to use j2sdk-image if it exists
ohair@763 87 ABS_JDK_IMAGE = $(ABS_BUILD_ROOT)/j2sdk-image
ohair@763 88 PRODUCT_HOME := \
ohair@763 89 $(shell \
ohair@763 90 if [ -d $(ABS_JDK_IMAGE) ] ; then \
ohair@763 91 $(ECHO) "$(ABS_JDK_IMAGE)"; \
ohair@763 92 else \
ohair@763 93 $(ECHO) "$(ABS_BUILD_ROOT)" ; \
ohair@763 94 fi)
duke@435 95 endif
duke@435 96
ohair@763 97 # Expect JPRT to set JAVA_ARGS (e.g. -server etc.)
ohair@763 98 JAVA_OPTIONS =
ohair@763 99 ifdef JAVA_ARGS
ohair@763 100 JAVA_OPTIONS = $(JAVA_ARGS)
ohair@763 101 endif
duke@435 102
ohair@763 103 # Expect JPRT to set JPRT_ARCHIVE_BUNDLE (path to zip bundle for results)
ohair@763 104 ARCHIVE_BUNDLE = $(ABS_TEST_OUTPUT_DIR)/ARCHIVE_BUNDLE.zip
ohair@763 105 ifdef JPRT_ARCHIVE_BUNDLE
ohair@763 106 ARCHIVE_BUNDLE = $(JPRT_ARCHIVE_BUNDLE)
ohair@763 107 endif
duke@435 108
ohair@763 109 # How to create the test bundle (pass or fail, we want to create this)
ohair@763 110 BUNDLE_UP = ( $(MKDIR) -p `dirname $(ARCHIVE_BUNDLE)` \
ohair@763 111 && $(CD) $(ABS_TEST_OUTPUT_DIR) \
ohair@763 112 && $(ZIP) -q -r $(ARCHIVE_BUNDLE) . )
ohair@763 113 BUNDLE_UP_FAILED = ( exitCode=$$? && $(BUNDLE_UP) && exit $${exitCode} )
duke@435 114
ohair@763 115 ################################################################
duke@435 116
ohair@763 117 # Default make rule (runs jtreg_tests)
ohair@763 118 all: jtreg_tests
ohair@763 119 @$(ECHO) "Testing completed successfully"
duke@435 120
ohair@763 121 # Prep for output
ohair@763 122 prep: clean
ohair@763 123 @$(MKDIR) -p $(ABS_TEST_OUTPUT_DIR)
ohair@763 124 @$(MKDIR) -p `dirname $(ARCHIVE_BUNDLE)`
duke@435 125
duke@435 126 # Cleanup
duke@435 127 clean:
ohair@763 128 $(RM) -r $(ABS_TEST_OUTPUT_DIR)
ohair@763 129 $(RM) $(ARCHIVE_BUNDLE)
duke@435 130
ohair@763 131 ################################################################
duke@435 132
ohair@763 133 # jtreg tests
ohair@763 134
ohair@763 135 # Expect JT_HOME to be set for jtreg tests. (home for jtreg)
ohair@763 136 JT_HOME = $(SLASH_JAVA)/re/jtreg/4.0/promoted/latest/binaries/jtreg
ohair@763 137 ifdef JPRT_JTREG_HOME
ohair@763 138 JT_HOME = $(JPRT_JTREG_HOME)
ohair@763 139 endif
ohair@763 140
ohair@763 141 # Expect JPRT to set TESTDIRS to the jtreg test dirs
ohair@763 142 JTREG_TESTDIRS = demo/jvmti/gctest demo/jvmti/hprof
ohair@763 143 ifdef TESTDIRS
ohair@763 144 JTREG_TESTDIRS = $(TESTDIRS)
ohair@763 145 endif
ohair@763 146
ohair@763 147 # Default JTREG to run (win32 script works for everybody)
ohair@763 148 JTREG = $(JT_HOME)/win32/bin/jtreg
ohair@763 149
ohair@763 150 # Option to tell jtreg to not run tests marked with "ignore"
ohair@763 151 ifeq ($(PLATFORM), windows)
ohair@763 152 JTREG_KEY_OPTION = -k:!ignore
ohair@763 153 else
ohair@763 154 JTREG_KEY_OPTION = -k:\!ignore
ohair@763 155 endif
ohair@763 156
ohair@763 157 #EXTRA_JTREG_OPTIONS =
ohair@763 158
ohair@763 159 jtreg_tests: prep $(JT_HOME) $(PRODUCT_HOME) $(JTREG)
ohair@763 160 $(JTREG) -a -v:fail,error \
ohair@763 161 $(JTREG_KEY_OPTION) \
ohair@763 162 $(EXTRA_JTREG_OPTIONS) \
ohair@763 163 -r:$(ABS_TEST_OUTPUT_DIR)/JTreport \
ohair@763 164 -w:$(ABS_TEST_OUTPUT_DIR)/JTwork \
ohair@763 165 -jdk:$(PRODUCT_HOME) \
ohair@763 166 $(JAVA_OPTIONS:%=-vmoption:%) \
ohair@763 167 $(JTREG_TESTDIRS) \
ohair@763 168 || $(BUNDLE_UP_FAILED)
ohair@763 169 $(BUNDLE_UP)
ohair@763 170
ohair@763 171 PHONY_LIST += jtreg_tests
ohair@763 172
ohair@763 173 ################################################################
ohair@763 174
ohair@763 175 # packtest
ohair@763 176
ohair@763 177 # Expect JPRT to set JPRT_PACKTEST_HOME.
ohair@763 178 PACKTEST_HOME = /net/jprt-web.sfbay.sun.com/jprt/allproducts/packtest
ohair@763 179 ifdef JPRT_PACKTEST_HOME
ohair@763 180 PACKTEST_HOME = $(JPRT_PACKTEST_HOME)
ohair@763 181 endif
ohair@763 182
ohair@763 183 #EXTRA_PACKTEST_OPTIONS =
ohair@763 184
ohair@763 185 packtest: prep $(PACKTEST_HOME)/ptest $(PRODUCT_HOME)
ohair@763 186 ( $(CD) $(PACKTEST_HOME) && \
ohair@763 187 $(PACKTEST_HOME)/ptest \
ohair@763 188 -t "$(PRODUCT_HOME)" \
ohair@763 189 $(PACKTEST_STRESS_OPTION) \
ohair@763 190 $(EXTRA_PACKTEST_OPTIONS) \
ohair@763 191 -W $(ABS_TEST_OUTPUT_DIR) \
ohair@763 192 $(JAVA_OPTIONS:%=-J %) \
ohair@763 193 ) || $(BUNDLE_UP_FAILED)
ohair@763 194 $(BUNDLE_UP)
ohair@763 195
ohair@763 196 packtest_stress: PACKTEST_STRESS_OPTION=-s
ohair@763 197 packtest_stress: packtest
ohair@763 198
ohair@763 199 PHONY_LIST += packtest packtest_stress
ohair@763 200
ohair@763 201 ################################################################
ohair@763 202
ohair@763 203 # Phony targets (e.g. these are not filenames)
ohair@763 204 .PHONY: all clean prep $(PHONY_LIST)
ohair@763 205
ohair@763 206 ################################################################
ohair@763 207

mercurial