duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 1 | # |
mduigou | 1a37369 | 2013-04-01 20:15:48 -0700 | [diff] [blame] | 2 | # Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved. |
ohair | 8e0a08d | 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 |
ohair | 2283b9d | 2010-05-25 15:58:33 -0700 | [diff] [blame] | 7 | # published by the Free Software Foundation. Oracle designates this |
ohair | 8e0a08d | 2009-03-31 16:12:56 -0700 | [diff] [blame] | 8 | # particular file as subject to the "Classpath" exception as provided |
ohair | 2283b9d | 2010-05-25 15:58:33 -0700 | [diff] [blame] | 9 | # by Oracle in the LICENSE file that accompanied this code. |
ohair | 8e0a08d | 2009-03-31 16:12:56 -0700 | [diff] [blame] | 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 | # |
ohair | 2283b9d | 2010-05-25 15:58:33 -0700 | [diff] [blame] | 21 | # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
| 22 | # or visit www.oracle.com if you need additional information or have any |
| 23 | # questions. |
ohair | 8e0a08d | 2009-03-31 16:12:56 -0700 | [diff] [blame] | 24 | # |
| 25 | |
| 26 | # |
| 27 | # Makefile to run various jdk tests |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 28 | # |
| 29 | |
mduigou | 122c592 | 2013-11-05 19:44:41 -0800 | [diff] [blame] | 30 | .DEFAULT : all |
| 31 | |
ohair | 7aae9af | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 32 | # Empty these to get rid of some default rules |
| 33 | .SUFFIXES: |
| 34 | .SUFFIXES: .java |
| 35 | CO= |
| 36 | GET= |
| 37 | |
| 38 | # Utilities used |
| 39 | AWK = awk |
| 40 | CAT = cat |
| 41 | CD = cd |
ohair | 4125be8 | 2010-05-12 21:35:55 -0700 | [diff] [blame] | 42 | CHMOD = chmod |
ohair | 7aae9af | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 43 | CP = cp |
| 44 | CUT = cut |
ohair | 4125be8 | 2010-05-12 21:35:55 -0700 | [diff] [blame] | 45 | DIRNAME = dirname |
ohair | 7aae9af | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 46 | ECHO = echo |
| 47 | EGREP = egrep |
| 48 | EXPAND = expand |
ohair | 4125be8 | 2010-05-12 21:35:55 -0700 | [diff] [blame] | 49 | FIND = find |
ohair | 7aae9af | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 50 | MKDIR = mkdir |
ohair | 7aae9af | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 51 | PWD = pwd |
| 52 | SED = sed |
ohair | 7aae9af | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 53 | SORT = sort |
| 54 | TEE = tee |
| 55 | UNAME = uname |
| 56 | UNIQ = uniq |
| 57 | WC = wc |
ohair | 7aae9af | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 58 | ZIP = zip |
| 59 | |
mduigou | 122c592 | 2013-11-05 19:44:41 -0800 | [diff] [blame] | 60 | # Get OS name from uname (Cygwin inexplicably adds _NT-5.1) |
| 61 | UNAME_S := $(shell $(UNAME) -s | $(CUT) -f1 -d_) |
ohair | 8e0a08d | 2009-03-31 16:12:56 -0700 | [diff] [blame] | 62 | |
| 63 | # Commands to run on paths to make mixed paths for java on windows |
mduigou | 122c592 | 2013-11-05 19:44:41 -0800 | [diff] [blame] | 64 | ifeq ($(UNAME_S), CYGWIN) |
| 65 | # Location of developer shared files |
ohair | 8c7e6c5 | 2010-05-20 13:57:58 -0700 | [diff] [blame] | 66 | SLASH_JAVA = J: |
chegar | 3b0deaa | 2013-11-11 10:33:02 +0000 | [diff] [blame] | 67 | GETMIXEDPATH = cygpath -m |
ohair | 7aae9af | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 68 | else |
mduigou | 122c592 | 2013-11-05 19:44:41 -0800 | [diff] [blame] | 69 | # Location of developer shared files |
| 70 | SLASH_JAVA = /java |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 71 | |
mduigou | 122c592 | 2013-11-05 19:44:41 -0800 | [diff] [blame] | 72 | GETMIXEDPATH=$(ECHO) |
ohair | 8bcba56 | 2010-03-12 09:03:02 -0800 | [diff] [blame] | 73 | endif |
| 74 | |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 75 | # Root of this test area (important to use full paths in some places) |
ohair | 7aae9af | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 76 | TEST_ROOT := $(shell $(PWD)) |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 77 | |
ohair | 8e0a08d | 2009-03-31 16:12:56 -0700 | [diff] [blame] | 78 | # Root of all test results |
| 79 | ifdef ALT_OUTPUTDIR |
mduigou | 122c592 | 2013-11-05 19:44:41 -0800 | [diff] [blame] | 80 | ABS_OUTPUTDIR = $(shell $(CD) $(ALT_OUTPUTDIR) && $(PWD)) |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 81 | else |
mduigou | 122c592 | 2013-11-05 19:44:41 -0800 | [diff] [blame] | 82 | ABS_OUTPUTDIR = $(shell $(CD) $(TEST_ROOT)/.. && $(PWD)) |
ohair | 8e0a08d | 2009-03-31 16:12:56 -0700 | [diff] [blame] | 83 | endif |
mduigou | 122c592 | 2013-11-05 19:44:41 -0800 | [diff] [blame] | 84 | |
ohair | 8bcba56 | 2010-03-12 09:03:02 -0800 | [diff] [blame] | 85 | ABS_PLATFORM_BUILD_ROOT = $(ABS_OUTPUTDIR) |
| 86 | ABS_TEST_OUTPUT_DIR := $(ABS_PLATFORM_BUILD_ROOT)/testoutput/$(UNIQUE_DIR) |
ohair | 8e0a08d | 2009-03-31 16:12:56 -0700 | [diff] [blame] | 87 | |
| 88 | # Expect JPRT to set PRODUCT_HOME (the product or jdk in this case to test) |
| 89 | ifndef PRODUCT_HOME |
| 90 | # Try to use j2sdk-image if it exists |
mduigou | 122c592 | 2013-11-05 19:44:41 -0800 | [diff] [blame] | 91 | ABS_JDK_IMAGE = $(ABS_PLATFORM_BUILD_ROOT)/images/j2sdk-image |
ohair | 8bcba56 | 2010-03-12 09:03:02 -0800 | [diff] [blame] | 92 | PRODUCT_HOME := \ |
| 93 | $(shell \ |
| 94 | if [ -d $(ABS_JDK_IMAGE) ] ; then \ |
| 95 | $(ECHO) "$(ABS_JDK_IMAGE)"; \ |
| 96 | else \ |
| 97 | $(ECHO) "$(ABS_PLATFORM_BUILD_ROOT)"; \ |
ohair | 8e0a08d | 2009-03-31 16:12:56 -0700 | [diff] [blame] | 98 | fi) |
| 99 | PRODUCT_HOME := $(PRODUCT_HOME) |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 100 | endif |
| 101 | |
ohair | 8e0a08d | 2009-03-31 16:12:56 -0700 | [diff] [blame] | 102 | # Expect JPRT to set JPRT_PRODUCT_ARGS (e.g. -server etc.) |
| 103 | # Should be passed into 'java' only. |
ohair | 7aae9af | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 104 | # Could include: -d64 -server -client OR any java option |
ohair | 8e0a08d | 2009-03-31 16:12:56 -0700 | [diff] [blame] | 105 | ifdef JPRT_PRODUCT_ARGS |
| 106 | JAVA_ARGS = $(JPRT_PRODUCT_ARGS) |
| 107 | endif |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 108 | |
ohair | 8e0a08d | 2009-03-31 16:12:56 -0700 | [diff] [blame] | 109 | # Expect JPRT to set JPRT_PRODUCT_VM_ARGS (e.g. -Xcomp etc.) |
| 110 | # Should be passed into anything running the vm (java, javac, javadoc, ...). |
| 111 | ifdef JPRT_PRODUCT_VM_ARGS |
| 112 | JAVA_VM_ARGS = $(JPRT_PRODUCT_VM_ARGS) |
| 113 | endif |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 114 | |
ohair | 8e0a08d | 2009-03-31 16:12:56 -0700 | [diff] [blame] | 115 | # Expect JPRT to set JPRT_ARCHIVE_BUNDLE (path to zip bundle for results) |
ohair | 8e0a08d | 2009-03-31 16:12:56 -0700 | [diff] [blame] | 116 | ifdef JPRT_ARCHIVE_BUNDLE |
| 117 | ARCHIVE_BUNDLE = $(JPRT_ARCHIVE_BUNDLE) |
mduigou | 122c592 | 2013-11-05 19:44:41 -0800 | [diff] [blame] | 118 | else |
| 119 | ARCHIVE_BUNDLE = $(ABS_TEST_OUTPUT_DIR)/ARCHIVE_BUNDLE.zip |
ohair | 8e0a08d | 2009-03-31 16:12:56 -0700 | [diff] [blame] | 120 | endif |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 121 | |
ohair | 8e0a08d | 2009-03-31 16:12:56 -0700 | [diff] [blame] | 122 | # How to create the test bundle (pass or fail, we want to create this) |
| 123 | # Follow command with ";$(BUNDLE_UP_AND_EXIT)", so it always gets executed. |
ohair | 4125be8 | 2010-05-12 21:35:55 -0700 | [diff] [blame] | 124 | ZIP_UP_RESULTS = ( $(MKDIR) -p `$(DIRNAME) $(ARCHIVE_BUNDLE)` \ |
ohair | 8e0a08d | 2009-03-31 16:12:56 -0700 | [diff] [blame] | 125 | && $(CD) $(ABS_TEST_OUTPUT_DIR) \ |
ohair | 42ea6c2 | 2011-03-22 11:08:09 -0700 | [diff] [blame] | 126 | && $(CHMOD) -R a+r . \ |
ohair | 8e0a08d | 2009-03-31 16:12:56 -0700 | [diff] [blame] | 127 | && $(ZIP) -q -r $(ARCHIVE_BUNDLE) . ) |
mduigou | 122c592 | 2013-11-05 19:44:41 -0800 | [diff] [blame] | 128 | |
| 129 | # important results files |
| 130 | SUMMARY_TXT = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/JTreport/text/summary.txt") |
ohair | 7aae9af | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 131 | STATS_TXT_NAME = Stats.txt |
mduigou | 122c592 | 2013-11-05 19:44:41 -0800 | [diff] [blame] | 132 | STATS_TXT = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/$(STATS_TXT_NAME)") |
| 133 | RUNLIST = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/runlist.txt") |
| 134 | PASSLIST = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/passlist.txt") |
| 135 | FAILLIST = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/faillist.txt") |
| 136 | EXITCODE = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/exitcode.txt") |
ohair | 70d49e3 | 2009-12-01 08:51:16 -0800 | [diff] [blame] | 137 | |
| 138 | TESTEXIT = \ |
| 139 | if [ ! -s $(EXITCODE) ] ; then \ |
| 140 | $(ECHO) "ERROR: EXITCODE file not filled in."; \ |
| 141 | $(ECHO) "1" > $(EXITCODE); \ |
| 142 | fi ; \ |
| 143 | testExitCode=`$(CAT) $(EXITCODE)`; \ |
| 144 | $(ECHO) "EXIT CODE: $${testExitCode}"; \ |
ohair | f6f9ba5 | 2009-12-09 09:46:57 -0800 | [diff] [blame] | 145 | exit $${testExitCode} |
ohair | 70d49e3 | 2009-12-01 08:51:16 -0800 | [diff] [blame] | 146 | |
ohair | 7aae9af | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 147 | BUNDLE_UP_AND_EXIT = \ |
| 148 | ( \ |
ohair | 70d49e3 | 2009-12-01 08:51:16 -0800 | [diff] [blame] | 149 | jtregExitCode=$$? && \ |
ohair | 7aae9af | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 150 | _summary="$(SUMMARY_TXT)"; \ |
ohair | 70d49e3 | 2009-12-01 08:51:16 -0800 | [diff] [blame] | 151 | $(RM) -f $(STATS_TXT) $(RUNLIST) $(PASSLIST) $(FAILLIST) $(EXITCODE); \ |
| 152 | $(ECHO) "$${jtregExitCode}" > $(EXITCODE); \ |
ohair | 7aae9af | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 153 | if [ -r "$${_summary}" ] ; then \ |
ohair | f6f9ba5 | 2009-12-09 09:46:57 -0800 | [diff] [blame] | 154 | $(ECHO) "Summary: $(UNIQUE_DIR)" > $(STATS_TXT); \ |
ohair | 7aae9af | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 155 | $(EXPAND) $${_summary} | $(EGREP) -v ' Not run\.' > $(RUNLIST); \ |
| 156 | $(EGREP) ' Passed\.' $(RUNLIST) \ |
| 157 | | $(EGREP) -v ' Error\.' \ |
| 158 | | $(EGREP) -v ' Failed\.' > $(PASSLIST); \ |
| 159 | ( $(EGREP) ' Failed\.' $(RUNLIST); \ |
| 160 | $(EGREP) ' Error\.' $(RUNLIST); \ |
| 161 | $(EGREP) -v ' Passed\.' $(RUNLIST) ) \ |
| 162 | | $(SORT) | $(UNIQ) > $(FAILLIST); \ |
ohair | 70d49e3 | 2009-12-01 08:51:16 -0800 | [diff] [blame] | 163 | if [ $${jtregExitCode} != 0 -o -s $(FAILLIST) ] ; then \ |
ohair | 7aae9af | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 164 | $(EXPAND) $(FAILLIST) \ |
| 165 | | $(CUT) -d' ' -f1 \ |
| 166 | | $(SED) -e 's@^@FAILED: @' >> $(STATS_TXT); \ |
ohair | 70d49e3 | 2009-12-01 08:51:16 -0800 | [diff] [blame] | 167 | if [ $${jtregExitCode} = 0 ] ; then \ |
| 168 | jtregExitCode=1; \ |
| 169 | fi; \ |
ohair | 7aae9af | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 170 | fi; \ |
| 171 | runc="`$(CAT) $(RUNLIST) | $(WC) -l | $(AWK) '{print $$1;}'`"; \ |
| 172 | passc="`$(CAT) $(PASSLIST) | $(WC) -l | $(AWK) '{print $$1;}'`"; \ |
| 173 | failc="`$(CAT) $(FAILLIST) | $(WC) -l | $(AWK) '{print $$1;}'`"; \ |
mduigou | 122c592 | 2013-11-05 19:44:41 -0800 | [diff] [blame] | 174 | exclc="FIXME CODETOOLS-7900176"; \ |
| 175 | $(ECHO) "TEST STATS: name=$(UNIQUE_DIR) run=$${runc} pass=$${passc} fail=$${failc}" \ |
ohair | 7aae9af | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 176 | >> $(STATS_TXT); \ |
| 177 | else \ |
| 178 | $(ECHO) "Missing file: $${_summary}" >> $(STATS_TXT); \ |
| 179 | fi; \ |
ohair | 42ea6c2 | 2011-03-22 11:08:09 -0700 | [diff] [blame] | 180 | if [ -f $(STATS_TXT) ] ; then \ |
| 181 | $(CAT) $(STATS_TXT); \ |
| 182 | fi; \ |
ohair | 45110f4 | 2010-03-06 14:59:23 -0800 | [diff] [blame] | 183 | $(ZIP_UP_RESULTS) ; \ |
ohair | 70d49e3 | 2009-12-01 08:51:16 -0800 | [diff] [blame] | 184 | $(TESTEXIT) \ |
ohair | 7aae9af | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 185 | ) |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 186 | |
ohair | 8e0a08d | 2009-03-31 16:12:56 -0700 | [diff] [blame] | 187 | ################################################################ |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 188 | |
ohair | bb3b48c | 2011-12-12 08:17:28 -0800 | [diff] [blame] | 189 | # Default make rule (runs default jdk tests) |
| 190 | all: jdk_default |
ohair | 8e0a08d | 2009-03-31 16:12:56 -0700 | [diff] [blame] | 191 | @$(ECHO) "Testing completed successfully" |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 192 | |
ohair | 8e0a08d | 2009-03-31 16:12:56 -0700 | [diff] [blame] | 193 | # Prep for output |
mduigou | 122c592 | 2013-11-05 19:44:41 -0800 | [diff] [blame] | 194 | # Change execute permissions on shared library files. |
| 195 | # Files in repositories should never have execute permissions, but |
| 196 | # there are some tests that have pre-built shared libraries, and these |
| 197 | # windows dll files must have execute permission. Adding execute |
| 198 | # permission may happen automatically on windows when using certain |
| 199 | # versions of mercurial but it cannot be guaranteed. And blindly |
| 200 | # adding execute permission might be seen as a mercurial 'change', so |
| 201 | # we avoid adding execute permission to repository files. But testing |
| 202 | # from a plain source tree needs the chmod a+rx. Applying the chmod to |
| 203 | # all shared libraries not just dll files. And with CYGWIN and sshd |
| 204 | # service, you may need CYGWIN=ntsec for this to work. |
mduigou | 786a71f | 2013-04-01 12:02:19 -0700 | [diff] [blame] | 205 | prep: |
ohair | 8e0a08d | 2009-03-31 16:12:56 -0700 | [diff] [blame] | 206 | @$(MKDIR) -p $(ABS_TEST_OUTPUT_DIR) |
ohair | 4c64b8b | 2010-06-20 14:53:36 -0700 | [diff] [blame] | 207 | @$(MKDIR) -p `$(DIRNAME) $(ARCHIVE_BUNDLE)` |
mduigou | 122c592 | 2013-11-05 19:44:41 -0800 | [diff] [blame] | 208 | @if [ ! -d $(TEST_ROOT)/../.hg ] ; then \ |
| 209 | $(FIND) $(TEST_ROOT) \( -name \*.dll -o -name \*.DLL -o -name \*.so \) \ |
| 210 | -exec $(CHMOD) a+rx {} \; ; \ |
| 211 | fi |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 212 | |
| 213 | # Cleanup |
| 214 | clean: |
mduigou | ba95ae8 | 2013-02-06 11:28:25 -0800 | [diff] [blame] | 215 | @$(RM) -r $(ABS_TEST_OUTPUT_DIR) |
| 216 | @$(RM) $(ARCHIVE_BUNDLE) |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 217 | |
ohair | 8e0a08d | 2009-03-31 16:12:56 -0700 | [diff] [blame] | 218 | ################################################################ |
| 219 | |
| 220 | # jtreg tests |
| 221 | |
| 222 | # Expect JT_HOME to be set for jtreg tests. (home for jtreg) |
ohair | 588765d | 2009-11-23 09:51:52 -0800 | [diff] [blame] | 223 | ifndef JT_HOME |
weijun | bbba0c2 | 2011-09-22 12:05:26 +0800 | [diff] [blame] | 224 | JT_HOME = $(SLASH_JAVA)/re/jtreg/4.1/promoted/latest/binaries/jtreg |
ohair | 588765d | 2009-11-23 09:51:52 -0800 | [diff] [blame] | 225 | ifdef JPRT_JTREG_HOME |
| 226 | JT_HOME = $(JPRT_JTREG_HOME) |
| 227 | endif |
ohair | 8e0a08d | 2009-03-31 16:12:56 -0700 | [diff] [blame] | 228 | endif |
| 229 | |
mduigou | 122c592 | 2013-11-05 19:44:41 -0800 | [diff] [blame] | 230 | # Problematic tests to be excluded |
| 231 | PROBLEM_LISTS=$(call MixedDirs,$(wildcard ProblemList.txt closed/ProblemList.txt)) |
ohair | 7aae9af | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 232 | |
| 233 | # Create exclude list for this platform and arch |
| 234 | ifdef NO_EXCLUDES |
mduigou | 122c592 | 2013-11-05 19:44:41 -0800 | [diff] [blame] | 235 | JTREG_EXCLUSIONS = |
ohair | 7aae9af | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 236 | else |
mduigou | 122c592 | 2013-11-05 19:44:41 -0800 | [diff] [blame] | 237 | JTREG_EXCLUSIONS = $(PROBLEM_LISTS:%=-exclude:%) |
ohair | 7aae9af | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 238 | endif |
| 239 | |
mduigou | 122c592 | 2013-11-05 19:44:41 -0800 | [diff] [blame] | 240 | # convert list of directories to dos paths |
| 241 | define MixedDirs |
| 242 | $(foreach i,$1,$(shell $(GETMIXEDPATH) "${i}")) |
ohair | 588765d | 2009-11-23 09:51:52 -0800 | [diff] [blame] | 243 | endef |
mduigou | 122c592 | 2013-11-05 19:44:41 -0800 | [diff] [blame] | 244 | |
ohair | 7aae9af | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 245 | define SummaryInfo |
ohair | f6f9ba5 | 2009-12-09 09:46:57 -0800 | [diff] [blame] | 246 | $(ECHO) "########################################################" |
ohair | 7aae9af | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 247 | $(CAT) $(?:%=$(ABS_TEST_OUTPUT_DIR)/%/$(STATS_TXT_NAME)) |
ohair | f6f9ba5 | 2009-12-09 09:46:57 -0800 | [diff] [blame] | 248 | $(ECHO) "########################################################" |
ohair | 7aae9af | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 249 | endef |
| 250 | |
| 251 | # ------------------------------------------------------------------ |
| 252 | |
alanb | 5910028 | 2013-11-19 14:08:28 +0000 | [diff] [blame] | 253 | jdk_% core_% svc_%: |
mduigou | 122c592 | 2013-11-05 19:44:41 -0800 | [diff] [blame] | 254 | $(ECHO) "Running tests: $@" |
| 255 | for each in $@; do \ |
| 256 | $(MAKE) -j 1 TEST_SELECTION=":$$each" UNIQUE_DIR=$$each jtreg_tests; \ |
| 257 | done |
ohair | 7aae9af | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 258 | |
| 259 | # ------------------------------------------------------------------ |
| 260 | |
mduigou | fc55db0 | 2013-07-27 12:26:01 -0700 | [diff] [blame] | 261 | ifdef CONCURRENCY |
| 262 | EXTRA_JTREG_OPTIONS += -concurrency:$(CONCURRENCY) |
| 263 | endif |
| 264 | |
ohair | 8e0a08d | 2009-03-31 16:12:56 -0700 | [diff] [blame] | 265 | # Default JTREG to run (win32 script works for everybody) |
| 266 | JTREG = $(JT_HOME)/win32/bin/jtreg |
mduigou | fc55db0 | 2013-07-27 12:26:01 -0700 | [diff] [blame] | 267 | # run in agentvm mode |
| 268 | JTREG_BASIC_OPTIONS += -agentvm |
ohair | 7aae9af | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 269 | # Only run automatic tests |
| 270 | JTREG_BASIC_OPTIONS += -a |
ohair | ccc534d | 2009-12-11 15:29:22 -0800 | [diff] [blame] | 271 | # Always turn on assertions |
| 272 | JTREG_ASSERT_OPTION = -ea -esa |
| 273 | JTREG_BASIC_OPTIONS += $(JTREG_ASSERT_OPTION) |
ohair | 7aae9af | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 274 | # Report details on all failed or error tests, times too |
| 275 | JTREG_BASIC_OPTIONS += -v:fail,error,time |
| 276 | # Retain all files for failing tests |
| 277 | JTREG_BASIC_OPTIONS += -retain:fail,error |
| 278 | # Ignore tests are not run and completely silent about it |
ohair | ccc534d | 2009-12-11 15:29:22 -0800 | [diff] [blame] | 279 | JTREG_IGNORE_OPTION = -ignore:quiet |
| 280 | JTREG_BASIC_OPTIONS += $(JTREG_IGNORE_OPTION) |
ohair | f6f9ba5 | 2009-12-09 09:46:57 -0800 | [diff] [blame] | 281 | # Multiple by 4 the timeout numbers |
ohair | ccc534d | 2009-12-11 15:29:22 -0800 | [diff] [blame] | 282 | JTREG_TIMEOUT_OPTION = -timeoutFactor:4 |
| 283 | JTREG_BASIC_OPTIONS += $(JTREG_TIMEOUT_OPTION) |
mduigou | d3e0b44 | 2013-05-22 09:59:37 -0700 | [diff] [blame] | 284 | # Set the max memory for jtreg control vm |
ohair | ccc534d | 2009-12-11 15:29:22 -0800 | [diff] [blame] | 285 | JTREG_MEMORY_OPTION = -J-Xmx512m |
| 286 | JTREG_BASIC_OPTIONS += $(JTREG_MEMORY_OPTION) |
mduigou | fc55db0 | 2013-07-27 12:26:01 -0700 | [diff] [blame] | 287 | # Add any extra options |
| 288 | JTREG_BASIC_OPTIONS += $(EXTRA_JTREG_OPTIONS) |
| 289 | # Set other vm and test options |
| 290 | JTREG_TEST_OPTIONS = $(JAVA_ARGS:%=-javaoptions:%) $(JAVA_VM_ARGS:%=-vmoption:%) |
| 291 | # Set the GC options for test vms |
| 292 | #JTREG_GC_OPTION = -vmoption:-XX:+UseSerialGC |
| 293 | #JTREG_TEST_OPTIONS += $(JTREG_GC_OPTION) |
mduigou | d3e0b44 | 2013-05-22 09:59:37 -0700 | [diff] [blame] | 294 | # Set the max memory for jtreg target test vms |
| 295 | JTREG_TESTVM_MEMORY_OPTION = -vmoption:-Xmx512m |
| 296 | JTREG_TEST_OPTIONS += $(JTREG_TESTVM_MEMORY_OPTION) |
ohair | 8e0a08d | 2009-03-31 16:12:56 -0700 | [diff] [blame] | 297 | |
ohair | 7aae9af | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 298 | # Make sure jtreg exists |
| 299 | $(JTREG): $(JT_HOME) |
| 300 | |
| 301 | # Run jtreg |
mduigou | 122c592 | 2013-11-05 19:44:41 -0800 | [diff] [blame] | 302 | jtreg_tests: prep $(PRODUCT_HOME) $(JTREG) |
ohair | 7aae9af | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 303 | ( \ |
| 304 | ( JT_HOME=$(shell $(GETMIXEDPATH) "$(JT_HOME)"); \ |
| 305 | export JT_HOME; \ |
ohair | 7aae9af | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 306 | $(shell $(GETMIXEDPATH) "$(JTREG)") \ |
| 307 | $(JTREG_BASIC_OPTIONS) \ |
mduigou | 122c592 | 2013-11-05 19:44:41 -0800 | [diff] [blame] | 308 | -r:$(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/JTreport") \ |
| 309 | -w:$(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/JTwork") \ |
ohair | 7aae9af | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 310 | -jdk:$(shell $(GETMIXEDPATH) "$(PRODUCT_HOME)") \ |
mduigou | 122c592 | 2013-11-05 19:44:41 -0800 | [diff] [blame] | 311 | $(JTREG_EXCLUSIONS) \ |
ohair | 7aae9af | 2009-11-08 15:11:10 -0800 | [diff] [blame] | 312 | $(JTREG_TEST_OPTIONS) \ |
mduigou | 122c592 | 2013-11-05 19:44:41 -0800 | [diff] [blame] | 313 | $(TEST_SELECTION) \ |
| 314 | ) ; \ |
| 315 | $(BUNDLE_UP_AND_EXIT) \ |
ohair | 70d49e3 | 2009-12-01 08:51:16 -0800 | [diff] [blame] | 316 | ) 2>&1 | $(TEE) $(ABS_TEST_OUTPUT_DIR)/output.txt ; $(TESTEXIT) |
ohair | 8e0a08d | 2009-03-31 16:12:56 -0700 | [diff] [blame] | 317 | |
mduigou | 122c592 | 2013-11-05 19:44:41 -0800 | [diff] [blame] | 318 | PHONY_LIST += jtreg_tests |
ohair | 8e0a08d | 2009-03-31 16:12:56 -0700 | [diff] [blame] | 319 | |
| 320 | ################################################################ |
| 321 | |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 322 | # Phony targets (e.g. these are not filenames) |
ohair | 8e0a08d | 2009-03-31 16:12:56 -0700 | [diff] [blame] | 323 | .PHONY: all clean prep $(PHONY_LIST) |
| 324 | |
| 325 | ################################################################ |