J. Duke | 319a3b9 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 1 | # |
Kelly O'Hair | e4fce69 | 2010-03-06 14:59:23 -0800 | [diff] [blame] | 2 | # Copyright 1995-2010 Sun Microsystems, Inc. All Rights Reserved. |
Kelly O'Hair | 53b5f6a | 2009-03-31 16:12:56 -0700 | [diff] [blame] | 3 | # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
| 4 | # |
| 5 | # This code is free software; you can redistribute it and/or modify it |
| 6 | # under the terms of the GNU General Public License version 2 only, as |
| 7 | # published by the Free Software Foundation. Sun designates this |
| 8 | # particular file as subject to the "Classpath" exception as provided |
| 9 | # by Sun in the LICENSE file that accompanied this code. |
| 10 | # |
| 11 | # This code is distributed in the hope that it will be useful, but WITHOUT |
| 12 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 13 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
| 14 | # version 2 for more details (a copy is included in the LICENSE file that |
| 15 | # accompanied this code). |
| 16 | # |
| 17 | # You should have received a copy of the GNU General Public License version |
| 18 | # 2 along with this work; if not, write to the Free Software Foundation, |
| 19 | # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
| 20 | # |
| 21 | # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, |
| 22 | # CA 95054 USA or visit www.sun.com if you need additional information or |
| 23 | # have any questions. |
| 24 | # |
| 25 | |
| 26 | # |
| 27 | # Makefile to run various jdk tests |
J. Duke | 319a3b9 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 28 | # |
| 29 | |
Kelly O'Hair | d125892 | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 30 | # Empty these to get rid of some default rules |
| 31 | .SUFFIXES: |
| 32 | .SUFFIXES: .java |
| 33 | CO= |
| 34 | GET= |
| 35 | |
| 36 | # Utilities used |
| 37 | AWK = awk |
| 38 | CAT = cat |
| 39 | CD = cd |
Kelly O'Hair | d125892 | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 40 | CP = cp |
| 41 | CUT = cut |
| 42 | ECHO = echo |
| 43 | EGREP = egrep |
| 44 | EXPAND = expand |
Kelly O'Hair | d125892 | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 45 | MKDIR = mkdir |
Kelly O'Hair | d125892 | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 46 | PWD = pwd |
| 47 | SED = sed |
Kelly O'Hair | d125892 | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 48 | SORT = sort |
| 49 | TEE = tee |
| 50 | UNAME = uname |
| 51 | UNIQ = uniq |
| 52 | WC = wc |
Kelly O'Hair | d125892 | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 53 | ZIP = zip |
| 54 | |
| 55 | # Get OS name from uname |
| 56 | UNAME_S := $(shell $(UNAME) -s) |
Kelly O'Hair | 53b5f6a | 2009-03-31 16:12:56 -0700 | [diff] [blame] | 57 | |
| 58 | # Commands to run on paths to make mixed paths for java on windows |
Kelly O'Hair | d125892 | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 59 | GETMIXEDPATH=$(ECHO) |
Kelly O'Hair | 53b5f6a | 2009-03-31 16:12:56 -0700 | [diff] [blame] | 60 | |
| 61 | # Location of developer shared files |
| 62 | SLASH_JAVA = /java |
| 63 | |
| 64 | # Platform specific settings |
Kelly O'Hair | d125892 | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 65 | ifeq ($(UNAME_S), SunOS) |
| 66 | OS_NAME = solaris |
| 67 | OS_ARCH := $(shell $(UNAME) -p) |
| 68 | OS_VERSION := $(shell $(UNAME) -r) |
J. Duke | 319a3b9 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 69 | endif |
Kelly O'Hair | d125892 | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 70 | ifeq ($(UNAME_S), Linux) |
| 71 | OS_NAME = linux |
| 72 | OS_ARCH := $(shell $(UNAME) -m) |
Kelly O'Hair | 7913295 | 2010-03-12 09:03:02 -0800 | [diff] [blame^] | 73 | # Check for unknown arch, try uname -p if uname -m says unknown |
| 74 | ifeq ($(OS_ARCH),unknown) |
| 75 | OS_ARCH := $(shell $(UNAME) -p) |
| 76 | endif |
Kelly O'Hair | d125892 | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 77 | OS_VERSION := $(shell $(UNAME) -r) |
J. Duke | 319a3b9 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 78 | endif |
Kelly O'Hair | d125892 | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 79 | ifndef OS_NAME |
| 80 | ifneq ($(PROCESSOR_IDENTIFIER), ) |
| 81 | OS_NAME = windows |
| 82 | SLASH_JAVA = J: |
| 83 | # A variety of ways to say X64 arch :^( |
| 84 | OS_ARCH:=$(word 1, $(PROCESSOR_IDENTIFIER)) |
| 85 | EXESUFFIX = .exe |
| 86 | # These need to be different depending on MKS or CYGWIN |
| 87 | ifeq ($(findstring cygdrive,$(shell ($(CD) C:/ && $(PWD)))), ) |
| 88 | GETMIXEDPATH = dosname -s |
| 89 | OS_VERSION := $(shell $(UNAME) -r) |
J. Duke | 319a3b9 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 90 | else |
Kelly O'Hair | d125892 | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 91 | GETMIXEDPATH = cygpath -m -s |
| 92 | OS_VERSION := $(shell $(UNAME) -s | $(CUT) -d'-' -f2) |
J. Duke | 319a3b9 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 93 | endif |
| 94 | endif |
Kelly O'Hair | d125892 | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 95 | endif |
| 96 | |
| 97 | # Only want major and minor numbers from os version |
| 98 | OS_VERSION := $(shell $(ECHO) "$(OS_VERSION)" | $(CUT) -d'.' -f1,2) |
| 99 | |
Kelly O'Hair | 7913295 | 2010-03-12 09:03:02 -0800 | [diff] [blame^] | 100 | # Name to use for x86_64 arch (historically amd64, but should change someday) |
| 101 | OS_ARCH_X64_NAME:=amd64 |
| 102 | #OS_ARCH_X64_NAME:=x64 |
| 103 | |
| 104 | # Alternate arch names (in case this arch is known by a second name) |
| 105 | # PROBLEM_LISTS may use either name. |
| 106 | OS_ARCH2-amd64:=x64 |
| 107 | #OS_ARCH2-x64:=amd64 |
| 108 | |
| 109 | # Try and use the arch names consistently |
| 110 | OS_ARCH:=$(subst x64,$(OS_ARCH_X64_NAME),$(OS_ARCH)) |
| 111 | OS_ARCH:=$(subst X64,$(OS_ARCH_X64_NAME),$(OS_ARCH)) |
| 112 | OS_ARCH:=$(subst AMD64,$(OS_ARCH_X64_NAME),$(OS_ARCH)) |
| 113 | OS_ARCH:=$(subst amd64,$(OS_ARCH_X64_NAME),$(OS_ARCH)) |
| 114 | OS_ARCH:=$(subst x86_64,$(OS_ARCH_X64_NAME),$(OS_ARCH)) |
| 115 | OS_ARCH:=$(subst EM64T,$(OS_ARCH_X64_NAME),$(OS_ARCH)) |
| 116 | OS_ARCH:=$(subst em64t,$(OS_ARCH_X64_NAME),$(OS_ARCH)) |
| 117 | OS_ARCH:=$(subst intel64,$(OS_ARCH_X64_NAME),$(OS_ARCH)) |
| 118 | OS_ARCH:=$(subst Intel64,$(OS_ARCH_X64_NAME),$(OS_ARCH)) |
| 119 | OS_ARCH:=$(subst INTEL64,$(OS_ARCH_X64_NAME),$(OS_ARCH)) |
Kelly O'Hair | d125892 | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 120 | OS_ARCH:=$(subst IA64,ia64,$(OS_ARCH)) |
| 121 | OS_ARCH:=$(subst X86,i586,$(OS_ARCH)) |
| 122 | OS_ARCH:=$(subst x86,i586,$(OS_ARCH)) |
| 123 | OS_ARCH:=$(subst i386,i586,$(OS_ARCH)) |
| 124 | OS_ARCH:=$(subst i486,i586,$(OS_ARCH)) |
| 125 | OS_ARCH:=$(subst i686,i586,$(OS_ARCH)) |
| 126 | |
Kelly O'Hair | 7913295 | 2010-03-12 09:03:02 -0800 | [diff] [blame^] | 127 | # Default ARCH_DATA_MODEL settings |
| 128 | ARCH_DATA_MODEL-i586 = 32 |
| 129 | ARCH_DATA_MODEL-$(OS_ARCH_X64_NAME) = 64 |
| 130 | ARCH_DATA_MODEL-ia64 = 64 |
| 131 | ARCH_DATA_MODEL-sparc = 32 |
| 132 | ARCH_DATA_MODEL-sparcv9 = 64 |
| 133 | |
| 134 | # If ARCH_DATA_MODEL is not defined, try and pick a reasonable default |
| 135 | ifndef ARCH_DATA_MODEL |
| 136 | ARCH_DATA_MODEL:=$(ARCH_DATA_MODEL-$(OS_ARCH)) |
| 137 | endif |
Kelly O'Hair | d125892 | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 138 | ifndef ARCH_DATA_MODEL |
| 139 | ARCH_DATA_MODEL=32 |
| 140 | endif |
Kelly O'Hair | 7913295 | 2010-03-12 09:03:02 -0800 | [diff] [blame^] | 141 | |
| 142 | # Platform directory name |
| 143 | PLATFORM_OS = $(OS_NAME)-$(OS_ARCH) |
| 144 | |
| 145 | # Check ARCH_DATA_MODEL, adjust OS_ARCH accordingly on solaris |
Kelly O'Hair | d125892 | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 146 | ARCH_DATA_MODEL_ERROR= \ |
Kelly O'Hair | 7913295 | 2010-03-12 09:03:02 -0800 | [diff] [blame^] | 147 | ARCH_DATA_MODEL=$(ARCH_DATA_MODEL) cannot be used with $(PLATFORM_OS) |
Kelly O'Hair | d125892 | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 148 | ifeq ($(ARCH_DATA_MODEL),64) |
Kelly O'Hair | 7913295 | 2010-03-12 09:03:02 -0800 | [diff] [blame^] | 149 | ifeq ($(PLATFORM_OS),solaris-i586) |
| 150 | OS_ARCH=$(OS_ARCH_X64_NAME) |
Kelly O'Hair | d125892 | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 151 | endif |
Kelly O'Hair | 7913295 | 2010-03-12 09:03:02 -0800 | [diff] [blame^] | 152 | ifeq ($(PLATFORM_OS),solaris-sparc) |
Kelly O'Hair | d125892 | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 153 | OS_ARCH=sparcv9 |
| 154 | endif |
| 155 | ifeq ($(OS_ARCH),i586) |
| 156 | x:=$(warning "WARNING: $(ARCH_DATA_MODEL_ERROR)") |
| 157 | endif |
| 158 | ifeq ($(OS_ARCH),sparc) |
| 159 | x:=$(warning "WARNING: $(ARCH_DATA_MODEL_ERROR)") |
| 160 | endif |
| 161 | else |
| 162 | ifeq ($(ARCH_DATA_MODEL),32) |
Kelly O'Hair | 7913295 | 2010-03-12 09:03:02 -0800 | [diff] [blame^] | 163 | ifeq ($(OS_ARCH),$(OS_ARCH_X64_NAME)) |
Kelly O'Hair | d125892 | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 164 | x:=$(warning "WARNING: $(ARCH_DATA_MODEL_ERROR)") |
| 165 | endif |
| 166 | ifeq ($(OS_ARCH),ia64) |
| 167 | x:=$(warning "WARNING: $(ARCH_DATA_MODEL_ERROR)") |
| 168 | endif |
| 169 | ifeq ($(OS_ARCH),sparcv9) |
| 170 | x:=$(warning "WARNING: $(ARCH_DATA_MODEL_ERROR)") |
| 171 | endif |
Kelly O'Hair | 53b5f6a | 2009-03-31 16:12:56 -0700 | [diff] [blame] | 172 | else |
Kelly O'Hair | d125892 | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 173 | x:=$(warning "WARNING: $(ARCH_DATA_MODEL_ERROR)") |
Kelly O'Hair | 53b5f6a | 2009-03-31 16:12:56 -0700 | [diff] [blame] | 174 | endif |
J. Duke | 319a3b9 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 175 | endif |
| 176 | |
Kelly O'Hair | 7913295 | 2010-03-12 09:03:02 -0800 | [diff] [blame^] | 177 | # Alternate OS_ARCH name (defaults to OS_ARCH) |
| 178 | OS_ARCH2:=$(OS_ARCH2-$(OS_ARCH)) |
| 179 | ifeq ($(OS_ARCH2),) |
| 180 | OS_ARCH2:=$(OS_ARCH) |
| 181 | endif |
| 182 | |
J. Duke | 319a3b9 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 183 | # Root of this test area (important to use full paths in some places) |
Kelly O'Hair | d125892 | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 184 | TEST_ROOT := $(shell $(PWD)) |
J. Duke | 319a3b9 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 185 | |
Kelly O'Hair | 53b5f6a | 2009-03-31 16:12:56 -0700 | [diff] [blame] | 186 | # Root of all test results |
| 187 | ifdef ALT_OUTPUTDIR |
| 188 | ABS_OUTPUTDIR = $(ALT_OUTPUTDIR) |
J. Duke | 319a3b9 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 189 | else |
Kelly O'Hair | 7913295 | 2010-03-12 09:03:02 -0800 | [diff] [blame^] | 190 | ABS_OUTPUTDIR = $(TEST_ROOT)/../build/$(PLATFORM_OS) |
Kelly O'Hair | 53b5f6a | 2009-03-31 16:12:56 -0700 | [diff] [blame] | 191 | endif |
Kelly O'Hair | 7913295 | 2010-03-12 09:03:02 -0800 | [diff] [blame^] | 192 | ABS_PLATFORM_BUILD_ROOT = $(ABS_OUTPUTDIR) |
| 193 | ABS_TEST_OUTPUT_DIR := $(ABS_PLATFORM_BUILD_ROOT)/testoutput/$(UNIQUE_DIR) |
Kelly O'Hair | 53b5f6a | 2009-03-31 16:12:56 -0700 | [diff] [blame] | 194 | |
| 195 | # Expect JPRT to set PRODUCT_HOME (the product or jdk in this case to test) |
| 196 | ifndef PRODUCT_HOME |
| 197 | # Try to use j2sdk-image if it exists |
Kelly O'Hair | 7913295 | 2010-03-12 09:03:02 -0800 | [diff] [blame^] | 198 | ABS_JDK_IMAGE = $(ABS_PLATFORM_BUILD_ROOT)/j2sdk-image |
| 199 | PRODUCT_HOME := \ |
| 200 | $(shell \ |
| 201 | if [ -d $(ABS_JDK_IMAGE) ] ; then \ |
| 202 | $(ECHO) "$(ABS_JDK_IMAGE)"; \ |
| 203 | else \ |
| 204 | $(ECHO) "$(ABS_PLATFORM_BUILD_ROOT)"; \ |
Kelly O'Hair | 53b5f6a | 2009-03-31 16:12:56 -0700 | [diff] [blame] | 205 | fi) |
| 206 | PRODUCT_HOME := $(PRODUCT_HOME) |
J. Duke | 319a3b9 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 207 | endif |
| 208 | |
Kelly O'Hair | 53b5f6a | 2009-03-31 16:12:56 -0700 | [diff] [blame] | 209 | # Expect JPRT to set JPRT_PRODUCT_ARGS (e.g. -server etc.) |
| 210 | # Should be passed into 'java' only. |
Kelly O'Hair | d125892 | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 211 | # Could include: -d64 -server -client OR any java option |
Kelly O'Hair | 53b5f6a | 2009-03-31 16:12:56 -0700 | [diff] [blame] | 212 | ifdef JPRT_PRODUCT_ARGS |
| 213 | JAVA_ARGS = $(JPRT_PRODUCT_ARGS) |
| 214 | endif |
J. Duke | 319a3b9 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 215 | |
Kelly O'Hair | 53b5f6a | 2009-03-31 16:12:56 -0700 | [diff] [blame] | 216 | # Expect JPRT to set JPRT_PRODUCT_VM_ARGS (e.g. -Xcomp etc.) |
| 217 | # Should be passed into anything running the vm (java, javac, javadoc, ...). |
| 218 | ifdef JPRT_PRODUCT_VM_ARGS |
| 219 | JAVA_VM_ARGS = $(JPRT_PRODUCT_VM_ARGS) |
| 220 | endif |
J. Duke | 319a3b9 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 221 | |
Kelly O'Hair | d125892 | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 222 | # Check JAVA_ARGS arguments based on ARCH_DATA_MODEL etc. |
| 223 | ifeq ($(OS_NAME),solaris) |
| 224 | D64_ERROR_MESSAGE=Mismatch between ARCH_DATA_MODEL=$(ARCH_DATA_MODEL) and use of -d64 in JAVA_ARGS=$(JAVA_ARGS) |
| 225 | ifeq ($(ARCH_DATA_MODEL),32) |
| 226 | ifneq ($(findstring -d64,$(JAVA_ARGS)),) |
| 227 | x:=$(warning "WARNING: $(D64_ERROR_MESSAGE)") |
| 228 | endif |
| 229 | endif |
| 230 | ifeq ($(ARCH_DATA_MODEL),64) |
| 231 | ifeq ($(findstring -d64,$(JAVA_ARGS)),) |
| 232 | x:=$(warning "WARNING: $(D64_ERROR_MESSAGE)") |
| 233 | endif |
| 234 | endif |
| 235 | endif |
| 236 | |
Kelly O'Hair | 53b5f6a | 2009-03-31 16:12:56 -0700 | [diff] [blame] | 237 | # Expect JPRT to set JPRT_ARCHIVE_BUNDLE (path to zip bundle for results) |
| 238 | ARCHIVE_BUNDLE = $(ABS_TEST_OUTPUT_DIR)/ARCHIVE_BUNDLE.zip |
| 239 | ifdef JPRT_ARCHIVE_BUNDLE |
| 240 | ARCHIVE_BUNDLE = $(JPRT_ARCHIVE_BUNDLE) |
| 241 | endif |
J. Duke | 319a3b9 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 242 | |
Kelly O'Hair | 53b5f6a | 2009-03-31 16:12:56 -0700 | [diff] [blame] | 243 | # How to create the test bundle (pass or fail, we want to create this) |
| 244 | # Follow command with ";$(BUNDLE_UP_AND_EXIT)", so it always gets executed. |
| 245 | ZIP_UP_RESULTS = ( $(MKDIR) -p `dirname $(ARCHIVE_BUNDLE)` \ |
| 246 | && $(CD) $(ABS_TEST_OUTPUT_DIR) \ |
| 247 | && $(ZIP) -q -r $(ARCHIVE_BUNDLE) . ) |
Kelly O'Hair | d125892 | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 248 | SUMMARY_TXT = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/JTreport/text/summary.txt |
| 249 | STATS_TXT_NAME = Stats.txt |
| 250 | STATS_TXT = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/$(STATS_TXT_NAME) |
| 251 | RUNLIST = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/runlist.txt |
| 252 | PASSLIST = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/passlist.txt |
| 253 | FAILLIST = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/faillist.txt |
Kelly O'Hair | 0ce235a | 2009-12-01 08:51:16 -0800 | [diff] [blame] | 254 | EXITCODE = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/exitcode.txt |
| 255 | |
| 256 | TESTEXIT = \ |
| 257 | if [ ! -s $(EXITCODE) ] ; then \ |
| 258 | $(ECHO) "ERROR: EXITCODE file not filled in."; \ |
| 259 | $(ECHO) "1" > $(EXITCODE); \ |
| 260 | fi ; \ |
| 261 | testExitCode=`$(CAT) $(EXITCODE)`; \ |
| 262 | $(ECHO) "EXIT CODE: $${testExitCode}"; \ |
Kelly O'Hair | 61c0915 | 2009-12-09 09:46:57 -0800 | [diff] [blame] | 263 | exit $${testExitCode} |
Kelly O'Hair | 0ce235a | 2009-12-01 08:51:16 -0800 | [diff] [blame] | 264 | |
Kelly O'Hair | d125892 | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 265 | BUNDLE_UP_AND_EXIT = \ |
| 266 | ( \ |
Kelly O'Hair | 0ce235a | 2009-12-01 08:51:16 -0800 | [diff] [blame] | 267 | jtregExitCode=$$? && \ |
Kelly O'Hair | d125892 | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 268 | _summary="$(SUMMARY_TXT)"; \ |
Kelly O'Hair | 0ce235a | 2009-12-01 08:51:16 -0800 | [diff] [blame] | 269 | $(RM) -f $(STATS_TXT) $(RUNLIST) $(PASSLIST) $(FAILLIST) $(EXITCODE); \ |
| 270 | $(ECHO) "$${jtregExitCode}" > $(EXITCODE); \ |
Kelly O'Hair | d125892 | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 271 | if [ -r "$${_summary}" ] ; then \ |
Kelly O'Hair | 61c0915 | 2009-12-09 09:46:57 -0800 | [diff] [blame] | 272 | $(ECHO) "Summary: $(UNIQUE_DIR)" > $(STATS_TXT); \ |
Kelly O'Hair | d125892 | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 273 | $(EXPAND) $${_summary} | $(EGREP) -v ' Not run\.' > $(RUNLIST); \ |
| 274 | $(EGREP) ' Passed\.' $(RUNLIST) \ |
| 275 | | $(EGREP) -v ' Error\.' \ |
| 276 | | $(EGREP) -v ' Failed\.' > $(PASSLIST); \ |
| 277 | ( $(EGREP) ' Failed\.' $(RUNLIST); \ |
| 278 | $(EGREP) ' Error\.' $(RUNLIST); \ |
| 279 | $(EGREP) -v ' Passed\.' $(RUNLIST) ) \ |
| 280 | | $(SORT) | $(UNIQ) > $(FAILLIST); \ |
Kelly O'Hair | 0ce235a | 2009-12-01 08:51:16 -0800 | [diff] [blame] | 281 | if [ $${jtregExitCode} != 0 -o -s $(FAILLIST) ] ; then \ |
Kelly O'Hair | d125892 | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 282 | $(EXPAND) $(FAILLIST) \ |
| 283 | | $(CUT) -d' ' -f1 \ |
| 284 | | $(SED) -e 's@^@FAILED: @' >> $(STATS_TXT); \ |
Kelly O'Hair | 0ce235a | 2009-12-01 08:51:16 -0800 | [diff] [blame] | 285 | if [ $${jtregExitCode} = 0 ] ; then \ |
| 286 | jtregExitCode=1; \ |
| 287 | fi; \ |
Kelly O'Hair | d125892 | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 288 | fi; \ |
| 289 | runc="`$(CAT) $(RUNLIST) | $(WC) -l | $(AWK) '{print $$1;}'`"; \ |
| 290 | passc="`$(CAT) $(PASSLIST) | $(WC) -l | $(AWK) '{print $$1;}'`"; \ |
| 291 | failc="`$(CAT) $(FAILLIST) | $(WC) -l | $(AWK) '{print $$1;}'`"; \ |
| 292 | exclc="`$(CAT) $(EXCLUDELIST) | $(WC) -l | $(AWK) '{print $$1;}'`"; \ |
| 293 | $(ECHO) "TEST STATS: run=$${runc} pass=$${passc} fail=$${failc} excluded=$${exclc}" \ |
| 294 | >> $(STATS_TXT); \ |
| 295 | else \ |
| 296 | $(ECHO) "Missing file: $${_summary}" >> $(STATS_TXT); \ |
| 297 | fi; \ |
| 298 | $(CAT) $(STATS_TXT); \ |
Kelly O'Hair | e4fce69 | 2010-03-06 14:59:23 -0800 | [diff] [blame] | 299 | $(ZIP_UP_RESULTS) ; \ |
Kelly O'Hair | 0ce235a | 2009-12-01 08:51:16 -0800 | [diff] [blame] | 300 | $(TESTEXIT) \ |
Kelly O'Hair | d125892 | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 301 | ) |
J. Duke | 319a3b9 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 302 | |
Kelly O'Hair | 53b5f6a | 2009-03-31 16:12:56 -0700 | [diff] [blame] | 303 | ################################################################ |
J. Duke | 319a3b9 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 304 | |
Kelly O'Hair | 53b5f6a | 2009-03-31 16:12:56 -0700 | [diff] [blame] | 305 | # Default make rule (runs jtreg_tests) |
| 306 | all: jtreg_tests |
| 307 | @$(ECHO) "Testing completed successfully" |
J. Duke | 319a3b9 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 308 | |
Kelly O'Hair | 53b5f6a | 2009-03-31 16:12:56 -0700 | [diff] [blame] | 309 | # Prep for output |
| 310 | prep: clean |
| 311 | @$(MKDIR) -p $(ABS_TEST_OUTPUT_DIR) |
| 312 | @$(MKDIR) -p `dirname $(ARCHIVE_BUNDLE)` |
J. Duke | 319a3b9 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 313 | |
| 314 | # Cleanup |
| 315 | clean: |
Kelly O'Hair | 53b5f6a | 2009-03-31 16:12:56 -0700 | [diff] [blame] | 316 | $(RM) -r $(ABS_TEST_OUTPUT_DIR) |
| 317 | $(RM) $(ARCHIVE_BUNDLE) |
J. Duke | 319a3b9 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 318 | |
Kelly O'Hair | 53b5f6a | 2009-03-31 16:12:56 -0700 | [diff] [blame] | 319 | ################################################################ |
| 320 | |
| 321 | # jtreg tests |
| 322 | |
| 323 | # Expect JT_HOME to be set for jtreg tests. (home for jtreg) |
Kelly O'Hair | d020b04 | 2009-11-23 09:51:52 -0800 | [diff] [blame] | 324 | ifndef JT_HOME |
| 325 | JT_HOME = $(SLASH_JAVA)/re/jtreg/4.0/promoted/latest/binaries/jtreg |
| 326 | ifdef JPRT_JTREG_HOME |
| 327 | JT_HOME = $(JPRT_JTREG_HOME) |
| 328 | endif |
Kelly O'Hair | 53b5f6a | 2009-03-31 16:12:56 -0700 | [diff] [blame] | 329 | endif |
| 330 | |
| 331 | # Expect JPRT to set TESTDIRS to the jtreg test dirs |
| 332 | ifndef TESTDIRS |
Kelly O'Hair | d125892 | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 333 | TESTDIRS = demo |
Kelly O'Hair | 53b5f6a | 2009-03-31 16:12:56 -0700 | [diff] [blame] | 334 | endif |
| 335 | |
Kelly O'Hair | d125892 | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 336 | # Samevm settings (default is false) |
| 337 | ifndef USE_JTREG_SAMEVM |
| 338 | USE_JTREG_SAMEVM=false |
| 339 | endif |
| 340 | # With samevm, you cannot use -javaoptions? |
| 341 | ifeq ($(USE_JTREG_SAMEVM),true) |
Kelly O'Hair | d44fe66 | 2009-12-11 15:29:22 -0800 | [diff] [blame] | 342 | JTREG_SAMEVM_OPTION = -samevm |
| 343 | EXTRA_JTREG_OPTIONS += $(JTREG_SAMEVM_OPTION) $(JAVA_ARGS) $(JAVA_ARGS:%=-vmoption:%) |
Kelly O'Hair | d125892 | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 344 | JTREG_TEST_OPTIONS = $(JAVA_VM_ARGS:%=-vmoption:%) |
| 345 | else |
| 346 | JTREG_TEST_OPTIONS = $(JAVA_ARGS:%=-javaoptions:%) $(JAVA_VM_ARGS:%=-vmoption:%) |
| 347 | endif |
| 348 | |
| 349 | # Some tests annoy me and fail frequently |
| 350 | PROBLEM_LIST=ProblemList.txt |
Kelly O'Hair | d020b04 | 2009-11-23 09:51:52 -0800 | [diff] [blame] | 351 | PROBLEM_LISTS=$(PROBLEM_LIST) $(wildcard closed/$(PROBLEM_LIST)) |
Kelly O'Hair | d125892 | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 352 | EXCLUDELIST=$(ABS_TEST_OUTPUT_DIR)/excludelist.txt |
| 353 | |
| 354 | # Create exclude list for this platform and arch |
| 355 | ifdef NO_EXCLUDES |
Kelly O'Hair | d020b04 | 2009-11-23 09:51:52 -0800 | [diff] [blame] | 356 | $(EXCLUDELIST): $(PROBLEM_LISTS) $(TESTDIRS) |
Kelly O'Hair | d125892 | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 357 | @$(ECHO) "NOTHING_EXCLUDED" > $@ |
| 358 | else |
Kelly O'Hair | d020b04 | 2009-11-23 09:51:52 -0800 | [diff] [blame] | 359 | $(EXCLUDELIST): $(PROBLEM_LISTS) $(TESTDIRS) |
Kelly O'Hair | d125892 | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 360 | @$(RM) $@ $@.temp1 $@.temp2 |
Kelly O'Hair | d020b04 | 2009-11-23 09:51:52 -0800 | [diff] [blame] | 361 | @(($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- '$(OS_NAME)-all' ) ;\ |
| 362 | ($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- '$(OS_NAME)-$(OS_ARCH)' ) ;\ |
Kelly O'Hair | 7913295 | 2010-03-12 09:03:02 -0800 | [diff] [blame^] | 363 | ($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- '$(OS_NAME)-$(OS_ARCH2)' ) ;\ |
Kelly O'Hair | d020b04 | 2009-11-23 09:51:52 -0800 | [diff] [blame] | 364 | ($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- '$(OS_NAME)-$(OS_VERSION)') ;\ |
| 365 | ($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- 'generic-$(OS_ARCH)' ) ;\ |
Kelly O'Hair | 7913295 | 2010-03-12 09:03:02 -0800 | [diff] [blame^] | 366 | ($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- 'generic-$(OS_ARCH2)' ) ;\ |
Kelly O'Hair | d020b04 | 2009-11-23 09:51:52 -0800 | [diff] [blame] | 367 | ($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- 'generic-all' ) ;\ |
| 368 | ($(ECHO) "#") ;\ |
Kelly O'Hair | d125892 | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 369 | ) | $(SED) -e 's@^[\ ]*@@' \ |
| 370 | | $(EGREP) -v '^#' > $@.temp1 |
| 371 | @for tdir in $(TESTDIRS) ; do \ |
| 372 | ( ( $(CAT) $@.temp1 | $(EGREP) "^$${tdir}" ) ; $(ECHO) "#" ) >> $@.temp2 ; \ |
| 373 | done |
| 374 | @$(ECHO) "# at least one line" >> $@.temp2 |
| 375 | @( $(EGREP) -v '^#' $@.temp2 ; true ) > $@ |
| 376 | @$(ECHO) "Excluding list contains `$(EXPAND) $@ | $(WC) -l` items" |
| 377 | endif |
| 378 | |
Kelly O'Hair | d020b04 | 2009-11-23 09:51:52 -0800 | [diff] [blame] | 379 | # Select list of directories that exist |
| 380 | define TestDirs |
| 381 | $(foreach i,$1,$(wildcard ${i})) $(foreach i,$1,$(wildcard closed/${i})) |
| 382 | endef |
Kelly O'Hair | d125892 | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 383 | # Running batches of tests with or without samevm |
| 384 | define RunSamevmBatch |
Kelly O'Hair | d020b04 | 2009-11-23 09:51:52 -0800 | [diff] [blame] | 385 | $(ECHO) "Running tests in samevm mode: $(call TestDirs, $?)" |
| 386 | $(MAKE) TESTDIRS="$(call TestDirs, $?)" USE_JTREG_SAMEVM=true UNIQUE_DIR=$@ jtreg_tests |
Kelly O'Hair | d125892 | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 387 | endef |
| 388 | define RunOthervmBatch |
Kelly O'Hair | d020b04 | 2009-11-23 09:51:52 -0800 | [diff] [blame] | 389 | $(ECHO) "Running tests in othervm mode: $(call TestDirs, $?)" |
| 390 | $(MAKE) TESTDIRS="$(call TestDirs, $?)" USE_JTREG_SAMEVM=false UNIQUE_DIR=$@ jtreg_tests |
Kelly O'Hair | d125892 | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 391 | endef |
| 392 | define SummaryInfo |
Kelly O'Hair | 61c0915 | 2009-12-09 09:46:57 -0800 | [diff] [blame] | 393 | $(ECHO) "########################################################" |
Kelly O'Hair | d125892 | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 394 | $(CAT) $(?:%=$(ABS_TEST_OUTPUT_DIR)/%/$(STATS_TXT_NAME)) |
Kelly O'Hair | 61c0915 | 2009-12-09 09:46:57 -0800 | [diff] [blame] | 395 | $(ECHO) "########################################################" |
Kelly O'Hair | d125892 | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 396 | endef |
| 397 | |
| 398 | # ------------------------------------------------------------------ |
| 399 | |
| 400 | # Batches of tests (somewhat arbitrary assigments to jdk_* targets) |
| 401 | JDK_ALL_TARGETS = |
| 402 | |
| 403 | # Stable othervm testruns (minus items from PROBLEM_LIST) |
| 404 | # Using samevm has problems, and doesn't help performance as much as others. |
| 405 | JDK_ALL_TARGETS += jdk_awt |
| 406 | jdk_awt: com/sun/awt java/awt sun/awt |
| 407 | $(call RunOthervmBatch) |
| 408 | |
| 409 | # Stable samevm testruns (minus items from PROBLEM_LIST) |
| 410 | JDK_ALL_TARGETS += jdk_beans1 |
| 411 | jdk_beans1: java/beans/beancontext java/beans/PropertyChangeSupport \ |
| 412 | java/beans/Introspector java/beans/Performance \ |
| 413 | java/beans/VetoableChangeSupport java/beans/Statement |
| 414 | $(call RunSamevmBatch) |
| 415 | |
| 416 | # Stable othervm testruns (minus items from PROBLEM_LIST) |
| 417 | # Using samevm has serious problems with these tests |
| 418 | JDK_ALL_TARGETS += jdk_beans2 |
| 419 | jdk_beans2: java/beans/Beans java/beans/EventHandler java/beans/XMLDecoder \ |
| 420 | java/beans/PropertyEditor |
| 421 | $(call RunOthervmBatch) |
Kelly O'Hair | 61c0915 | 2009-12-09 09:46:57 -0800 | [diff] [blame] | 422 | |
| 423 | # Stable othervm testruns (minus items from PROBLEM_LIST) |
| 424 | # Using samevm has serious problems with these tests |
Kelly O'Hair | d125892 | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 425 | JDK_ALL_TARGETS += jdk_beans3 |
| 426 | jdk_beans3: java/beans/XMLEncoder |
| 427 | $(call RunOthervmBatch) |
| 428 | |
Kelly O'Hair | 61c0915 | 2009-12-09 09:46:57 -0800 | [diff] [blame] | 429 | # All beans tests |
Kelly O'Hair | d020b04 | 2009-11-23 09:51:52 -0800 | [diff] [blame] | 430 | jdk_beans: jdk_beans1 jdk_beans2 jdk_beans3 |
| 431 | @$(SummaryInfo) |
| 432 | |
Kelly O'Hair | d125892 | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 433 | # Stable samevm testruns (minus items from PROBLEM_LIST) |
| 434 | JDK_ALL_TARGETS += jdk_io |
| 435 | jdk_io: java/io |
| 436 | $(call RunSamevmBatch) |
| 437 | |
| 438 | # Stable samevm testruns (minus items from PROBLEM_LIST) |
| 439 | JDK_ALL_TARGETS += jdk_lang |
| 440 | jdk_lang: java/lang |
| 441 | $(call RunSamevmBatch) |
| 442 | |
| 443 | # Stable othervm testruns (minus items from PROBLEM_LIST) |
| 444 | # Using samevm has serious problems with these tests |
| 445 | JDK_ALL_TARGETS += jdk_management1 |
| 446 | jdk_management1: javax/management |
| 447 | $(call RunOthervmBatch) |
| 448 | |
| 449 | # Stable othervm testruns (minus items from PROBLEM_LIST) |
| 450 | # Using samevm has serious problems with these tests |
| 451 | JDK_ALL_TARGETS += jdk_management2 |
| 452 | jdk_management2: com/sun/jmx com/sun/management sun/management |
| 453 | $(call RunOthervmBatch) |
| 454 | |
Kelly O'Hair | 61c0915 | 2009-12-09 09:46:57 -0800 | [diff] [blame] | 455 | # All management tests |
Kelly O'Hair | d020b04 | 2009-11-23 09:51:52 -0800 | [diff] [blame] | 456 | jdk_management: jdk_management1 jdk_management2 |
| 457 | @$(SummaryInfo) |
| 458 | |
Kelly O'Hair | d125892 | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 459 | # Stable samevm testruns (minus items from PROBLEM_LIST) |
| 460 | JDK_ALL_TARGETS += jdk_math |
| 461 | jdk_math: java/math |
| 462 | $(call RunSamevmBatch) |
| 463 | |
| 464 | # Stable samevm testruns (minus items from PROBLEM_LIST) |
| 465 | JDK_ALL_TARGETS += jdk_misc |
| 466 | jdk_misc: demo javax/imageio javax/naming javax/print javax/script \ |
| 467 | javax/smartcardio javax/sound com/sun/java com/sun/jndi \ |
| 468 | com/sun/org sun/misc sun/pisces |
| 469 | $(call RunSamevmBatch) |
| 470 | |
| 471 | # Stable samevm testruns (minus items from PROBLEM_LIST) |
| 472 | JDK_ALL_TARGETS += jdk_net |
| 473 | jdk_net: com/sun/net java/net sun/net |
| 474 | $(call RunSamevmBatch) |
| 475 | |
| 476 | # Stable samevm testruns (minus items from PROBLEM_LIST) |
| 477 | JDK_ALL_TARGETS += jdk_nio1 |
| 478 | jdk_nio1: java/nio/file |
| 479 | $(call RunSamevmBatch) |
| 480 | |
| 481 | # Stable othervm testruns (minus items from PROBLEM_LIST) |
| 482 | # Using samevm has serious problems with these tests |
| 483 | JDK_ALL_TARGETS += jdk_nio2 |
| 484 | jdk_nio2: java/nio/Buffer java/nio/ByteOrder \ |
| 485 | java/nio/channels java/nio/BufferPoolMXBean java/nio/MappedByteBuffer |
| 486 | $(call RunOthervmBatch) |
Kelly O'Hair | 61c0915 | 2009-12-09 09:46:57 -0800 | [diff] [blame] | 487 | |
| 488 | # Stable othervm testruns (minus items from PROBLEM_LIST) |
| 489 | # Using samevm has serious problems with these tests |
Kelly O'Hair | d125892 | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 490 | JDK_ALL_TARGETS += jdk_nio3 |
| 491 | jdk_nio3: com/sun/nio sun/nio |
| 492 | $(call RunOthervmBatch) |
| 493 | |
Kelly O'Hair | 61c0915 | 2009-12-09 09:46:57 -0800 | [diff] [blame] | 494 | # All nio tests |
Kelly O'Hair | d020b04 | 2009-11-23 09:51:52 -0800 | [diff] [blame] | 495 | jdk_nio: jdk_nio1 jdk_nio2 jdk_nio3 |
| 496 | @$(SummaryInfo) |
| 497 | |
Kelly O'Hair | d125892 | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 498 | # Stable othervm testruns (minus items from PROBLEM_LIST) |
| 499 | # Using samevm has serious problems with these tests |
| 500 | JDK_ALL_TARGETS += jdk_rmi |
| 501 | jdk_rmi: java/rmi javax/rmi sun/rmi |
| 502 | $(call RunOthervmBatch) |
| 503 | |
| 504 | # Stable samevm testruns (minus items from PROBLEM_LIST) |
| 505 | JDK_ALL_TARGETS += jdk_security1 |
| 506 | jdk_security1: java/security |
| 507 | $(call RunSamevmBatch) |
| 508 | |
| 509 | # Stable othervm testruns (minus items from PROBLEM_LIST) |
| 510 | # Using samevm has serious problems with these tests |
| 511 | JDK_ALL_TARGETS += jdk_security2 |
| 512 | jdk_security2: javax/crypto com/sun/crypto |
| 513 | $(call RunOthervmBatch) |
Kelly O'Hair | 61c0915 | 2009-12-09 09:46:57 -0800 | [diff] [blame] | 514 | |
| 515 | # Stable othervm testruns (minus items from PROBLEM_LIST) |
| 516 | # Using samevm has serious problems with these tests |
Kelly O'Hair | d125892 | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 517 | JDK_ALL_TARGETS += jdk_security3 |
| 518 | jdk_security3: com/sun/security lib/security javax/security sun/security |
| 519 | $(call RunOthervmBatch) |
| 520 | |
Kelly O'Hair | 61c0915 | 2009-12-09 09:46:57 -0800 | [diff] [blame] | 521 | # All security tests |
Kelly O'Hair | d020b04 | 2009-11-23 09:51:52 -0800 | [diff] [blame] | 522 | jdk_security: jdk_security1 jdk_security2 jdk_security3 |
| 523 | @$(SummaryInfo) |
| 524 | |
Kelly O'Hair | d125892 | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 525 | # Stable othervm testruns (minus items from PROBLEM_LIST) |
| 526 | # Using samevm has problems, and doesn't help performance as much as others. |
| 527 | JDK_ALL_TARGETS += jdk_swing |
| 528 | jdk_swing: javax/swing sun/java2d |
| 529 | $(call RunOthervmBatch) |
| 530 | |
| 531 | # Stable samevm testruns (minus items from PROBLEM_LIST) |
| 532 | JDK_ALL_TARGETS += jdk_text |
| 533 | jdk_text: java/text sun/text |
| 534 | $(call RunSamevmBatch) |
| 535 | |
Kelly O'Hair | 61c0915 | 2009-12-09 09:46:57 -0800 | [diff] [blame] | 536 | # Stable samevm testruns (minus items from PROBLEM_LIST) |
Kelly O'Hair | d125892 | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 537 | JDK_ALL_TARGETS += jdk_tools1 |
| 538 | jdk_tools1: com/sun/jdi |
Kelly O'Hair | 547328d | 2009-11-25 08:24:58 -0800 | [diff] [blame] | 539 | $(call RunSamevmBatch) |
Kelly O'Hair | 61c0915 | 2009-12-09 09:46:57 -0800 | [diff] [blame] | 540 | |
| 541 | # Stable othervm testruns (minus items from PROBLEM_LIST) |
| 542 | # Using samevm has serious problems with these tests |
Kelly O'Hair | d125892 | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 543 | JDK_ALL_TARGETS += jdk_tools2 |
| 544 | jdk_tools2: com/sun/tools sun/jvmstat sun/tools tools vm com/sun/servicetag com/sun/tracing |
| 545 | $(call RunOthervmBatch) |
| 546 | |
Kelly O'Hair | 61c0915 | 2009-12-09 09:46:57 -0800 | [diff] [blame] | 547 | # All tools tests |
Kelly O'Hair | d020b04 | 2009-11-23 09:51:52 -0800 | [diff] [blame] | 548 | jdk_tools: jdk_tools1 jdk_tools2 |
| 549 | @$(SummaryInfo) |
| 550 | |
Kelly O'Hair | d125892 | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 551 | # Stable samevm testruns (minus items from PROBLEM_LIST) |
| 552 | JDK_ALL_TARGETS += jdk_util |
| 553 | jdk_util: java/util sun/util |
| 554 | $(call RunSamevmBatch) |
| 555 | |
| 556 | # ------------------------------------------------------------------ |
| 557 | |
| 558 | # Run all tests |
Kelly O'Hair | 61c0915 | 2009-12-09 09:46:57 -0800 | [diff] [blame] | 559 | FILTER_OUT_LIST=jdk_awt jdk_rmi jdk_swing |
| 560 | JDK_ALL_STABLE_TARGETS := $(filter-out $(FILTER_OUT_LIST), $(JDK_ALL_TARGETS)) |
| 561 | jdk_all: $(JDK_ALL_STABLE_TARGETS) |
Kelly O'Hair | d125892 | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 562 | @$(SummaryInfo) |
| 563 | |
| 564 | # These are all phony targets |
| 565 | PHONY_LIST += $(JDK_ALL_TARGETS) |
| 566 | |
| 567 | # ------------------------------------------------------------------ |
| 568 | |
Kelly O'Hair | 53b5f6a | 2009-03-31 16:12:56 -0700 | [diff] [blame] | 569 | # Default JTREG to run (win32 script works for everybody) |
| 570 | JTREG = $(JT_HOME)/win32/bin/jtreg |
Kelly O'Hair | d125892 | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 571 | # Add any extra options (samevm etc.) |
| 572 | JTREG_BASIC_OPTIONS += $(EXTRA_JTREG_OPTIONS) |
| 573 | # Only run automatic tests |
| 574 | JTREG_BASIC_OPTIONS += -a |
Kelly O'Hair | d44fe66 | 2009-12-11 15:29:22 -0800 | [diff] [blame] | 575 | # Always turn on assertions |
| 576 | JTREG_ASSERT_OPTION = -ea -esa |
| 577 | JTREG_BASIC_OPTIONS += $(JTREG_ASSERT_OPTION) |
Kelly O'Hair | d125892 | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 578 | # Report details on all failed or error tests, times too |
| 579 | JTREG_BASIC_OPTIONS += -v:fail,error,time |
| 580 | # Retain all files for failing tests |
| 581 | JTREG_BASIC_OPTIONS += -retain:fail,error |
| 582 | # Ignore tests are not run and completely silent about it |
Kelly O'Hair | d44fe66 | 2009-12-11 15:29:22 -0800 | [diff] [blame] | 583 | JTREG_IGNORE_OPTION = -ignore:quiet |
| 584 | JTREG_BASIC_OPTIONS += $(JTREG_IGNORE_OPTION) |
Kelly O'Hair | 61c0915 | 2009-12-09 09:46:57 -0800 | [diff] [blame] | 585 | # Multiple by 4 the timeout numbers |
Kelly O'Hair | d44fe66 | 2009-12-11 15:29:22 -0800 | [diff] [blame] | 586 | JTREG_TIMEOUT_OPTION = -timeoutFactor:4 |
| 587 | JTREG_BASIC_OPTIONS += $(JTREG_TIMEOUT_OPTION) |
Kelly O'Hair | d125892 | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 588 | # Boost the max memory for jtreg to avoid gc thrashing |
Kelly O'Hair | d44fe66 | 2009-12-11 15:29:22 -0800 | [diff] [blame] | 589 | JTREG_MEMORY_OPTION = -J-Xmx512m |
| 590 | JTREG_BASIC_OPTIONS += $(JTREG_MEMORY_OPTION) |
Kelly O'Hair | 53b5f6a | 2009-03-31 16:12:56 -0700 | [diff] [blame] | 591 | |
Kelly O'Hair | d125892 | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 592 | # Make sure jtreg exists |
| 593 | $(JTREG): $(JT_HOME) |
| 594 | |
| 595 | # Run jtreg |
| 596 | jtreg_tests: prep $(PRODUCT_HOME) $(JTREG) $(EXCLUDELIST) |
| 597 | @$(EXPAND) $(EXCLUDELIST) \ |
| 598 | | $(CUT) -d' ' -f1 \ |
| 599 | | $(SED) -e 's@^@Excluding: @' |
| 600 | ( \ |
| 601 | ( JT_HOME=$(shell $(GETMIXEDPATH) "$(JT_HOME)"); \ |
| 602 | export JT_HOME; \ |
Kelly O'Hair | d125892 | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 603 | $(shell $(GETMIXEDPATH) "$(JTREG)") \ |
| 604 | $(JTREG_BASIC_OPTIONS) \ |
| 605 | -r:$(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/JTreport \ |
| 606 | -w:$(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/JTwork \ |
| 607 | -jdk:$(shell $(GETMIXEDPATH) "$(PRODUCT_HOME)") \ |
| 608 | -exclude:$(shell $(GETMIXEDPATH) "$(EXCLUDELIST)") \ |
| 609 | $(JTREG_TEST_OPTIONS) \ |
| 610 | $(TESTDIRS) \ |
| 611 | ) ; $(BUNDLE_UP_AND_EXIT) \ |
Kelly O'Hair | 0ce235a | 2009-12-01 08:51:16 -0800 | [diff] [blame] | 612 | ) 2>&1 | $(TEE) $(ABS_TEST_OUTPUT_DIR)/output.txt ; $(TESTEXIT) |
Kelly O'Hair | 53b5f6a | 2009-03-31 16:12:56 -0700 | [diff] [blame] | 613 | |
| 614 | PHONY_LIST += jtreg_tests |
| 615 | |
| 616 | ################################################################ |
| 617 | |
| 618 | # packtest |
| 619 | |
| 620 | # Expect JPRT to set JPRT_PACKTEST_HOME. |
| 621 | PACKTEST_HOME = /net/jprt-web.sfbay.sun.com/jprt/allproducts/packtest |
| 622 | ifdef JPRT_PACKTEST_HOME |
| 623 | PACKTEST_HOME = $(JPRT_PACKTEST_HOME) |
| 624 | endif |
| 625 | |
| 626 | packtest: prep $(PACKTEST_HOME)/ptest $(PRODUCT_HOME) |
| 627 | ( $(CD) $(PACKTEST_HOME) && \ |
| 628 | $(PACKTEST_HOME)/ptest \ |
| 629 | -t "$(PRODUCT_HOME)" \ |
| 630 | $(PACKTEST_STRESS_OPTION) \ |
| 631 | $(EXTRA_PACKTEST_OPTIONS) \ |
| 632 | -W $(ABS_TEST_OUTPUT_DIR) \ |
| 633 | $(JAVA_ARGS:%=-J %) \ |
| 634 | $(JAVA_VM_ARGS:%=-J %) \ |
| 635 | ) ; $(BUNDLE_UP_AND_EXIT) |
| 636 | |
| 637 | packtest_stress: PACKTEST_STRESS_OPTION=-s |
| 638 | packtest_stress: packtest |
| 639 | |
| 640 | PHONY_LIST += packtest packtest_stress |
| 641 | |
| 642 | ################################################################ |
| 643 | |
Mandy Chung | e2f7248 | 2009-05-26 17:47:57 -0700 | [diff] [blame] | 644 | # perftest to collect statistics |
| 645 | |
| 646 | # Expect JPRT to set JPRT_PACKTEST_HOME. |
| 647 | PERFTEST_HOME = ${TEST_ROOT}/perf |
| 648 | ifdef JPRT_PERFTEST_HOME |
| 649 | PERFTEST_HOME = $(JPRT_PERFTEST_HOME) |
| 650 | endif |
| 651 | |
| 652 | perftest: ( $(PERFTEST_HOME)/perftest \ |
| 653 | -t $(shell $(GETMIXEDPATH) "$(PRODUCT_HOME)") \ |
| 654 | -w $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)") \ |
| 655 | -h $(PERFTEST_HOME) \ |
| 656 | ) ; $(BUNDLE_UP_AND_EXIT) |
| 657 | |
| 658 | |
| 659 | PHONY_LIST += perftest |
| 660 | |
| 661 | ################################################################ |
| 662 | |
Kelly O'Hair | 53b5f6a | 2009-03-31 16:12:56 -0700 | [diff] [blame] | 663 | # vmsqe tests |
| 664 | |
| 665 | # Expect JPRT to set JPRT_VMSQE_HOME. |
| 666 | VMSQE_HOME = /java/sqe/comp/vm/testbase/sqe/vm/current/build/latest/vm |
| 667 | ifdef JPRT_VMSQE_HOME |
| 668 | VMSQE_HOME = $(JPRT_VMSQE_HOME) |
| 669 | endif |
| 670 | |
| 671 | # Expect JPRT to set JPRT_RUNVMSQE_HOME. |
| 672 | RUNVMSQE_HOME = /net/jprt-web.sfbay.sun.com/jprt/allproducts/runvmsqe |
| 673 | ifdef JPRT_RUNVMSQE_HOME |
| 674 | RUNVMSQE_HOME = $(JPRT_RUNVMSQE_HOME) |
| 675 | endif |
| 676 | |
| 677 | # Expect JPRT to set JPRT_TONGA3_HOME. |
| 678 | TONGA3_HOME = /java/sqe//tools/gtee/harness/tonga |
| 679 | ifdef JPRT_TONGA3_HOME |
| 680 | TONGA3_HOME = $(JPRT_TONGA3_HOME) |
| 681 | endif |
| 682 | |
| 683 | RUNVMSQE_BIN = $(RUNVMSQE_HOME)/bin/runvmsqe |
| 684 | |
| 685 | vmsqe_tests: prep $(VMSQE_HOME)/vm $(TONGA3_HOME) $(RUNVMSQE_BIN) $(PRODUCT_HOME) |
| 686 | $(RM) -r $(ABS_TEST_OUTPUT_DIR)/vmsqe |
| 687 | ( $(CD) $(ABS_TEST_OUTPUT_DIR) && \ |
| 688 | $(RUNVMSQE_BIN) \ |
| 689 | -jdk "$(PRODUCT_HOME)" \ |
| 690 | -o "$(ABS_TEST_OUTPUT_DIR)/vmsqe" \ |
| 691 | -testbase "$(VMSQE_HOME)/vm" \ |
| 692 | -tonga "$(TONGA3_HOME)" \ |
| 693 | -tongajdk "$(ALT_BOOTDIR)" \ |
| 694 | $(JAVA_ARGS) \ |
| 695 | $(JAVA_VM_ARGS) \ |
| 696 | $(RUNVMSQE_TEST_OPTION) \ |
| 697 | $(EXTRA_RUNVMSQE_OPTIONS) \ |
| 698 | ) ; $(BUNDLE_UP_AND_EXIT) |
| 699 | |
| 700 | vmsqe_jdwp: RUNVMSQE_TEST_OPTION=-jdwp |
| 701 | vmsqe_jdwp: vmsqe_tests |
| 702 | |
| 703 | vmsqe_jdi: RUNVMSQE_TEST_OPTION=-jdi |
| 704 | vmsqe_jdi: vmsqe_tests |
| 705 | |
| 706 | vmsqe_jdb: RUNVMSQE_TEST_OPTION=-jdb |
| 707 | vmsqe_jdb: vmsqe_tests |
| 708 | |
| 709 | vmsqe_quick-jdi: RUNVMSQE_TEST_OPTION=-quick-jdi |
| 710 | vmsqe_quick-jdi: vmsqe_tests |
| 711 | |
| 712 | vmsqe_sajdi: RUNVMSQE_TEST_OPTION=-sajdi |
| 713 | vmsqe_sajdi: vmsqe_tests |
| 714 | |
| 715 | vmsqe_jvmti: RUNVMSQE_TEST_OPTION=-jvmti |
| 716 | vmsqe_jvmti: vmsqe_tests |
| 717 | |
| 718 | vmsqe_hprof: RUNVMSQE_TEST_OPTION=-hprof |
| 719 | vmsqe_hprof: vmsqe_tests |
| 720 | |
| 721 | vmsqe_monitoring: RUNVMSQE_TEST_OPTION=-monitoring |
| 722 | vmsqe_monitoring: vmsqe_tests |
| 723 | |
| 724 | PHONY_LIST += vmsqe_jdwp vmsqe_jdi vmsqe_jdb vmsqe_quick-jdi vmsqe_sajdi \ |
| 725 | vmsqe_jvmti vmsqe_hprof vmsqe_monitoring vmsqe_tests |
| 726 | |
| 727 | ################################################################ |
| 728 | |
| 729 | # jck tests |
| 730 | |
| 731 | JCK_WORK_DIR = $(ABS_TEST_OUTPUT_DIR)/JCKwork |
| 732 | JCK_REPORT_DIR = $(ABS_TEST_OUTPUT_DIR)/JCKreport |
| 733 | JCK_PROPERTIES = $(ABS_TEST_OUTPUT_DIR)/jck.properties |
| 734 | JCK_CONFIG = $(ABS_TEST_OUTPUT_DIR)/jck.config |
| 735 | |
| 736 | JCK_JAVA_EXE = $(PRODUCT_HOME)/bin/java$(EXESUFFIX) |
| 737 | |
| 738 | JCK_JAVATEST_JAR = $(JCK_HOME)/lib/javatest.jar |
| 739 | JCK_JAVATEST = $(ALT_BOOTDIR)/bin/java -jar $(JCK_JAVATEST_JAR) |
| 740 | |
| 741 | $(JCK_CONFIG): $(TEST_ROOT)/JCK-$(JCK_BUNDLE_NAME)-$(JCK_RELEASE)-base.jti |
| 742 | $(RM) $@ |
| 743 | $(MKDIR) -p $(@D) |
| 744 | $(CP) $< $@ |
| 745 | |
| 746 | $(JCK_PROPERTIES): $(PRODUCT_HOME) $(JCK_JAVA_EXE) |
| 747 | $(RM) $@ |
| 748 | $(MKDIR) -p $(@D) |
| 749 | $(ECHO) "jck.env.compiler.compRefExecute.cmdAsFile=$(JCK_JAVA_EXE)" >> $@ |
| 750 | $(ECHO) "jck.env.compiler.compRefExecute.systemRoot=$(SYSTEMROOT)" >> $@ |
| 751 | $(ECHO) "jck.env.compiler.testCompile.testCompileAPImultiJVM.cmdAsFile=$(JCK_JAVA_EXE)" >> $@ |
| 752 | $(ECHO) "jck.tests.tests=$(JCK_BUNDLE_TESTDIRS)" >> $@ |
| 753 | |
| 754 | jck_tests: prep $(JCK_HOME) $(JCK_PROPERTIES) $(JCK_CONFIG) $(JCK_JAVATEST_JAR) |
| 755 | $(MKDIR) -p $(JCK_WORK_DIR) |
| 756 | ( $(JCK_JAVATEST) \ |
| 757 | -verbose:commands,non-pass \ |
| 758 | -testSuite $(JCK_HOME) \ |
| 759 | -workDir $(JCK_WORK_DIR) \ |
| 760 | -config $(JCK_CONFIG) \ |
| 761 | -set -file $(JCK_PROPERTIES) \ |
| 762 | -runtests \ |
| 763 | -writeReport $(JCK_REPORT_DIR) \ |
| 764 | ) ; $(BUNDLE_UP_AND_EXIT) |
| 765 | |
| 766 | PHONY_LIST += jck_tests |
| 767 | |
| 768 | ################################################################ |
| 769 | |
| 770 | # jck6 tests |
| 771 | |
| 772 | JCK6_RELEASE = 6b |
| 773 | JCK6_DEFAULT_HOME = $(SLASH_JAVA)/re/jck/$(JCK6_RELEASE)/archive/fcs/binaries |
| 774 | |
| 775 | # Expect JPRT to set JPRT_JCK6COMPILER_HOME. |
| 776 | JCK6COMPILER_HOME = $(JCK6_DEFAULT_HOME)/JCK-compiler-$(JCK6_RELEASE) |
| 777 | ifdef JPRT_JCK6COMPILER_HOME |
| 778 | JCK6COMPILER_HOME = $(JPRT_JCK6COMPILER_HOME) |
| 779 | endif |
| 780 | |
| 781 | # Expect JPRT to set JPRT_JCK6RUNTIME_HOME. |
| 782 | JCK6RUNTIME_HOME = $(JCK6_DEFAULT_HOME)/JCK-runtime-$(JCK6_RELEASE) |
| 783 | ifdef JPRT_JCK6RUNTIME_HOME |
| 784 | JCK6RUNTIME_HOME = $(JPRT_JCK6RUNTIME_HOME) |
| 785 | endif |
| 786 | |
| 787 | # Expect JPRT to set JPRT_JCK6DEVTOOLS_HOME. |
| 788 | JCK6DEVTOOLS_HOME = $(JCK6_DEFAULT_HOME)/JCK-devtools-$(JCK6_RELEASE) |
| 789 | ifdef JPRT_JCK6DEVTOOLS_HOME |
| 790 | JCK6DEVTOOLS_HOME = $(JPRT_JCK6DEVTOOLS_HOME) |
| 791 | endif |
| 792 | |
| 793 | jck6_tests: JCK_HOME=$(JCK6_HOME) |
| 794 | jck6_tests: JCK_RELEASE=$(JCK6_RELEASE) |
| 795 | jck6_tests: jck_tests |
| 796 | |
| 797 | jck6compiler: JCK6_HOME=$(JCK6COMPILER_HOME) |
| 798 | jck6compiler: JCK_BUNDLE_NAME=compiler |
| 799 | jck6compiler: jck6_tests |
| 800 | |
| 801 | jck6compiler_lang: JCK_BUNDLE_TESTDIRS=lang |
| 802 | jck6compiler_lang: jck6compiler |
| 803 | |
| 804 | jck6runtime: JCK6_HOME=$(JCK6RUNTIME_HOME) |
| 805 | jck6runtime: JCK_BUNDLE_NAME=runtime |
| 806 | jck6runtime: jck6_tests |
| 807 | |
| 808 | jck6runtime_lang: JCK_BUNDLE_TESTDIRS=lang |
| 809 | jck6runtime_lang: jck6runtime |
| 810 | |
| 811 | jck6devtools: JCK6_HOME=$(JCK6DEVTOOLS_HOME) |
| 812 | jck6devtools: JCK_BUNDLE_NAME=devtools |
| 813 | jck6devtools: jck6_tests |
| 814 | |
| 815 | jck6devtools_lang: JCK_BUNDLE_TESTDIRS=lang |
| 816 | jck6devtools_lang: jck6devtools |
| 817 | |
| 818 | PHONY_LIST += jck6compiler jck6runtime jck6devtools jck6_tests \ |
| 819 | jck6compiler_lang jck6runtime_lang jck6devtools_lang |
| 820 | |
| 821 | ################################################################ |
| 822 | |
| 823 | # jck7 tests |
| 824 | |
| 825 | JCK7_RELEASE = 7 |
| 826 | JCK7_DEFAULT_HOME = $(SLASH_JAVA)/re/jck/$(JCK7_RELEASE)/archive/fcs/binaries |
| 827 | |
| 828 | # Expect JPRT to set JPRT_JCK7COMPILER_HOME. |
| 829 | JCK7COMPILER_HOME = $(JCK7_DEFAULT_HOME)/JCK-compiler-$(JCK7_RELEASE) |
| 830 | ifdef JPRT_JCK7COMPILER_HOME |
| 831 | JCK7COMPILER_HOME = $(JPRT_JCK7COMPILER_HOME) |
| 832 | endif |
| 833 | |
| 834 | # Expect JPRT to set JPRT_JCK7RUNTIME_HOME. |
| 835 | JCK7RUNTIME_HOME = $(JCK7_DEFAULT_HOME)/JCK-runtime-$(JCK7_RELEASE) |
| 836 | ifdef JPRT_JCK7RUNTIME_HOME |
| 837 | JCK7RUNTIME_HOME = $(JPRT_JCK7RUNTIME_HOME) |
| 838 | endif |
| 839 | |
| 840 | # Expect JPRT to set JPRT_JCK7DEVTOOLS_HOME. |
| 841 | JCK7DEVTOOLS_HOME = $(JCK7_DEFAULT_HOME)/JCK-devtools-$(JCK7_RELEASE) |
| 842 | ifdef JPRT_JCK7DEVTOOLS_HOME |
| 843 | JCK7DEVTOOLS_HOME = $(JPRT_JCK7DEVTOOLS_HOME) |
| 844 | endif |
| 845 | |
| 846 | jck7_tests: JCK_HOME=$(JCK7_HOME) |
| 847 | jck7_tests: JCK_RELEASE=$(JCK7_RELEASE) |
| 848 | jck7_tests: jck_tests |
| 849 | |
| 850 | jck7compiler: JCK7_HOME=$(JCK7COMPILER_HOME) |
| 851 | jck7compiler: JCK_BUNDLE_NAME=compiler |
| 852 | jck7compiler: jck7_tests |
| 853 | |
| 854 | jck7compiler_lang: JCK_BUNDLE_TESTDIRS=lang |
| 855 | jck7compiler_lang: jck7compiler |
| 856 | |
| 857 | jck7runtime: JCK7_HOME=$(JCK7RUNTIME_HOME) |
| 858 | jck7runtime: JCK_BUNDLE_NAME=runtime |
| 859 | jck7runtime: jck7_tests |
| 860 | |
| 861 | jck7runtime_lang: JCK_BUNDLE_TESTDIRS=lang |
| 862 | jck7runtime_lang: jck7runtime |
| 863 | |
| 864 | jck7devtools: JCK7_HOME=$(JCK7DEVTOOLS_HOME) |
| 865 | jck7devtools: JCK_BUNDLE_NAME=devtools |
| 866 | jck7devtools: jck7_tests |
| 867 | |
| 868 | jck7devtools_lang: JCK_BUNDLE_TESTDIRS=lang |
| 869 | jck7devtools_lang: jck7devtools |
| 870 | |
| 871 | PHONY_LIST += jck7compiler jck7runtime jck7devtools jck7_tests \ |
| 872 | jck7compiler_lang jck7runtime_lang jck7devtools_lang |
| 873 | |
| 874 | ################################################################ |
J. Duke | 319a3b9 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 875 | |
| 876 | # Phony targets (e.g. these are not filenames) |
Kelly O'Hair | 53b5f6a | 2009-03-31 16:12:56 -0700 | [diff] [blame] | 877 | .PHONY: all clean prep $(PHONY_LIST) |
| 878 | |
| 879 | ################################################################ |
J. Duke | 319a3b9 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 880 | |