2
# Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
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
7
# published by the Free Software Foundation. Oracle designates this
8
# particular file as subject to the "Classpath" exception as provided
9
# by Oracle in the LICENSE file that accompanied this code.
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).
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.
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
29
# This makefile can be called directly to just trigger generation of the cache
30
# makefile. If so, SPEC and MakeBase.gmk need to be included.
31
ifeq ($(FINDTESTS_STAND_ALONE), true)
36
# Make sure this variable is not lazy evaled.
39
# Hook to include the corresponding custom file, if present.
40
$(eval $(call IncludeCustomExtension, common/FindTests.gmk))
42
# TEST_BASEDIRS might have been set by a custom extension
43
TEST_BASEDIRS += $(TOPDIR)/test $(TOPDIR)
45
# JTREG_TESTROOTS might have been set by a custom extension
46
JTREG_TESTROOTS += $(addprefix $(TOPDIR)/test/, hotspot/jtreg jdk langtools jaxp lib-test)
48
# Extract the names of the Jtreg group files from the TEST.ROOT files. The
49
# TEST.ROOT files being properties files can be interpreted as makefiles so
50
# use include to get at the contents instead of expensive shell calls. We are
51
# looking for the "groups" property in each file.
52
JTREG_ROOT_FILES := $(addsuffix /TEST.ROOT, $(JTREG_TESTROOTS))
54
$(foreach root, $(JTREG_TESTROOTS), \
55
$(if $(wildcard $(root)/TEST.ROOT), \
56
$(eval include $(root)/TEST.ROOT) \
57
$(eval $(root)_JTREG_GROUP_FILES := $$(addprefix $(root)/, $$(groups))) \
58
$(eval JTREG_GROUP_FILES += $$($(root)_JTREG_GROUP_FILES)) \
62
# Cache the expensive to calculate test names in a generated makefile.
63
FIND_TESTS_CACHE_FILE := $(MAKESUPPORT_OUTPUTDIR)/find-tests.gmk
65
# If this file is deemed outdated, it will automatically get regenerated
66
# by this rule before being included below.
67
$(FIND_TESTS_CACHE_FILE): $(JTREG_ROOT_FILES) $(JTREG_GROUP_FILES) \
68
$(TOPDIR)/test/make/TestMake.gmk
70
( $(foreach root, $(JTREG_TESTROOTS), \
71
$(PRINTF) "\n$(root)_JTREG_TEST_GROUPS := " ; \
72
$(SED) -n -e 's/^\#.*//g' -e 's/\([^ ]*\)\w*=.*/\1/gp' \
73
$($(root)_JTREG_GROUP_FILES) \
74
| $(SORT) -u | $(TR) '\n' ' ' ; \
77
$(PRINTF) "\nMAKE_TEST_TARGETS := " >> $@
78
$(MAKE) -s --no-print-directory $(MAKE_ARGS) \
79
SPEC=$(SPEC) -f $(TOPDIR)/test/make/TestMake.gmk print-targets \
82
-include $(FIND_TESTS_CACHE_FILE)
84
# Create a list of all available Jtreg test groups in all components
85
JTREG_TEST_GROUPS += $(sort $(foreach root, $(JTREG_TESTROOTS), \
86
$($(root)_JTREG_TEST_GROUPS)))
88
# Add Jtreg test groups to list of named tests (test groups, test list, etc)
89
# ALL_NAMED_TESTS might have been set by a custom extension
90
ALL_NAMED_TESTS += $(JTREG_TEST_GROUPS)
92
# Add the make test targets
93
ALL_NAMED_TESTS += $(addprefix make-, $(MAKE_TEST_TARGETS))
96
ALL_NAMED_TESTS += gtest
99
ALL_NAMED_TESTS += micro
102
ALL_NAMED_TESTS += failure-handler make
104
################################################################################
106
endif # _FIND_TESTS_GMK