annotate test/Makefile @ 1945:cf3701bb0291

8149116: Make test/Makefile more silent Reviewed-by: mikael, erikj
author ehelin
date Mon, 08 Feb 2016 08:05:12 +0100
parents e79b5043fd02
children
rev   line source
ohair@157 1 #
ehelin@1845 2 # Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
ohair@157 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
ohair@157 4 #
ohair@157 5 # This code is free software; you can redistribute it and/or modify it
ohair@157 6 # under the terms of the GNU General Public License version 2 only, as
ohair@180 7 # published by the Free Software Foundation. Oracle designates this
ohair@157 8 # particular file as subject to the "Classpath" exception as provided
ohair@180 9 # by Oracle in the LICENSE file that accompanied this code.
ohair@157 10 #
ohair@157 11 # This code is distributed in the hope that it will be useful, but WITHOUT
ohair@157 12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ohair@157 13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
ohair@157 14 # version 2 for more details (a copy is included in the LICENSE file that
ohair@157 15 # accompanied this code).
ohair@157 16 #
ohair@157 17 # You should have received a copy of the GNU General Public License version
ohair@157 18 # 2 along with this work; if not, write to the Free Software Foundation,
ohair@157 19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
ohair@157 20 #
ohair@180 21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
ohair@180 22 # or visit www.oracle.com if you need additional information or have any
ohair@180 23 # questions.
ohair@157 24 #
ohair@157 25
ohair@157 26 #
ohair@157 27 # Makefile to run tests from multiple sibling directories
ohair@157 28 #
ohair@157 29
ohair@157 30 # Root of the forest that was built
ohair@157 31 TOPDIR=..
ohair@157 32
ohair@157 33 # This makefile depends on the availability of sibling directories.
ohair@157 34 LANGTOOLS_DIR=$(TOPDIR)/langtools
ohair@157 35 JDK_DIR=$(TOPDIR)/jdk
joehw@1261 36 JAXP_DIR=$(TOPDIR)/jaxp
mikael@1057 37 HOTSPOT_DIR=$(TOPDIR)/hotspot
ohair@157 38
ohair@157 39 # Macro to run a test target in a subdir
ohair@157 40 define SUBDIR_TEST # subdirectory target
ohair@157 41 if [ -d $1 ] ; then \
ohair@157 42 if [ -r $1/test/Makefile ] ; then \
ehelin@1945 43 $(MAKE) --no-print-directory -k -C $1/test $2 ; \
ohair@157 44 else \
ohair@157 45 echo "ERROR: File does not exist: $1/test/Makefile"; \
ohair@166 46 exit 1; \
ohair@157 47 fi; \
ohair@157 48 else \
ohair@157 49 echo "WARNING: No testing done, directory does not exist: $1"; \
ohair@157 50 fi
ohair@157 51 endef
ohair@157 52
mduigou@615 53 # Default test target (core)
joehw@1261 54 default: jdk_core langtools_jtreg jaxp_all
ohair@387 55
ohair@387 56 # All testing
joehw@1261 57 all: jdk_all langtools_all jaxp_all
ohair@157 58
ddehaven@1654 59 # Bring in closed test targets if present
ddehaven@1654 60 -include $(TOPDIR)/closed/test/Makefile
ddehaven@1654 61
ehelin@1845 62 ifeq ($(TEST_JOBS), 0)
ehelin@1845 63 JDK_TEST_JOBS=$(JOBS)
ehelin@1845 64 else
ehelin@1845 65 JDK_TEST_JOBS=$(TEST_JOBS)
ehelin@1845 66 endif
ohair@157 67 # Test targets
mduigou@776 68 langtools_% :
ehelin@1845 69 @$(NO_STOPPING)$(call SUBDIR_TEST, $(LANGTOOLS_DIR), CONCURRENCY=$(JDK_TEST_JOBS) JT_JAVA=$(PRODUCT_HOME) JTREG_HOME=$(JT_HOME) TEST="$(subst langtools_,,$@)" $(subst langtools_,,$@))
mduigou@615 70
alanb@911 71 jdk_% core_%s svc_%:
ehelin@1845 72 @$(NO_STOPPING)$(call SUBDIR_TEST, $(JDK_DIR), CONCURRENCY=$(JDK_TEST_JOBS) TEST="$@" $@)
ohair@157 73
joehw@1261 74 jaxp_%:
ehelin@1845 75 @$(NO_STOPPING)$(call SUBDIR_TEST, $(JAXP_DIR), CONCURRENCY=$(JDK_TEST_JOBS) TEST="$@" $@)
joehw@1261 76
ehelin@1845 77 ifeq ($(TEST_JOBS), 0)
ehelin@1845 78 HOTSPOT_TEST_JOBS=1
ehelin@1845 79 else
ehelin@1845 80 HOTSPOT_TEST_JOBS=$(TEST_JOBS)
ehelin@1845 81 endif
mikael@1057 82 hotspot_%:
ehelin@1845 83 @$(NO_STOPPING)$(call SUBDIR_TEST, $(HOTSPOT_DIR), CONCURRENCY=$(HOTSPOT_TEST_JOBS) TEST="$@" $@)
mikael@1057 84
mikael@1103 85 #
mikael@1103 86 # jtreg_tests
mikael@1103 87 #
mikael@1103 88 # Invocation:
mikael@1103 89 #
mikael@1103 90 # make jtreg_tests TESTDIRS=<test-dirs>
mikael@1103 91 #
mikael@1103 92 # where <test-dirs> is something like '../<component>/test/runtime',
mikael@1103 93 # <component> in turn being one of the top level directories (for
mikael@1103 94 # example 'hotspot').
mikael@1103 95 #
mikael@1103 96 # The below will strip the path prefix and delegate to the
mikael@1103 97 # corresponding ../<component>/test/Makefile.
mikael@1103 98
mikael@1103 99 ifneq ($(TESTDIRS),)
mikael@1103 100 # Extract the component from ../<component>/...
mikael@1103 101 COMPONENT=$(word 2,$(subst /, ,$(TESTDIRS)))
mikael@1103 102
mikael@1103 103 # Strip off the ../<component>/test prefix and pass the rest as TESTDIRS
mikael@1103 104 # to the delegate Makefile
mikael@1103 105 TESTDIRS_TESTS=$(patsubst ../$(COMPONENT)/test/%,%,$(TESTDIRS))
mikael@1103 106 endif
mikael@1103 107
mikael@1103 108 jtreg_tests:
mikael@1103 109 @$(NO_STOPPING)$(call SUBDIR_TEST, $(TOPDIR)/$(COMPONENT), TESTDIRS=$(TESTDIRS_TESTS) $@)
mikael@1103 110
ohair@157 111 ################################################################
ohair@157 112
ohair@157 113 # Phony targets (e.g. these are not filenames)
mduigou@776 114 .PHONY: all clean
ohair@157 115
ohair@157 116 ################################################################