annotate test/Makefile @ 47221:3b201865d5c1

8187642: The consolidated repo test makefile disables CONCURRENCY setting to jtreg Reviewed-by: darcy
author erikj
date Mon, 18 Sep 2017 18:15:05 -0700
parents 918745561887
children a182ac1491d7
rev   line source
ohair@4947 1 #
ehelin@34594 2 # Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
ohair@4947 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
ohair@4947 4 #
ohair@4947 5 # This code is free software; you can redistribute it and/or modify it
ohair@4947 6 # under the terms of the GNU General Public License version 2 only, as
ohair@5499 7 # published by the Free Software Foundation. Oracle designates this
ohair@4947 8 # particular file as subject to the "Classpath" exception as provided
ohair@5499 9 # by Oracle in the LICENSE file that accompanied this code.
ohair@4947 10 #
ohair@4947 11 # This code is distributed in the hope that it will be useful, but WITHOUT
ohair@4947 12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ohair@4947 13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
ohair@4947 14 # version 2 for more details (a copy is included in the LICENSE file that
ohair@4947 15 # accompanied this code).
ohair@4947 16 #
ohair@4947 17 # You should have received a copy of the GNU General Public License version
ohair@4947 18 # 2 along with this work; if not, write to the Free Software Foundation,
ohair@4947 19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
ohair@4947 20 #
ohair@5499 21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
ohair@5499 22 # or visit www.oracle.com if you need additional information or have any
ohair@5499 23 # questions.
ohair@4947 24 #
ohair@4947 25
ohair@4947 26 #
ohair@4947 27 # Makefile to run tests from multiple sibling directories
ohair@4947 28 #
ohair@4947 29
ohair@4947 30 # Macro to run a test target in a subdir
ohair@4947 31 define SUBDIR_TEST # subdirectory target
ohair@4947 32 if [ -d $1 ] ; then \
erikj@47218 33 if [ -r $1/Makefile ] ; then \
erikj@47218 34 $(MAKE) --no-print-directory -k -C $1 $2 ; \
ohair@4947 35 else \
erikj@47218 36 echo "ERROR: File does not exist: $1/Makefile"; \
ohair@5115 37 exit 1; \
ohair@4947 38 fi; \
ohair@4947 39 else \
ohair@4947 40 echo "WARNING: No testing done, directory does not exist: $1"; \
ohair@4947 41 fi
ohair@4947 42 endef
ohair@4947 43
mduigou@15577 44 # Default test target (core)
joehw@28006 45 default: jdk_core langtools_jtreg jaxp_all
ohair@11242 46
ohair@11242 47 # All testing
joehw@28006 48 all: jdk_all langtools_all jaxp_all
ohair@4947 49
ehelin@34594 50 ifeq ($(TEST_JOBS), 0)
ihse@43386 51 ifeq ($(shell $(EXPR) $(JOBS) \> 50), 1)
ihse@43386 52 # JTReg cannot handle more than 50 in concurrency
ihse@43386 53 JDK_TEST_JOBS=50
ihse@43386 54 else
ihse@43386 55 JDK_TEST_JOBS=$(JOBS)
ihse@43386 56 endif
ehelin@34594 57 else
ehelin@34594 58 JDK_TEST_JOBS=$(TEST_JOBS)
ehelin@34594 59 endif
ohair@4947 60 # Test targets
mduigou@19520 61 langtools_% :
erikj@47221 62 @$(NO_STOPPING)$(call SUBDIR_TEST, langtools, \
erikj@47221 63 $(if $(JDK_TEST_JOBS), CONCURRENCY=$(JDK_TEST_JOBS)) \
erikj@47218 64 JT_JAVA=$(PRODUCT_HOME) JTREG_HOME=$(JT_HOME) \
erikj@47218 65 TEST="$(subst langtools_,,$@)" $(subst langtools_,,$@))
mduigou@15577 66
alanb@21760 67 jdk_% core_%s svc_%:
erikj@47221 68 @$(NO_STOPPING)$(call SUBDIR_TEST, jdk, \
erikj@47221 69 $(if $(JDK_TEST_JOBS), CONCURRENCY=$(JDK_TEST_JOBS)) TEST="$@" $@)
ohair@4947 70
joehw@28006 71 jaxp_%:
erikj@47221 72 @$(NO_STOPPING)$(call SUBDIR_TEST, jaxp, \
erikj@47221 73 $(if $(JDK_TEST_JOBS), CONCURRENCY=$(JDK_TEST_JOBS)) TEST="$@" $@)
erikj@47218 74
erikj@47218 75 nashorn_%:
erikj@47221 76 @$(NO_STOPPING)$(call SUBDIR_TEST, nashorn, \
erikj@47221 77 $(if $(JDK_TEST_JOBS), CONCURRENCY=$(JDK_TEST_JOBS)) TEST="$@" $@)
joehw@28006 78
ctornqvi@41648 79 SUB_MAKE_ARGS :=
ctornqvi@41648 80 ifneq ($(TEST_JOBS), 0)
ctornqvi@41648 81 ifneq ($(TEST_JOBS), )
ctornqvi@41648 82 SUB_MAKE_ARGS += CONCURRENCY=$(TEST_JOBS)
ctornqvi@41648 83 endif
ehelin@34594 84 endif
mikael@24419 85 hotspot_%:
erikj@47218 86 @$(NO_STOPPING)$(call SUBDIR_TEST, hotspot/jtreg, $(SUB_MAKE_ARGS) TEST="$@" $@)
mikael@24419 87
mikael@25461 88 #
mikael@25461 89 # jtreg_tests
mikael@25461 90 #
mikael@25461 91 # Invocation:
mikael@25461 92 #
sla@37863 93 # make jtreg_tests TESTDIRS=<test-dirs> TEST_SELECTION=<path to test or jtreg group> TEST_OUTPUT_DIR=<path>
mikael@25461 94 #
mikael@25461 95 # where <test-dirs> is something like '../<component>/test/runtime',
mikael@25461 96 # <component> in turn being one of the top level directories (for
mikael@25461 97 # example 'hotspot').
mikael@25461 98 #
mikael@25461 99 # The below will strip the path prefix and delegate to the
mikael@25461 100 # corresponding ../<component>/test/Makefile.
mikael@25461 101
mikael@25461 102 ifneq ($(TESTDIRS),)
erikj@47218 103 # Extract the component from ../test/<component>/...
erikj@47218 104 TESTDIRS_NORM := $(patsubst test/%, %, $(patsubst ../%, %, $(TESTDIRS)))
erikj@47218 105 COMPONENT := $(word 1,$(subst /, ,$(TESTDIRS_NORM)))
mikael@25461 106
erikj@47218 107 # Strip off the ../<component>/test prefix and pass the rest as TESTDIRS
erikj@47218 108 # to the delegate Makefile
erikj@47218 109 # The hotspot tests are in a subdir "java". Accept paths both including
erikj@47218 110 # and excluding this extra subdir
erikj@47218 111 TESTDIRS_TESTS := $(patsubst $(COMPONENT)/%,%,$(patsubst hotspot/jtreg/%,%, \
erikj@47218 112 $(patsubst ../%, %, $(TESTDIRS_NORM))))
mikael@25461 113 endif
mikael@25461 114
mikael@25461 115 jtreg_tests:
erikj@47218 116 $(MAKE) --no-print-directory TESTDIRS=$(TESTDIRS_TESTS) \
erikj@47218 117 $(COMPONENT)_jtreg_tests
mikael@25461 118
ohair@4947 119 ################################################################
ohair@4947 120
ohair@4947 121 # Phony targets (e.g. these are not filenames)
mduigou@19520 122 .PHONY: all clean
ohair@4947 123
ohair@4947 124 ################################################################