annotate test/Makefile @ 1261:75ad722b5f04

8065673: XML Test Colo: Add test build system for JAXP tests Reviewed-by: alanb, joehw Contributed-by: tristan.yan@oracle.com
author joehw
date Mon, 15 Dec 2014 13:09:39 -0800
parents de68e6f9139a
children 909bcc7a8852
rev   line source
ohair@157 1 #
ohair@328 2 # Copyright (c) 2010, 2011, 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 \
mduigou@615 43 echo "$(MAKE) -k -C $1/test $2" ; \
mduigou@615 44 $(MAKE) -k -C $1/test $2 ; \
ohair@157 45 else \
ohair@157 46 echo "ERROR: File does not exist: $1/test/Makefile"; \
ohair@166 47 exit 1; \
ohair@157 48 fi; \
ohair@157 49 else \
ohair@157 50 echo "WARNING: No testing done, directory does not exist: $1"; \
ohair@157 51 fi
ohair@157 52 endef
ohair@157 53
mduigou@615 54 # Default test target (core)
joehw@1261 55 default: jdk_core langtools_jtreg jaxp_all
ohair@387 56
ohair@387 57 # All testing
joehw@1261 58 all: jdk_all langtools_all jaxp_all
ohair@157 59
ohair@157 60 # Test targets
mduigou@776 61 langtools_% :
mduigou@778 62 @$(NO_STOPPING)$(call SUBDIR_TEST, $(LANGTOOLS_DIR), JT_JAVA=$(PRODUCT_HOME) JTREG_HOME=$(JT_HOME) TEST="$(subst langtools_,,$@)" $(subst langtools_,,$@))
mduigou@615 63
alanb@911 64 jdk_% core_%s svc_%:
mduigou@776 65 @$(NO_STOPPING)$(call SUBDIR_TEST, $(JDK_DIR), TEST="$@" $@)
ohair@157 66
joehw@1261 67 jaxp_%:
joehw@1261 68 @$(NO_STOPPING)$(call SUBDIR_TEST, $(JAXP_DIR), TEST="$@" $@)
joehw@1261 69
mikael@1057 70 hotspot_%:
mikael@1057 71 @$(NO_STOPPING)$(call SUBDIR_TEST, $(HOTSPOT_DIR), TEST="$@" $@)
mikael@1057 72
mikael@1103 73 #
mikael@1103 74 # jtreg_tests
mikael@1103 75 #
mikael@1103 76 # Invocation:
mikael@1103 77 #
mikael@1103 78 # make jtreg_tests TESTDIRS=<test-dirs>
mikael@1103 79 #
mikael@1103 80 # where <test-dirs> is something like '../<component>/test/runtime',
mikael@1103 81 # <component> in turn being one of the top level directories (for
mikael@1103 82 # example 'hotspot').
mikael@1103 83 #
mikael@1103 84 # The below will strip the path prefix and delegate to the
mikael@1103 85 # corresponding ../<component>/test/Makefile.
mikael@1103 86
mikael@1103 87 ifneq ($(TESTDIRS),)
mikael@1103 88 # Extract the component from ../<component>/...
mikael@1103 89 COMPONENT=$(word 2,$(subst /, ,$(TESTDIRS)))
mikael@1103 90
mikael@1103 91 # Strip off the ../<component>/test prefix and pass the rest as TESTDIRS
mikael@1103 92 # to the delegate Makefile
mikael@1103 93 TESTDIRS_TESTS=$(patsubst ../$(COMPONENT)/test/%,%,$(TESTDIRS))
mikael@1103 94 endif
mikael@1103 95
mikael@1103 96 jtreg_tests:
mikael@1103 97 @$(NO_STOPPING)$(call SUBDIR_TEST, $(TOPDIR)/$(COMPONENT), TESTDIRS=$(TESTDIRS_TESTS) $@)
mikael@1103 98
ohair@157 99 ################################################################
ohair@157 100
ohair@157 101 # Phony targets (e.g. these are not filenames)
mduigou@776 102 .PHONY: all clean
ohair@157 103
ohair@157 104 ################################################################