annotate test/TestCommon.gmk @ 46192:14c55d15c9d7

8174203: Enable AOT Jtreg tests on Windows x86_64 Reviewed-by: erikj, dholmes
author bobv
date Tue, 14 Feb 2017 11:25:04 -0500
parents 2ac2a6ef14a6
children 7d73b0bb32b1
rev   line source
ihse@42424 1 #
bobv@46192 2 # Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved.
ihse@42424 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
ihse@42424 4 #
ihse@42424 5 # This code is free software; you can redistribute it and/or modify it
ihse@42424 6 # under the terms of the GNU General Public License version 2 only, as
ihse@42424 7 # published by the Free Software Foundation. Oracle designates this
ihse@42424 8 # particular file as subject to the "Classpath" exception as provided
ihse@42424 9 # by Oracle in the LICENSE file that accompanied this code.
ihse@42424 10 #
ihse@42424 11 # This code is distributed in the hope that it will be useful, but WITHOUT
ihse@42424 12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ihse@42424 13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
ihse@42424 14 # version 2 for more details (a copy is included in the LICENSE file that
ihse@42424 15 # accompanied this code).
ihse@42424 16 #
ihse@42424 17 # You should have received a copy of the GNU General Public License version
ihse@42424 18 # 2 along with this work; if not, write to the Free Software Foundation,
ihse@42424 19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
ihse@42424 20 #
ihse@42424 21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
ihse@42424 22 # or visit www.oracle.com if you need additional information or have any
ihse@42424 23 # questions.
ihse@42424 24 #
ihse@42424 25
ihse@42424 26 #
ihse@42424 27 # Common logic to run various tests for a component, to be included by the
ihse@42424 28 # component specific test makefiles.
ihse@42424 29 #
ihse@42424 30
ihse@42424 31 # Default values for some properties that can be overridden by components.
ihse@42424 32 USE_JTREG_VERSION ?= 4.2
ihse@42424 33 JTREG_VM_TYPE ?= -agentvm
ihse@42424 34 USE_JTREG_ASSERT ?= true
ihse@42424 35 LIMIT_JTREG_VM_MEMORY ?= true
ihse@42424 36
ihse@42424 37 .DEFAULT : all
ihse@42424 38
ihse@42424 39 # Empty these to get rid of some default rules
ihse@42424 40 .SUFFIXES:
ihse@42424 41 .SUFFIXES: .java
ihse@42424 42 CO=
ihse@42424 43 GET=
ihse@42424 44
ihse@42424 45 # Utilities used
ihse@42424 46 AWK = awk
ihse@42424 47 CAT = cat
ihse@42424 48 CD = cd
ihse@42424 49 CHMOD = chmod
ihse@42424 50 CP = cp
ihse@42424 51 CUT = cut
ihse@42424 52 DIRNAME = dirname
ihse@42424 53 ECHO = echo
ihse@42424 54 EGREP = egrep
ihse@42424 55 EXPAND = expand
ihse@42424 56 FIND = find
ihse@42424 57 MKDIR = mkdir
ihse@42424 58 PWD = pwd
ihse@42424 59 RM = rm -f
ihse@42424 60 SED = sed
ihse@42424 61 SORT = sort
ihse@42424 62 TEE = tee
ihse@42424 63 UNAME = uname
ihse@42424 64 UNIQ = uniq
ihse@42424 65 WC = wc
ihse@42424 66 ZIPEXE = zip
ihse@42424 67
ihse@42424 68 # Get OS name from uname (Cygwin inexplicably adds _NT-5.1)
ihse@42424 69 UNAME_S := $(shell $(UNAME) -s | $(CUT) -f1 -d_)
ihse@42424 70
ihse@42424 71 # Commands to run on paths to make mixed paths for java on windows
ihse@42424 72 ifeq ($(findstring CYGWIN,$(UNAME_S)), CYGWIN)
ihse@42424 73 # Location of developer shared files
ihse@42424 74 SLASH_JAVA = J:
ihse@42424 75 GETMIXEDPATH = cygpath -m
ihse@42424 76 PLATFORM = windows
ihse@42424 77 else
ihse@42424 78 # Location of developer shared files
ihse@42424 79 SLASH_JAVA = /java
ihse@42424 80 GETMIXEDPATH = $(ECHO)
ihse@42424 81 PLATFORM = unix # we only care about windows or bsd.
ihse@42424 82 ifeq ($(UNAME_S), Darwin)
ihse@42424 83 PLATFORM = bsd
ihse@42424 84 endif
ihse@42424 85 ifeq ($(findstring BSD,$(UNAME_S)), BSD)
ihse@42424 86 PLATFORM = bsd
ihse@42424 87 endif
ihse@42424 88 endif
ihse@42424 89
ihse@42424 90 ifdef ALT_SLASH_JAVA
ihse@42424 91 SLASH_JAVA = $(ALT_SLASH_JAVA)
ihse@42424 92 endif
ihse@42424 93
ihse@42424 94 # Root of this test area (important to use full paths in some places)
ihse@42424 95 TEST_ROOT := $(shell $(PWD))
ihse@42424 96
ihse@42424 97 # Root of all test results
ihse@42424 98 ifdef TEST_OUTPUT_DIR
ihse@42424 99 $(shell $(MKDIR) -p $(TEST_OUTPUT_DIR)/jtreg)
ihse@42424 100 ABS_TEST_OUTPUT_DIR := \
ihse@42424 101 $(shell $(CD) $(TEST_OUTPUT_DIR)/jtreg && $(PWD))
ihse@42424 102 else
ihse@42424 103 ifdef ALT_OUTPUTDIR
ihse@42424 104 ABS_OUTPUTDIR = $(shell $(CD) $(ALT_OUTPUTDIR) && $(PWD))
ihse@42424 105 else
ihse@42424 106 ABS_OUTPUTDIR = $(shell $(CD) $(TEST_ROOT)/.. && $(PWD))
ihse@42424 107 endif
ihse@42424 108
ihse@42424 109 ABS_PLATFORM_BUILD_ROOT = $(ABS_OUTPUTDIR)
ihse@42424 110 ABS_TEST_OUTPUT_DIR := $(ABS_PLATFORM_BUILD_ROOT)/testoutput/$(UNIQUE_DIR)
ihse@42424 111 endif
ihse@42424 112
ihse@42424 113 # Expect JPRT to set PRODUCT_HOME (the product or jdk in this case to test)
ihse@42424 114 ifndef PRODUCT_HOME
ihse@42424 115 # Try to use images/jdk if it exists
ihse@42424 116 ABS_JDK_IMAGE = $(ABS_PLATFORM_BUILD_ROOT)/images/jdk
ihse@42424 117 PRODUCT_HOME := \
ihse@42424 118 $(shell \
ihse@42424 119 if [ -d $(ABS_JDK_IMAGE) ] ; then \
ihse@42424 120 $(ECHO) "$(ABS_JDK_IMAGE)"; \
ihse@42424 121 else \
ihse@42424 122 $(ECHO) "$(ABS_PLATFORM_BUILD_ROOT)"; \
ihse@42424 123 fi)
ihse@42424 124 PRODUCT_HOME := $(PRODUCT_HOME)
ihse@42424 125 endif
ihse@42424 126
ihse@42424 127 # Expect JPRT to set JAVA_ARGS (e.g. -server etc.)
ihse@42424 128 ifdef JAVA_ARGS
ihse@42424 129 JAVA_OPTIONS := $(JAVA_ARGS)
ihse@42424 130 else
ihse@42424 131 JAVA_OPTIONS :=
ihse@42424 132 endif
ihse@42424 133
ihse@42424 134 # Expect JPRT to set JPRT_PRODUCT_ARGS (e.g. -server etc.)
ihse@42424 135 # Should be passed into 'java' only.
ihse@42424 136 # Could include: -d64 -server -client OR any java option
ihse@42424 137 ifdef JPRT_PRODUCT_ARGS
ihse@42424 138 JAVA_ARGS = $(JPRT_PRODUCT_ARGS)
ihse@42424 139 endif
ihse@42424 140
ihse@42424 141 # Expect JPRT to set JPRT_PRODUCT_VM_ARGS (e.g. -Xcomp etc.)
ihse@42424 142 # Should be passed into anything running the vm (java, javac, javadoc, ...).
ihse@42424 143 ifdef JPRT_PRODUCT_VM_ARGS
ihse@42424 144 JAVA_VM_ARGS = $(JPRT_PRODUCT_VM_ARGS)
ihse@42424 145 endif
ihse@42424 146
ihse@42424 147 ifneq ($(NATIVE_TEST_PATH), )
ihse@42424 148 # jtreg -nativepath <dir>
ihse@42424 149 #
ihse@42424 150 # Local make tests will be TEST_IMAGE_DIR and JPRT with jprt.use.reg.test.bundle=true
ihse@42424 151 # should be JPRT_TESTNATIVE_PATH
ihse@42424 152 ifdef TEST_IMAGE_DIR
ihse@42424 153 TESTNATIVE_DIR = $(TEST_IMAGE_DIR)
ihse@42424 154 else ifdef JPRT_TESTNATIVE_PATH
ihse@42424 155 TESTNATIVE_DIR = $(JPRT_TESTNATIVE_PATH)
ihse@42424 156 endif
ihse@42424 157 ifdef TESTNATIVE_DIR
ihse@42424 158 JTREG_NATIVE_PATH = -nativepath:$(shell $(GETMIXEDPATH) "$(TESTNATIVE_DIR)/$(NATIVE_TEST_PATH)")
ihse@42424 159 endif
ihse@42424 160 endif
ihse@42424 161
ihse@42424 162 ifeq ($(USE_FAILURE_HANDLER), true)
ihse@42424 163 # jtreg failure handler config
ihse@42424 164 ifeq ($(FAILURE_HANDLER_DIR), )
ihse@42424 165 ifneq ($(TESTNATIVE_DIR), )
ihse@42424 166 FAILURE_HANDLER_DIR := $(TESTNATIVE_DIR)/failure_handler
ihse@42424 167 endif
ihse@42424 168 endif
ihse@42424 169 ifneq ($(FAILURE_HANDLER_DIR), )
ihse@42424 170 FAILURE_HANDLER_DIR_MIXED := $(shell $(GETMIXEDPATH) "$(FAILURE_HANDLER_DIR)")
ihse@42424 171 JTREG_FAILURE_HANDLER_OPTIONS := \
ihse@42424 172 -timeoutHandlerDir:$(FAILURE_HANDLER_DIR_MIXED)/jtregFailureHandler.jar \
ihse@42424 173 -observerDir:$(FAILURE_HANDLER_DIR_MIXED)/jtregFailureHandler.jar \
ihse@42424 174 -timeoutHandler:jdk.test.failurehandler.jtreg.GatherProcessInfoTimeoutHandler \
ihse@42424 175 -observer:jdk.test.failurehandler.jtreg.GatherDiagnosticInfoObserver \
ihse@42424 176 -timeoutHandlerTimeout:0
ihse@42424 177 ifeq ($(PLATFORM), windows)
ihse@42424 178 JTREG_FAILURE_HANDLER_OPTIONS += -J-Djava.library.path="$(FAILURE_HANDLER_DIR_MIXED)"
ihse@42424 179 endif
ihse@42424 180 endif
ihse@42424 181 endif
ihse@42424 182
ihse@42424 183 # Expect JPRT to set JPRT_ARCHIVE_BUNDLE (path to zip bundle for results)
ihse@42424 184 ifdef JPRT_ARCHIVE_BUNDLE
ihse@42424 185 ARCHIVE_BUNDLE = $(JPRT_ARCHIVE_BUNDLE)
ihse@42424 186 else
ihse@42424 187 ARCHIVE_BUNDLE = $(ABS_TEST_OUTPUT_DIR)/ARCHIVE_BUNDLE.zip
ihse@42424 188 endif
ihse@42424 189
ihse@42424 190 # How to create the test bundle (pass or fail, we want to create this)
ihse@42424 191 # Follow command with ";$(BUNDLE_UP_AND_EXIT)", so it always gets executed.
ihse@42424 192 ZIP_UP_RESULTS = ( $(MKDIR) -p `$(DIRNAME) $(ARCHIVE_BUNDLE)` \
ihse@42424 193 && $(CD) $(ABS_TEST_OUTPUT_DIR) \
ihse@42424 194 && $(CHMOD) -R a+r . \
ihse@42424 195 && $(ZIPEXE) -q -r $(ARCHIVE_BUNDLE) . )
ihse@42424 196
ihse@42424 197 # important results files
ihse@42424 198 SUMMARY_TXT = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/JTreport/text/summary.txt")
ihse@42424 199 STATS_TXT_NAME = Stats.txt
ihse@42424 200 STATS_TXT = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/$(STATS_TXT_NAME)")
ihse@42424 201 RUNLIST = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/runlist.txt")
ihse@42424 202 PASSLIST = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/passlist.txt")
ihse@42424 203 FAILLIST = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/faillist.txt")
ihse@42424 204 EXITCODE = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/exitcode.txt")
ihse@42424 205
ihse@42424 206 TESTEXIT = \
ihse@42424 207 if [ ! -s $(EXITCODE) ] ; then \
ihse@42424 208 $(ECHO) "ERROR: EXITCODE file not filled in."; \
ihse@42424 209 $(ECHO) "1" > $(EXITCODE); \
ihse@42424 210 fi ; \
ihse@42424 211 testExitCode=`$(CAT) $(EXITCODE)`; \
ihse@42424 212 $(ECHO) "EXIT CODE: $${testExitCode}"; \
ihse@42424 213 exit $${testExitCode}
ihse@42424 214
ihse@42424 215 ifeq ($(TREAT_EXIT_CODE_1_AS_0), true)
ihse@42424 216 ADJUST_EXIT_CODE := \
ihse@42424 217 if [ $${jtregExitCode} = 1 ] ; then \
ihse@42424 218 jtregExitCode=0; \
ihse@42424 219 fi
ihse@42424 220 else
ihse@42424 221 # colon is the shell no-op
ihse@42424 222 ADJUST_EXIT_CODE := :
ihse@42424 223 endif
ihse@42424 224
ihse@42424 225 BUNDLE_UP_AND_EXIT = \
ihse@42424 226 ( \
ihse@42424 227 jtregExitCode=$$? && \
ihse@42424 228 _summary="$(SUMMARY_TXT)"; \
ihse@42424 229 $(ADJUST_EXIT_CODE) ; \
ihse@42424 230 $(RM) -f $(STATS_TXT) $(RUNLIST) $(PASSLIST) $(FAILLIST) $(EXITCODE); \
ihse@42424 231 $(ECHO) "$${jtregExitCode}" > $(EXITCODE); \
ihse@42424 232 if [ -r "$${_summary}" ] ; then \
ihse@42424 233 $(ECHO) "Summary: $(UNIQUE_DIR)" > $(STATS_TXT); \
ihse@42424 234 $(EXPAND) $${_summary} | $(EGREP) -v ' Not run\.' > $(RUNLIST); \
ihse@42424 235 $(EGREP) ' Passed\.' $(RUNLIST) \
ihse@42424 236 | $(EGREP) -v ' Error\.' \
ihse@42424 237 | $(EGREP) -v ' Failed\.' > $(PASSLIST); \
ihse@42424 238 ( $(EGREP) ' Failed\.' $(RUNLIST); \
ihse@42424 239 $(EGREP) ' Error\.' $(RUNLIST); \
ihse@42424 240 $(EGREP) -v ' Passed\.' $(RUNLIST) ) \
ihse@42424 241 | $(SORT) | $(UNIQ) > $(FAILLIST); \
ihse@42424 242 if [ $${jtregExitCode} != 0 -o -s $(FAILLIST) ] ; then \
ihse@42424 243 $(EXPAND) $(FAILLIST) \
ihse@42424 244 | $(CUT) -d' ' -f1 \
ihse@42424 245 | $(SED) -e 's@^@FAILED: @' >> $(STATS_TXT); \
ihse@42424 246 if [ $${jtregExitCode} = 0 ] ; then \
ihse@42424 247 jtregExitCode=1; \
ihse@42424 248 fi; \
ihse@42424 249 fi; \
ihse@42424 250 runc="`$(CAT) $(RUNLIST) | $(WC) -l | $(AWK) '{print $$1;}'`"; \
ihse@42424 251 passc="`$(CAT) $(PASSLIST) | $(WC) -l | $(AWK) '{print $$1;}'`"; \
ihse@42424 252 failc="`$(CAT) $(FAILLIST) | $(WC) -l | $(AWK) '{print $$1;}'`"; \
ihse@42424 253 exclc="FIXME CODETOOLS-7900176"; \
ihse@42424 254 $(ECHO) "TEST STATS: name=$(UNIQUE_DIR) run=$${runc} pass=$${passc} fail=$${failc}" \
ihse@42424 255 >> $(STATS_TXT); \
ihse@42424 256 else \
ihse@42424 257 $(ECHO) "Missing file: $${_summary}" >> $(STATS_TXT); \
ihse@42424 258 fi; \
ihse@42424 259 if [ -f $(STATS_TXT) ] ; then \
ihse@42424 260 $(CAT) $(STATS_TXT); \
ihse@42424 261 fi; \
ihse@42424 262 $(ZIP_UP_RESULTS) ; \
ihse@42424 263 $(TESTEXIT) \
ihse@42424 264 )
ihse@42424 265
ihse@42424 266 ################################################################
ihse@42424 267
ihse@42424 268 # Prep for output
ihse@42424 269 # Change execute permissions on shared library files.
ihse@42424 270 # Files in repositories should never have execute permissions, but
ihse@42424 271 # there are some tests that have pre-built shared libraries, and these
ihse@42424 272 # windows dll files must have execute permission. Adding execute
ihse@42424 273 # permission may happen automatically on windows when using certain
ihse@42424 274 # versions of mercurial but it cannot be guaranteed. And blindly
ihse@42424 275 # adding execute permission might be seen as a mercurial 'change', so
ihse@42424 276 # we avoid adding execute permission to repository files. But testing
ihse@42424 277 # from a plain source tree needs the chmod a+rx. Applying the chmod to
ihse@42424 278 # all shared libraries not just dll files. And with CYGWIN and sshd
ihse@42424 279 # service, you may need CYGWIN=ntsec for this to work.
ihse@42424 280 prep:
ihse@42424 281 @$(MKDIR) -p $(ABS_TEST_OUTPUT_DIR)
ihse@42424 282 @$(MKDIR) -p `$(DIRNAME) $(ARCHIVE_BUNDLE)`
ihse@42424 283 @if [ ! -d $(TEST_ROOT)/../.hg ] ; then \
ihse@42424 284 $(FIND) $(TEST_ROOT) \( -name \*.dll -o -name \*.DLL -o -name \*.so \) \
ihse@42424 285 -exec $(CHMOD) a+rx {} \; ; \
ihse@42424 286 fi
ihse@42424 287
ihse@42424 288 ifeq ($(CLEAN_BEFORE_PREP), true)
ihse@42424 289 prep: clean
ihse@42424 290
ihse@42424 291 endif
ihse@42424 292
ihse@42424 293 # Cleanup
ihse@42424 294 clean:
ihse@42424 295 @$(RM) -r $(ABS_TEST_OUTPUT_DIR)
ihse@42424 296 @$(RM) $(ARCHIVE_BUNDLE)
ihse@42424 297
ihse@42424 298 ################################################################
ihse@42424 299
ihse@42424 300 # jtreg tests
ihse@42424 301
ihse@42424 302 # Expect JT_HOME to be set for jtreg tests. (home for jtreg)
ihse@42424 303 ifndef JT_HOME
ihse@42424 304 JT_HOME = $(SLASH_JAVA)/re/jtreg/$(USE_JTREG_VERSION)/promoted/latest/binaries/jtreg
ihse@42424 305 ifdef JPRT_JTREG_HOME
ihse@42424 306 JT_HOME = $(JPRT_JTREG_HOME)
ihse@42424 307 endif
ihse@42424 308 endif
ihse@42424 309
ihse@42424 310 # Problematic tests to be excluded
ihse@42424 311 PROBLEM_LISTS=$(call MixedDirs,$(wildcard ProblemList.txt closed/ProblemList.txt))
ihse@42424 312
ihse@42424 313 # Create exclude list for this platform and arch
ihse@42424 314 ifdef NO_EXCLUDES
ihse@42424 315 JTREG_EXCLUSIONS =
ihse@42424 316 else
ihse@42424 317 JTREG_EXCLUSIONS = $(PROBLEM_LISTS:%=-exclude:%)
ihse@42424 318 endif
ihse@42424 319
ihse@42424 320 # convert list of directories to dos paths
ihse@42424 321 define MixedDirs
ihse@42424 322 $(foreach i,$1,$(shell $(GETMIXEDPATH) "${i}"))
ihse@42424 323 endef
ihse@42424 324
ihse@42424 325 # ------------------------------------------------------------------
ihse@42424 326
ihse@42424 327 # When called from JPRT the TESTDIRS variable is set to the jtreg tests to run
ihse@42424 328 ifdef TESTDIRS
ihse@42424 329 TEST_SELECTION = $(TESTDIRS)
ihse@42424 330 endif
ihse@42424 331
ihse@42424 332 ifdef CONCURRENCY
ihse@42424 333 JTREG_BASIC_OPTIONS += -concurrency:$(CONCURRENCY)
ihse@42424 334 endif
ihse@42424 335 ifdef EXTRA_JTREG_OPTIONS
ihse@42424 336 JTREG_BASIC_OPTIONS += $(EXTRA_JTREG_OPTIONS)
ihse@42424 337 endif
ihse@42424 338
ihse@42424 339 # Default JTREG to run
ihse@42424 340 JTREG = $(JT_HOME)/bin/jtreg
ihse@42424 341 # run in agentvm/othervm mode
ihse@42424 342 JTREG_BASIC_OPTIONS += $(JTREG_VM_TYPE)
ihse@42424 343 # Only run automatic tests
ihse@42424 344 JTREG_BASIC_OPTIONS += -a
ihse@42424 345 # Always turn on assertions
ihse@42424 346 ifeq ($(USE_JTREG_ASSERT), true)
ihse@42424 347 JTREG_ASSERT_OPTION = -ea -esa
ihse@42424 348 endif
ihse@42424 349 JTREG_BASIC_OPTIONS += $(JTREG_ASSERT_OPTION)
ihse@42424 350 # jtreg verbosity setting
ihse@42424 351 # Default is to report details on all failed or error tests, times too
ihse@42424 352 JTREG_VERBOSE ?= fail,error,time
ihse@42424 353 JTREG_BASIC_OPTIONS += $(if $(JTREG_VERBOSE),-v:$(JTREG_VERBOSE))
ihse@42424 354 # Retain all files for failing tests
ihse@42424 355 JTREG_BASIC_OPTIONS += -retain:fail,error
ihse@42424 356 # Ignore tests are not run and completely silent about it
ihse@42424 357 JTREG_IGNORE_OPTION = -ignore:quiet
ihse@42424 358 JTREG_BASIC_OPTIONS += $(JTREG_IGNORE_OPTION)
ihse@42424 359 # Multiply by 4 the timeout factor
ihse@42424 360 JTREG_TIMEOUT_OPTION = -timeoutFactor:4
ihse@42424 361 JTREG_BASIC_OPTIONS += $(JTREG_TIMEOUT_OPTION)
ihse@42424 362 ifeq ($(LIMIT_JTREG_VM_MEMORY), true)
ihse@42424 363 # Set the max memory for jtreg control vm
ihse@42424 364 JTREG_MEMORY_OPTION = -J-Xmx512m
ihse@42424 365 JTREG_BASIC_OPTIONS += $(JTREG_MEMORY_OPTION)
ihse@42424 366 # Set the max memory for jtreg target test vms
ihse@42424 367 JTREG_TESTVM_MEMORY_OPTION = -vmoption:-Xmx512m
ihse@42424 368 JTREG_TEST_OPTIONS += $(JTREG_TESTVM_MEMORY_OPTION)
ihse@42424 369 endif
ihse@42424 370 # Give tests access to JT_JAVA, see JDK-8141609
ihse@42424 371 JTREG_BASIC_OPTIONS += -e:JDK8_HOME=${JT_JAVA}
bobv@46192 372 # Give aot tests access to Visual Studio installation
bobv@46192 373 ifneq ($(VS120COMNTOOLS), )
bobv@46192 374 JTREG_BASIC_OPTIONS += -e:VS120COMNTOOLS=$(shell $(GETMIXEDPATH) "$(VS120COMNTOOLS)")
bobv@46192 375 endif
ihse@42424 376 # Set other vm and test options
ihse@42424 377 JTREG_TEST_OPTIONS = $(JAVA_ARGS:%=-javaoptions:%) $(JAVA_OPTIONS:%=-vmoption:%) $(JAVA_VM_ARGS:%=-vmoption:%)
ihse@42424 378
ihse@42424 379 ifeq ($(IGNORE_MARKED_TESTS), true)
ihse@42424 380 # Option to tell jtreg to not run tests marked with "ignore"
ihse@42424 381 ifeq ($(PLATFORM), windows)
ihse@42424 382 JTREG_KEY_OPTION = -k:!ignore
ihse@42424 383 else
ihse@42424 384 JTREG_KEY_OPTION = -k:\!ignore
ihse@42424 385 endif
ihse@42424 386 JTREG_BASIC_OPTIONS += $(JTREG_KEY_OPTION)
ihse@42424 387 endif
ihse@42424 388
ihse@42424 389 # Make sure jtreg exists
ihse@42424 390 ifeq ($(USE_WINDOWS_EXISTENCE_CHECK), true)
ihse@42424 391 jtreg_exists:
ihse@42424 392 test -d $(shell $(GETMIXEDPATH) "$(JT_HOME)")
ihse@42424 393 test -f $(shell $(GETMIXEDPATH) "$(JTREG)")
ihse@42424 394
ihse@42424 395 else
ihse@42424 396 jtreg_exists: $(JT_HOME)
ihse@42424 397 endif
ihse@42424 398 PHONY_LIST += jtreg_exists
ihse@42424 399
ihse@42424 400 # Run jtreg
ihse@42424 401 jtreg_tests: prep jtreg_exists $(PRODUCT_HOME)
ihse@42424 402 ( \
ihse@42424 403 ( JT_HOME=$(shell $(GETMIXEDPATH) "$(JT_HOME)"); \
ihse@42424 404 export JT_HOME; \
ihse@42424 405 $(shell $(GETMIXEDPATH) "$(JTREG)") \
ihse@42424 406 $(JTREG_BASIC_OPTIONS) \
ihse@42424 407 -r:$(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/JTreport") \
ihse@42424 408 -w:$(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/JTwork") \
ihse@42424 409 -jdk:$(shell $(GETMIXEDPATH) "$(PRODUCT_HOME)") \
ihse@42424 410 $(JTREG_NATIVE_PATH) \
ihse@42424 411 $(JTREG_FAILURE_HANDLER_OPTIONS) \
ihse@42424 412 $(JTREG_EXCLUSIONS) \
ihse@42424 413 $(JTREG_TEST_OPTIONS) \
ihse@42424 414 $(TEST_SELECTION) \
ihse@42424 415 ) ; \
ihse@42424 416 $(BUNDLE_UP_AND_EXIT) \
ihse@42424 417 ) 2>&1 | $(TEE) $(ABS_TEST_OUTPUT_DIR)/output.txt ; $(TESTEXIT)
ihse@42424 418
ihse@42424 419 PHONY_LIST += jtreg_tests
ihse@42424 420
ihse@42424 421 ################################################################
ihse@42424 422
ihse@42424 423 # Phony targets (e.g. these are not filenames)
ihse@42424 424 .PHONY: all clean prep $(PHONY_LIST)
ihse@42424 425
ihse@42424 426 ################################################################