test/Makefile

Thu, 20 Nov 2008 16:56:09 -0800

author
ysr
date
Thu, 20 Nov 2008 16:56:09 -0800
changeset 888
c96030fff130
parent 763
68e0443dfd9c
child 995
b79faa366fbd
permissions
-rw-r--r--

6684579: SoftReference processing can be made more efficient
Summary: For current soft-ref clearing policies, we can decide at marking time if a soft-reference will definitely not be cleared, postponing the decision of whether it will definitely be cleared to the final reference processing phase. This can be especially beneficial in the case of concurrent collectors where the marking is usually concurrent but reference processing is usually not.
Reviewed-by: jmasa

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)
ohair@763 31 SLASH_JAVA = /java
duke@435 32 ifeq ($(OSNAME), SunOS)
duke@435 33 PLATFORM = solaris
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
duke@435 41 ARCH = $(shell uname -m)
duke@435 42 ifeq ($(ARCH), i386)
ohair@763 43 ARCH = i586
duke@435 44 endif
duke@435 45 endif
duke@435 46 ifeq ($(OSNAME), Windows_NT)
duke@435 47 PLATFORM = windows
ohair@763 48 SLASH_JAVA = J:
duke@435 49 ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)),ia64)
ohair@763 50 ARCH = ia64
duke@435 51 else
duke@435 52 ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)),AMD64)
ohair@763 53 ARCH = x64
duke@435 54 else
duke@435 55 ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)),EM64T)
ohair@763 56 ARCH = x64
duke@435 57 else
ohair@763 58 ARCH = i586
duke@435 59 endif
duke@435 60 endif
duke@435 61 endif
ohair@763 62 EXESUFFIX = .exe
duke@435 63 endif
duke@435 64
ohair@763 65 # Utilities used
ohair@763 66 CD = cd
ohair@763 67 CP = cp
ohair@763 68 ECHO = echo
ohair@763 69 MKDIR = mkdir
ohair@763 70 ZIP = zip
duke@435 71
ohair@763 72 # Root of this test area (important to use full paths in some places)
ohair@763 73 TEST_ROOT := $(shell pwd)
ohair@763 74
ohair@763 75 # Root of all test results
ohair@763 76 ABS_BUILD_ROOT = $(TEST_ROOT)/../build/$(PLATFORM)-$(ARCH)
ohair@763 77 ABS_TEST_OUTPUT_DIR = $(ABS_BUILD_ROOT)/testoutput
ohair@763 78
ohair@763 79 # Expect JPRT to set PRODUCT_HOME (the product or jdk in this case to test)
ohair@763 80 ifndef PRODUCT_HOME
ohair@763 81 # Try to use j2sdk-image if it exists
ohair@763 82 ABS_JDK_IMAGE = $(ABS_BUILD_ROOT)/j2sdk-image
ohair@763 83 PRODUCT_HOME := \
ohair@763 84 $(shell \
ohair@763 85 if [ -d $(ABS_JDK_IMAGE) ] ; then \
ohair@763 86 $(ECHO) "$(ABS_JDK_IMAGE)"; \
ohair@763 87 else \
ohair@763 88 $(ECHO) "$(ABS_BUILD_ROOT)" ; \
ohair@763 89 fi)
duke@435 90 endif
duke@435 91
ohair@763 92 # Expect JPRT to set JAVA_ARGS (e.g. -server etc.)
ohair@763 93 JAVA_OPTIONS =
ohair@763 94 ifdef JAVA_ARGS
ohair@763 95 JAVA_OPTIONS = $(JAVA_ARGS)
ohair@763 96 endif
duke@435 97
ohair@763 98 # Expect JPRT to set JPRT_ARCHIVE_BUNDLE (path to zip bundle for results)
ohair@763 99 ARCHIVE_BUNDLE = $(ABS_TEST_OUTPUT_DIR)/ARCHIVE_BUNDLE.zip
ohair@763 100 ifdef JPRT_ARCHIVE_BUNDLE
ohair@763 101 ARCHIVE_BUNDLE = $(JPRT_ARCHIVE_BUNDLE)
ohair@763 102 endif
duke@435 103
ohair@763 104 # How to create the test bundle (pass or fail, we want to create this)
ohair@763 105 BUNDLE_UP = ( $(MKDIR) -p `dirname $(ARCHIVE_BUNDLE)` \
ohair@763 106 && $(CD) $(ABS_TEST_OUTPUT_DIR) \
ohair@763 107 && $(ZIP) -q -r $(ARCHIVE_BUNDLE) . )
ohair@763 108 BUNDLE_UP_FAILED = ( exitCode=$$? && $(BUNDLE_UP) && exit $${exitCode} )
duke@435 109
ohair@763 110 ################################################################
duke@435 111
ohair@763 112 # Default make rule (runs jtreg_tests)
ohair@763 113 all: jtreg_tests
ohair@763 114 @$(ECHO) "Testing completed successfully"
duke@435 115
ohair@763 116 # Prep for output
ohair@763 117 prep: clean
ohair@763 118 @$(MKDIR) -p $(ABS_TEST_OUTPUT_DIR)
ohair@763 119 @$(MKDIR) -p `dirname $(ARCHIVE_BUNDLE)`
duke@435 120
duke@435 121 # Cleanup
duke@435 122 clean:
ohair@763 123 $(RM) -r $(ABS_TEST_OUTPUT_DIR)
ohair@763 124 $(RM) $(ARCHIVE_BUNDLE)
duke@435 125
ohair@763 126 ################################################################
duke@435 127
ohair@763 128 # jtreg tests
ohair@763 129
ohair@763 130 # Expect JT_HOME to be set for jtreg tests. (home for jtreg)
ohair@763 131 JT_HOME = $(SLASH_JAVA)/re/jtreg/4.0/promoted/latest/binaries/jtreg
ohair@763 132 ifdef JPRT_JTREG_HOME
ohair@763 133 JT_HOME = $(JPRT_JTREG_HOME)
ohair@763 134 endif
ohair@763 135
ohair@763 136 # Expect JPRT to set TESTDIRS to the jtreg test dirs
ohair@763 137 JTREG_TESTDIRS = demo/jvmti/gctest demo/jvmti/hprof
ohair@763 138 ifdef TESTDIRS
ohair@763 139 JTREG_TESTDIRS = $(TESTDIRS)
ohair@763 140 endif
ohair@763 141
ohair@763 142 # Default JTREG to run (win32 script works for everybody)
ohair@763 143 JTREG = $(JT_HOME)/win32/bin/jtreg
ohair@763 144
ohair@763 145 # Option to tell jtreg to not run tests marked with "ignore"
ohair@763 146 ifeq ($(PLATFORM), windows)
ohair@763 147 JTREG_KEY_OPTION = -k:!ignore
ohair@763 148 else
ohair@763 149 JTREG_KEY_OPTION = -k:\!ignore
ohair@763 150 endif
ohair@763 151
ohair@763 152 #EXTRA_JTREG_OPTIONS =
ohair@763 153
ohair@763 154 jtreg_tests: prep $(JT_HOME) $(PRODUCT_HOME) $(JTREG)
ohair@763 155 $(JTREG) -a -v:fail,error \
ohair@763 156 $(JTREG_KEY_OPTION) \
ohair@763 157 $(EXTRA_JTREG_OPTIONS) \
ohair@763 158 -r:$(ABS_TEST_OUTPUT_DIR)/JTreport \
ohair@763 159 -w:$(ABS_TEST_OUTPUT_DIR)/JTwork \
ohair@763 160 -jdk:$(PRODUCT_HOME) \
ohair@763 161 $(JAVA_OPTIONS:%=-vmoption:%) \
ohair@763 162 $(JTREG_TESTDIRS) \
ohair@763 163 || $(BUNDLE_UP_FAILED)
ohair@763 164 $(BUNDLE_UP)
ohair@763 165
ohair@763 166 PHONY_LIST += jtreg_tests
ohair@763 167
ohair@763 168 ################################################################
ohair@763 169
ohair@763 170 # packtest
ohair@763 171
ohair@763 172 # Expect JPRT to set JPRT_PACKTEST_HOME.
ohair@763 173 PACKTEST_HOME = /net/jprt-web.sfbay.sun.com/jprt/allproducts/packtest
ohair@763 174 ifdef JPRT_PACKTEST_HOME
ohair@763 175 PACKTEST_HOME = $(JPRT_PACKTEST_HOME)
ohair@763 176 endif
ohair@763 177
ohair@763 178 #EXTRA_PACKTEST_OPTIONS =
ohair@763 179
ohair@763 180 packtest: prep $(PACKTEST_HOME)/ptest $(PRODUCT_HOME)
ohair@763 181 ( $(CD) $(PACKTEST_HOME) && \
ohair@763 182 $(PACKTEST_HOME)/ptest \
ohair@763 183 -t "$(PRODUCT_HOME)" \
ohair@763 184 $(PACKTEST_STRESS_OPTION) \
ohair@763 185 $(EXTRA_PACKTEST_OPTIONS) \
ohair@763 186 -W $(ABS_TEST_OUTPUT_DIR) \
ohair@763 187 $(JAVA_OPTIONS:%=-J %) \
ohair@763 188 ) || $(BUNDLE_UP_FAILED)
ohair@763 189 $(BUNDLE_UP)
ohair@763 190
ohair@763 191 packtest_stress: PACKTEST_STRESS_OPTION=-s
ohair@763 192 packtest_stress: packtest
ohair@763 193
ohair@763 194 PHONY_LIST += packtest packtest_stress
ohair@763 195
ohair@763 196 ################################################################
ohair@763 197
ohair@763 198 # Phony targets (e.g. these are not filenames)
ohair@763 199 .PHONY: all clean prep $(PHONY_LIST)
ohair@763 200
ohair@763 201 ################################################################
ohair@763 202

mercurial