author | zgu |
Thu, 07 Nov 2019 09:41:22 -0500 | |
changeset 58964 | 029d941c2e35 |
parent 55465 | 68ef70c9a921 |
permissions | -rw-r--r-- |
44027 | 1 |
# |
53295
520f8e2041bb
8215729: Enhance makefiles to allow collecting code coverage with JCov
shurailine
parents:
52595
diff
changeset
|
2 |
# Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved. |
44027 | 3 |
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
# |
|
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. |
|
10 |
# |
|
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). |
|
16 |
# |
|
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. |
|
20 |
# |
|
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 |
|
23 |
# questions. |
|
24 |
# |
|
25 |
||
26 |
ifndef _FIND_TESTS_GMK |
|
27 |
_FIND_TESTS_GMK := 1 |
|
28 |
||
54382
61616f509ef8
8221762: Improve Main.gmk/FindTests.gmk bootstrap time
erikj
parents:
54334
diff
changeset
|
29 |
# This makefile can be called directly to just trigger generation of the cache |
61616f509ef8
8221762: Improve Main.gmk/FindTests.gmk bootstrap time
erikj
parents:
54334
diff
changeset
|
30 |
# makefile. If so, SPEC and MakeBase.gmk need to be included. |
61616f509ef8
8221762: Improve Main.gmk/FindTests.gmk bootstrap time
erikj
parents:
54334
diff
changeset
|
31 |
ifeq ($(FINDTESTS_STAND_ALONE), true) |
61616f509ef8
8221762: Improve Main.gmk/FindTests.gmk bootstrap time
erikj
parents:
54334
diff
changeset
|
32 |
include $(SPEC) |
61616f509ef8
8221762: Improve Main.gmk/FindTests.gmk bootstrap time
erikj
parents:
54334
diff
changeset
|
33 |
include MakeBase.gmk |
61616f509ef8
8221762: Improve Main.gmk/FindTests.gmk bootstrap time
erikj
parents:
54334
diff
changeset
|
34 |
endif |
61616f509ef8
8221762: Improve Main.gmk/FindTests.gmk bootstrap time
erikj
parents:
54334
diff
changeset
|
35 |
|
61616f509ef8
8221762: Improve Main.gmk/FindTests.gmk bootstrap time
erikj
parents:
54334
diff
changeset
|
36 |
# Make sure this variable is not lazy evaled. |
61616f509ef8
8221762: Improve Main.gmk/FindTests.gmk bootstrap time
erikj
parents:
54334
diff
changeset
|
37 |
ALL_NAMED_TESTS := |
61616f509ef8
8221762: Improve Main.gmk/FindTests.gmk bootstrap time
erikj
parents:
54334
diff
changeset
|
38 |
|
44027 | 39 |
# Hook to include the corresponding custom file, if present. |
47314 | 40 |
$(eval $(call IncludeCustomExtension, common/FindTests.gmk)) |
44027 | 41 |
|
47932
0c22f6b9b5e2
8191820: Fix run-test jtreg test selection and component calculation
ihse
parents:
47314
diff
changeset
|
42 |
# TEST_BASEDIRS might have been set by a custom extension |
0c22f6b9b5e2
8191820: Fix run-test jtreg test selection and component calculation
ihse
parents:
47314
diff
changeset
|
43 |
TEST_BASEDIRS += $(TOPDIR)/test $(TOPDIR) |
0c22f6b9b5e2
8191820: Fix run-test jtreg test selection and component calculation
ihse
parents:
47314
diff
changeset
|
44 |
|
47218 | 45 |
# JTREG_TESTROOTS might have been set by a custom extension |
46 |
JTREG_TESTROOTS += $(addprefix $(TOPDIR)/test/, hotspot/jtreg jdk langtools nashorn jaxp) |
|
44027 | 47 |
|
54382
61616f509ef8
8221762: Improve Main.gmk/FindTests.gmk bootstrap time
erikj
parents:
54334
diff
changeset
|
48 |
# Extract the names of the Jtreg group files from the TEST.ROOT files. The |
61616f509ef8
8221762: Improve Main.gmk/FindTests.gmk bootstrap time
erikj
parents:
54334
diff
changeset
|
49 |
# TEST.ROOT files being properties files can be interpreted as makefiles so |
61616f509ef8
8221762: Improve Main.gmk/FindTests.gmk bootstrap time
erikj
parents:
54334
diff
changeset
|
50 |
# use include to get at the contents instead of expensive shell calls. We are |
61616f509ef8
8221762: Improve Main.gmk/FindTests.gmk bootstrap time
erikj
parents:
54334
diff
changeset
|
51 |
# looking for the "groups" property in each file. |
61616f509ef8
8221762: Improve Main.gmk/FindTests.gmk bootstrap time
erikj
parents:
54334
diff
changeset
|
52 |
JTREG_ROOT_FILES := $(addsuffix /TEST.ROOT, $(JTREG_TESTROOTS)) |
61616f509ef8
8221762: Improve Main.gmk/FindTests.gmk bootstrap time
erikj
parents:
54334
diff
changeset
|
53 |
JTREG_GROUP_FILES := |
61616f509ef8
8221762: Improve Main.gmk/FindTests.gmk bootstrap time
erikj
parents:
54334
diff
changeset
|
54 |
$(foreach root, $(JTREG_TESTROOTS), \ |
61616f509ef8
8221762: Improve Main.gmk/FindTests.gmk bootstrap time
erikj
parents:
54334
diff
changeset
|
55 |
$(eval include $(root)/TEST.ROOT) \ |
61616f509ef8
8221762: Improve Main.gmk/FindTests.gmk bootstrap time
erikj
parents:
54334
diff
changeset
|
56 |
$(eval $(root)_JTREG_GROUP_FILES := $$(addprefix $(root)/, $$(groups))) \ |
61616f509ef8
8221762: Improve Main.gmk/FindTests.gmk bootstrap time
erikj
parents:
54334
diff
changeset
|
57 |
$(eval JTREG_GROUP_FILES += $$($(root)_JTREG_GROUP_FILES)) \ |
61616f509ef8
8221762: Improve Main.gmk/FindTests.gmk bootstrap time
erikj
parents:
54334
diff
changeset
|
58 |
) |
61616f509ef8
8221762: Improve Main.gmk/FindTests.gmk bootstrap time
erikj
parents:
54334
diff
changeset
|
59 |
|
61616f509ef8
8221762: Improve Main.gmk/FindTests.gmk bootstrap time
erikj
parents:
54334
diff
changeset
|
60 |
# Cache the expensive to calculate test names in a generated makefile. |
61616f509ef8
8221762: Improve Main.gmk/FindTests.gmk bootstrap time
erikj
parents:
54334
diff
changeset
|
61 |
FIND_TESTS_CACHE_FILE := $(MAKESUPPORT_OUTPUTDIR)/find-tests.gmk |
61616f509ef8
8221762: Improve Main.gmk/FindTests.gmk bootstrap time
erikj
parents:
54334
diff
changeset
|
62 |
|
61616f509ef8
8221762: Improve Main.gmk/FindTests.gmk bootstrap time
erikj
parents:
54334
diff
changeset
|
63 |
# If this file is deemed outdated, it will automatically get regenerated |
61616f509ef8
8221762: Improve Main.gmk/FindTests.gmk bootstrap time
erikj
parents:
54334
diff
changeset
|
64 |
# by this rule before being included below. |
55465
68ef70c9a921
8226538: find-files.gmk gets corrupted if tab completion is used before running make first
erikj
parents:
54382
diff
changeset
|
65 |
$(FIND_TESTS_CACHE_FILE): $(JTREG_ROOT_FILES) $(JTREG_GROUP_FILES) \ |
68ef70c9a921
8226538: find-files.gmk gets corrupted if tab completion is used before running make first
erikj
parents:
54382
diff
changeset
|
66 |
$(TOPDIR)/test/make/TestMake.gmk |
54382
61616f509ef8
8221762: Improve Main.gmk/FindTests.gmk bootstrap time
erikj
parents:
54334
diff
changeset
|
67 |
$(call MakeTargetDir) |
61616f509ef8
8221762: Improve Main.gmk/FindTests.gmk bootstrap time
erikj
parents:
54334
diff
changeset
|
68 |
( $(foreach root, $(JTREG_TESTROOTS), \ |
61616f509ef8
8221762: Improve Main.gmk/FindTests.gmk bootstrap time
erikj
parents:
54334
diff
changeset
|
69 |
$(PRINTF) "\n$(root)_JTREG_TEST_GROUPS := " ; \ |
61616f509ef8
8221762: Improve Main.gmk/FindTests.gmk bootstrap time
erikj
parents:
54334
diff
changeset
|
70 |
$(SED) -n -e 's/^\#.*//g' -e 's/\([^ ]*\)\w*=.*/\1/gp' \ |
61616f509ef8
8221762: Improve Main.gmk/FindTests.gmk bootstrap time
erikj
parents:
54334
diff
changeset
|
71 |
$($(root)_JTREG_GROUP_FILES) \ |
61616f509ef8
8221762: Improve Main.gmk/FindTests.gmk bootstrap time
erikj
parents:
54334
diff
changeset
|
72 |
| $(SORT) -u | $(TR) '\n' ' ' ; \ |
61616f509ef8
8221762: Improve Main.gmk/FindTests.gmk bootstrap time
erikj
parents:
54334
diff
changeset
|
73 |
) \ |
61616f509ef8
8221762: Improve Main.gmk/FindTests.gmk bootstrap time
erikj
parents:
54334
diff
changeset
|
74 |
) > $@ |
55465
68ef70c9a921
8226538: find-files.gmk gets corrupted if tab completion is used before running make first
erikj
parents:
54382
diff
changeset
|
75 |
$(PRINTF) "\nMAKE_TEST_TARGETS := " >> $@ |
68ef70c9a921
8226538: find-files.gmk gets corrupted if tab completion is used before running make first
erikj
parents:
54382
diff
changeset
|
76 |
$(MAKE) -s --no-print-directory $(MAKE_ARGS) \ |
68ef70c9a921
8226538: find-files.gmk gets corrupted if tab completion is used before running make first
erikj
parents:
54382
diff
changeset
|
77 |
SPEC=$(SPEC) -f $(TOPDIR)/test/make/TestMake.gmk print-targets \ |
68ef70c9a921
8226538: find-files.gmk gets corrupted if tab completion is used before running make first
erikj
parents:
54382
diff
changeset
|
78 |
TARGETS_FILE=$@ |
44027 | 79 |
|
54382
61616f509ef8
8221762: Improve Main.gmk/FindTests.gmk bootstrap time
erikj
parents:
54334
diff
changeset
|
80 |
-include $(FIND_TESTS_CACHE_FILE) |
44027 | 81 |
|
82 |
# Create a list of all available Jtreg test groups in all components |
|
47218 | 83 |
JTREG_TEST_GROUPS += $(sort $(foreach root, $(JTREG_TESTROOTS), \ |
84 |
$($(root)_JTREG_TEST_GROUPS))) |
|
44027 | 85 |
|
86 |
# Add Jtreg test groups to list of named tests (test groups, test list, etc) |
|
87 |
# ALL_NAMED_TESTS might have been set by a custom extension |
|
88 |
ALL_NAMED_TESTS += $(JTREG_TEST_GROUPS) |
|
89 |
||
54382
61616f509ef8
8221762: Improve Main.gmk/FindTests.gmk bootstrap time
erikj
parents:
54334
diff
changeset
|
90 |
# Add the make test targets |
61616f509ef8
8221762: Improve Main.gmk/FindTests.gmk bootstrap time
erikj
parents:
54334
diff
changeset
|
91 |
ALL_NAMED_TESTS += $(addprefix make-, $(MAKE_TEST_TARGETS)) |
61616f509ef8
8221762: Improve Main.gmk/FindTests.gmk bootstrap time
erikj
parents:
54334
diff
changeset
|
92 |
|
44027 | 93 |
# Add Gtest |
94 |
ALL_NAMED_TESTS += gtest |
|
95 |
||
52595
16609197022c
8061281: Microbenchmark suite build support, directory layout and sample benchmarks
redestad
parents:
52396
diff
changeset
|
96 |
# Add microbenchmarks |
16609197022c
8061281: Microbenchmark suite build support, directory layout and sample benchmarks
redestad
parents:
52396
diff
changeset
|
97 |
ALL_NAMED_TESTS += micro |
16609197022c
8061281: Microbenchmark suite build support, directory layout and sample benchmarks
redestad
parents:
52396
diff
changeset
|
98 |
|
52342 | 99 |
# Add special tests |
52396
e292e94b448a
8213058: remove ExecuteInternalVMTests and VerboseInternalVMTests flags
iignatyev
parents:
52342
diff
changeset
|
100 |
ALL_NAMED_TESTS += failure-handler make |
52342 | 101 |
|
44027 | 102 |
################################################################################ |
103 |
||
104 |
endif # _FIND_TESTS_GMK |