annotate test/Makefile @ 2831:6fd81579526f

7102044: G1: VM crashes with assert(old_end != new_end) failed: don't call this otherwise Summary: arrayOopDesc::max_array_length() should return a value that does not overflow a size_t if it is converted to bytes. Reviewed-by: kvn, dholmes
author brutisso
date Mon, 31 Oct 2011 08:01:20 +0100
parents f08d439fab8c
children 2d503de963b3
rev   line source
duke@0 1 #
brutisso@2831 2 # Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved.
duke@0 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@0 4 #
duke@0 5 # This code is free software; you can redistribute it and/or modify it
duke@0 6 # under the terms of the GNU General Public License version 2 only, as
duke@0 7 # published by the Free Software Foundation.
duke@0 8 #
duke@0 9 # This code is distributed in the hope that it will be useful, but WITHOUT
duke@0 10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@0 11 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@0 12 # version 2 for more details (a copy is included in the LICENSE file that
duke@0 13 # accompanied this code).
duke@0 14 #
duke@0 15 # You should have received a copy of the GNU General Public License version
duke@0 16 # 2 along with this work; if not, write to the Free Software Foundation,
duke@0 17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@0 18 #
trims@1472 19 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
trims@1472 20 # or visit www.oracle.com if you need additional information or have any
trims@1472 21 # questions.
ohair@328 22 #
duke@0 23 #
duke@0 24
duke@0 25 #
ohair@328 26 # Makefile to run various jdk tests
duke@0 27 #
duke@0 28
ohair@328 29 # Get OS/ARCH specifics
duke@0 30 OSNAME = $(shell uname -s)
duke@0 31 ifeq ($(OSNAME), SunOS)
duke@0 32 PLATFORM = solaris
twisti@560 33 SLASH_JAVA = /java
duke@0 34 ARCH = $(shell uname -p)
duke@0 35 ifeq ($(ARCH), i386)
duke@0 36 ARCH=i586
duke@0 37 endif
duke@0 38 endif
duke@0 39 ifeq ($(OSNAME), Linux)
duke@0 40 PLATFORM = linux
twisti@560 41 SLASH_JAVA = /java
duke@0 42 ARCH = $(shell uname -m)
duke@0 43 ifeq ($(ARCH), i386)
ohair@328 44 ARCH = i586
duke@0 45 endif
duke@0 46 endif
never@2721 47 ifeq ($(OSNAME), Darwin)
never@2721 48 PLATFORM = bsd
never@2721 49 SLASH_JAVA = /java
never@2721 50 ARCH = $(shell uname -m)
never@2721 51 ifeq ($(ARCH), i386)
never@2721 52 ARCH = i586
never@2721 53 endif
never@2721 54 endif
never@2721 55 ifeq ($(findstring BSD,$(OSNAME)), BSD)
never@2721 56 PLATFORM = bsd
never@2721 57 SLASH_JAVA = /java
never@2721 58 ARCH = $(shell uname -m)
never@2721 59 ifeq ($(ARCH), i386)
never@2721 60 ARCH = i586
never@2721 61 endif
never@2721 62 endif
duke@0 63 ifeq ($(OSNAME), Windows_NT)
duke@0 64 PLATFORM = windows
ohair@328 65 SLASH_JAVA = J:
duke@0 66 ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)),ia64)
ohair@328 67 ARCH = ia64
duke@0 68 else
duke@0 69 ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)),AMD64)
ohair@328 70 ARCH = x64
duke@0 71 else
duke@0 72 ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)),EM64T)
ohair@328 73 ARCH = x64
duke@0 74 else
ohair@328 75 ARCH = i586
duke@0 76 endif
duke@0 77 endif
duke@0 78 endif
ohair@328 79 EXESUFFIX = .exe
duke@0 80 endif
duke@0 81
twisti@560 82 ifdef ALT_SLASH_JAVA
twisti@560 83 SLASH_JAVA = $(ALT_SLASH_JAVA)
twisti@560 84 endif
twisti@560 85
ohair@328 86 # Utilities used
ohair@328 87 CD = cd
ohair@328 88 CP = cp
ohair@328 89 ECHO = echo
ohair@328 90 MKDIR = mkdir
ohair@328 91 ZIP = zip
duke@0 92
ohair@328 93 # Root of this test area (important to use full paths in some places)
ohair@328 94 TEST_ROOT := $(shell pwd)
ohair@328 95
ohair@328 96 # Root of all test results
twisti@1821 97 ifdef ALT_OUTPUTDIR
twisti@1821 98 ABS_BUILD_ROOT = $(ALT_OUTPUTDIR)/$(PLATFORM)-$(ARCH)
twisti@1821 99 else
twisti@1821 100 ABS_BUILD_ROOT = $(TEST_ROOT)/../build/$(PLATFORM)-$(ARCH)
twisti@1821 101 endif
ohair@328 102 ABS_TEST_OUTPUT_DIR = $(ABS_BUILD_ROOT)/testoutput
ohair@328 103
ohair@328 104 # Expect JPRT to set PRODUCT_HOME (the product or jdk in this case to test)
ohair@328 105 ifndef PRODUCT_HOME
ohair@328 106 # Try to use j2sdk-image if it exists
ohair@328 107 ABS_JDK_IMAGE = $(ABS_BUILD_ROOT)/j2sdk-image
ohair@328 108 PRODUCT_HOME := \
ohair@328 109 $(shell \
ohair@328 110 if [ -d $(ABS_JDK_IMAGE) ] ; then \
ohair@328 111 $(ECHO) "$(ABS_JDK_IMAGE)"; \
ohair@328 112 else \
ohair@328 113 $(ECHO) "$(ABS_BUILD_ROOT)" ; \
ohair@328 114 fi)
duke@0 115 endif
duke@0 116
ohair@328 117 # Expect JPRT to set JAVA_ARGS (e.g. -server etc.)
ohair@328 118 JAVA_OPTIONS =
ohair@328 119 ifdef JAVA_ARGS
ohair@328 120 JAVA_OPTIONS = $(JAVA_ARGS)
ohair@328 121 endif
duke@0 122
ohair@328 123 # Expect JPRT to set JPRT_ARCHIVE_BUNDLE (path to zip bundle for results)
ohair@328 124 ARCHIVE_BUNDLE = $(ABS_TEST_OUTPUT_DIR)/ARCHIVE_BUNDLE.zip
ohair@328 125 ifdef JPRT_ARCHIVE_BUNDLE
ohair@328 126 ARCHIVE_BUNDLE = $(JPRT_ARCHIVE_BUNDLE)
ohair@328 127 endif
duke@0 128
ohair@328 129 # How to create the test bundle (pass or fail, we want to create this)
ohair@328 130 BUNDLE_UP = ( $(MKDIR) -p `dirname $(ARCHIVE_BUNDLE)` \
ohair@328 131 && $(CD) $(ABS_TEST_OUTPUT_DIR) \
ohair@328 132 && $(ZIP) -q -r $(ARCHIVE_BUNDLE) . )
ohair@328 133 BUNDLE_UP_FAILED = ( exitCode=$$? && $(BUNDLE_UP) && exit $${exitCode} )
duke@0 134
ohair@328 135 ################################################################
duke@0 136
ohair@328 137 # Default make rule (runs jtreg_tests)
ohair@328 138 all: jtreg_tests
ohair@328 139 @$(ECHO) "Testing completed successfully"
duke@0 140
ohair@328 141 # Prep for output
ohair@328 142 prep: clean
ohair@328 143 @$(MKDIR) -p $(ABS_TEST_OUTPUT_DIR)
ohair@328 144 @$(MKDIR) -p `dirname $(ARCHIVE_BUNDLE)`
duke@0 145
duke@0 146 # Cleanup
duke@0 147 clean:
ohair@328 148 $(RM) -r $(ABS_TEST_OUTPUT_DIR)
ohair@328 149 $(RM) $(ARCHIVE_BUNDLE)
duke@0 150
ohair@328 151 ################################################################
duke@0 152
ohair@328 153 # jtreg tests
ohair@328 154
ohair@328 155 # Expect JT_HOME to be set for jtreg tests. (home for jtreg)
ohair@328 156 JT_HOME = $(SLASH_JAVA)/re/jtreg/4.0/promoted/latest/binaries/jtreg
ohair@328 157 ifdef JPRT_JTREG_HOME
ohair@328 158 JT_HOME = $(JPRT_JTREG_HOME)
ohair@328 159 endif
ohair@328 160
ohair@328 161 # Expect JPRT to set TESTDIRS to the jtreg test dirs
ohair@328 162 JTREG_TESTDIRS = demo/jvmti/gctest demo/jvmti/hprof
ohair@328 163 ifdef TESTDIRS
ohair@328 164 JTREG_TESTDIRS = $(TESTDIRS)
ohair@328 165 endif
ohair@328 166
ohair@328 167 # Default JTREG to run (win32 script works for everybody)
ohair@328 168 JTREG = $(JT_HOME)/win32/bin/jtreg
ohair@328 169
ohair@328 170 # Option to tell jtreg to not run tests marked with "ignore"
ohair@328 171 ifeq ($(PLATFORM), windows)
ohair@328 172 JTREG_KEY_OPTION = -k:!ignore
ohair@328 173 else
ohair@328 174 JTREG_KEY_OPTION = -k:\!ignore
ohair@328 175 endif
ohair@328 176
ohair@328 177 #EXTRA_JTREG_OPTIONS =
ohair@328 178
ohair@328 179 jtreg_tests: prep $(JT_HOME) $(PRODUCT_HOME) $(JTREG)
ohair@328 180 $(JTREG) -a -v:fail,error \
ohair@328 181 $(JTREG_KEY_OPTION) \
ohair@328 182 $(EXTRA_JTREG_OPTIONS) \
ohair@328 183 -r:$(ABS_TEST_OUTPUT_DIR)/JTreport \
ohair@328 184 -w:$(ABS_TEST_OUTPUT_DIR)/JTwork \
ohair@328 185 -jdk:$(PRODUCT_HOME) \
ohair@328 186 $(JAVA_OPTIONS:%=-vmoption:%) \
ohair@328 187 $(JTREG_TESTDIRS) \
ohair@328 188 || $(BUNDLE_UP_FAILED)
ohair@328 189 $(BUNDLE_UP)
ohair@328 190
ohair@328 191 PHONY_LIST += jtreg_tests
ohair@328 192
ohair@328 193 ################################################################
ohair@328 194
ohair@781 195 # clienttest (make sure various basic java client options work)
ohair@781 196
ohair@781 197 clienttest: prep $(PRODUCT_HOME)
ohair@781 198 $(PRODUCT_HOME)/bin/java $(JAVA_OPTIONS) -version
ohair@781 199 $(PRODUCT_HOME)/bin/java $(JAVA_OPTIONS) -help
ohair@781 200 $(PRODUCT_HOME)/bin/java $(JAVA_OPTIONS) -X
ohair@781 201 $(RM) $(PRODUCT_HOME)/jre/lib/*/client/classes.jsa
ohair@781 202 $(RM) $(PRODUCT_HOME)/jre/lib/*/client/classes_g.jsa
ohair@781 203 $(RM) $(PRODUCT_HOME)/jre/bin/client/classes.jsa
ohair@781 204 $(RM) $(PRODUCT_HOME)/jre/bin/client/classes_g.jsa
ohair@781 205 $(PRODUCT_HOME)/bin/java $(JAVA_OPTIONS) -Xshare:dump
ohair@781 206
ohair@781 207 PHONY_LIST += clienttest
ohair@781 208
ohair@781 209 ################################################################
ohair@781 210
ohair@781 211 # servertest (make sure various basic java server options work)
ohair@781 212
ohair@781 213 servertest: prep $(PRODUCT_HOME)
ohair@781 214 $(PRODUCT_HOME)/bin/java $(JAVA_OPTIONS) -version
ohair@781 215 $(PRODUCT_HOME)/bin/java $(JAVA_OPTIONS) -help
ohair@781 216 $(PRODUCT_HOME)/bin/java $(JAVA_OPTIONS) -X
ohair@781 217
ohair@781 218 PHONY_LIST += servertest
ohair@781 219
ohair@781 220 ################################################################
ohair@781 221
brutisso@2831 222 # internalvmtests (run internal unit tests inside the VM)
brutisso@2831 223
brutisso@2831 224 internalvmtests: prep $(PRODUCT_HOME)
brutisso@2831 225 $(PRODUCT_HOME)/bin/java $(JAVA_OPTIONS) -XX:+ExecuteInternalVMTests -version
brutisso@2831 226
brutisso@2831 227 PHONY_LIST += internalvmtests
brutisso@2831 228
brutisso@2831 229 ################################################################
brutisso@2831 230
ohair@328 231 # packtest
ohair@328 232
ohair@328 233 # Expect JPRT to set JPRT_PACKTEST_HOME.
ohair@328 234 PACKTEST_HOME = /net/jprt-web.sfbay.sun.com/jprt/allproducts/packtest
ohair@328 235 ifdef JPRT_PACKTEST_HOME
ohair@328 236 PACKTEST_HOME = $(JPRT_PACKTEST_HOME)
ohair@328 237 endif
ohair@328 238
ohair@328 239 #EXTRA_PACKTEST_OPTIONS =
ohair@328 240
ohair@328 241 packtest: prep $(PACKTEST_HOME)/ptest $(PRODUCT_HOME)
ohair@328 242 ( $(CD) $(PACKTEST_HOME) && \
ohair@328 243 $(PACKTEST_HOME)/ptest \
ohair@328 244 -t "$(PRODUCT_HOME)" \
ohair@328 245 $(PACKTEST_STRESS_OPTION) \
ohair@328 246 $(EXTRA_PACKTEST_OPTIONS) \
ohair@328 247 -W $(ABS_TEST_OUTPUT_DIR) \
ohair@328 248 $(JAVA_OPTIONS:%=-J %) \
ohair@328 249 ) || $(BUNDLE_UP_FAILED)
ohair@328 250 $(BUNDLE_UP)
ohair@328 251
ohair@328 252 packtest_stress: PACKTEST_STRESS_OPTION=-s
ohair@328 253 packtest_stress: packtest
ohair@328 254
ohair@328 255 PHONY_LIST += packtest packtest_stress
ohair@328 256
ohair@328 257 ################################################################
ohair@328 258
ohair@328 259 # Phony targets (e.g. these are not filenames)
ohair@328 260 .PHONY: all clean prep $(PHONY_LIST)
ohair@328 261
ohair@328 262 ################################################################
ohair@328 263