author | rkennke |
Wed, 07 Nov 2018 20:24:44 +0100 | |
changeset 52442 | dc1f9dec2018 |
parent 52396 | e292e94b448a |
child 52556 | 6b05634db714 |
permissions | -rw-r--r-- |
44027 | 1 |
# |
52342 | 2 |
# Copyright (c) 2016, 2018, 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 |
default: all |
|
27 |
||
28 |
include $(SPEC) |
|
29 |
include MakeBase.gmk |
|
30 |
include FindTests.gmk |
|
31 |
||
32 |
# We will always run multiple tests serially |
|
33 |
.NOTPARALLEL: |
|
34 |
||
47956
72a474c85aee
8177956: Add TEST_VM_OPTS as convenience for run-test arguments
ihse
parents:
47943
diff
changeset
|
35 |
################################################################################ |
72a474c85aee
8177956: Add TEST_VM_OPTS as convenience for run-test arguments
ihse
parents:
47943
diff
changeset
|
36 |
# Parse global control variables |
72a474c85aee
8177956: Add TEST_VM_OPTS as convenience for run-test arguments
ihse
parents:
47943
diff
changeset
|
37 |
################################################################################ |
72a474c85aee
8177956: Add TEST_VM_OPTS as convenience for run-test arguments
ihse
parents:
47943
diff
changeset
|
38 |
|
72a474c85aee
8177956: Add TEST_VM_OPTS as convenience for run-test arguments
ihse
parents:
47943
diff
changeset
|
39 |
ifneq ($(TEST_VM_OPTS), ) |
72a474c85aee
8177956: Add TEST_VM_OPTS as convenience for run-test arguments
ihse
parents:
47943
diff
changeset
|
40 |
ifneq ($(TEST_OPTS), ) |
72a474c85aee
8177956: Add TEST_VM_OPTS as convenience for run-test arguments
ihse
parents:
47943
diff
changeset
|
41 |
TEST_OPTS := $(TEST_OPTS);VM_OPTIONS=$(TEST_VM_OPTS) |
72a474c85aee
8177956: Add TEST_VM_OPTS as convenience for run-test arguments
ihse
parents:
47943
diff
changeset
|
42 |
else |
72a474c85aee
8177956: Add TEST_VM_OPTS as convenience for run-test arguments
ihse
parents:
47943
diff
changeset
|
43 |
TEST_OPTS := VM_OPTIONS=$(TEST_VM_OPTS) |
72a474c85aee
8177956: Add TEST_VM_OPTS as convenience for run-test arguments
ihse
parents:
47943
diff
changeset
|
44 |
endif |
72a474c85aee
8177956: Add TEST_VM_OPTS as convenience for run-test arguments
ihse
parents:
47943
diff
changeset
|
45 |
endif |
72a474c85aee
8177956: Add TEST_VM_OPTS as convenience for run-test arguments
ihse
parents:
47943
diff
changeset
|
46 |
|
72a474c85aee
8177956: Add TEST_VM_OPTS as convenience for run-test arguments
ihse
parents:
47943
diff
changeset
|
47 |
$(eval $(call ParseKeywordVariable, TEST_OPTS, \ |
52393
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
48 |
SINGLE_KEYWORDS := JOBS TIMEOUT_FACTOR AOT_MODULES, \ |
52125
28375a1de254
8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents:
51856
diff
changeset
|
49 |
STRING_KEYWORDS := VM_OPTIONS JAVA_OPTIONS, \ |
47956
72a474c85aee
8177956: Add TEST_VM_OPTS as convenience for run-test arguments
ihse
parents:
47943
diff
changeset
|
50 |
)) |
72a474c85aee
8177956: Add TEST_VM_OPTS as convenience for run-test arguments
ihse
parents:
47943
diff
changeset
|
51 |
|
72a474c85aee
8177956: Add TEST_VM_OPTS as convenience for run-test arguments
ihse
parents:
47943
diff
changeset
|
52 |
# Helper function to propagate TEST_OPTS values. |
72a474c85aee
8177956: Add TEST_VM_OPTS as convenience for run-test arguments
ihse
parents:
47943
diff
changeset
|
53 |
# |
72a474c85aee
8177956: Add TEST_VM_OPTS as convenience for run-test arguments
ihse
parents:
47943
diff
changeset
|
54 |
# Note: No spaces are allowed around the arguments. |
72a474c85aee
8177956: Add TEST_VM_OPTS as convenience for run-test arguments
ihse
parents:
47943
diff
changeset
|
55 |
# Arg $1 The variable in TEST_OPTS to propagate |
72a474c85aee
8177956: Add TEST_VM_OPTS as convenience for run-test arguments
ihse
parents:
47943
diff
changeset
|
56 |
# Arg $2 The control variable to propagate it to |
72a474c85aee
8177956: Add TEST_VM_OPTS as convenience for run-test arguments
ihse
parents:
47943
diff
changeset
|
57 |
define SetTestOpt |
72a474c85aee
8177956: Add TEST_VM_OPTS as convenience for run-test arguments
ihse
parents:
47943
diff
changeset
|
58 |
ifneq ($$(TEST_OPTS_$1), ) |
72a474c85aee
8177956: Add TEST_VM_OPTS as convenience for run-test arguments
ihse
parents:
47943
diff
changeset
|
59 |
$2_$1 := $$(TEST_OPTS_$1) |
72a474c85aee
8177956: Add TEST_VM_OPTS as convenience for run-test arguments
ihse
parents:
47943
diff
changeset
|
60 |
endif |
72a474c85aee
8177956: Add TEST_VM_OPTS as convenience for run-test arguments
ihse
parents:
47943
diff
changeset
|
61 |
endef |
72a474c85aee
8177956: Add TEST_VM_OPTS as convenience for run-test arguments
ihse
parents:
47943
diff
changeset
|
62 |
|
49147
af37d9997bd6
8199197: Set _NT_SYMBOL_PATH when running tests on windows
erikj
parents:
48061
diff
changeset
|
63 |
# Setup _NT_SYMBOL_PATH on Windows |
af37d9997bd6
8199197: Set _NT_SYMBOL_PATH when running tests on windows
erikj
parents:
48061
diff
changeset
|
64 |
ifeq ($(OPENJDK_TARGET_OS), windows) |
af37d9997bd6
8199197: Set _NT_SYMBOL_PATH when running tests on windows
erikj
parents:
48061
diff
changeset
|
65 |
ifndef _NT_SYMBOL_PATH |
af37d9997bd6
8199197: Set _NT_SYMBOL_PATH when running tests on windows
erikj
parents:
48061
diff
changeset
|
66 |
# Can't use PathList here as it adds quotes around the value. |
af37d9997bd6
8199197: Set _NT_SYMBOL_PATH when running tests on windows
erikj
parents:
48061
diff
changeset
|
67 |
_NT_SYMBOL_PATH := \ |
52295
57d299cdd068
8213005: Missing symbols in hs_err files on Windows after JDK-8212028
erikj
parents:
52125
diff
changeset
|
68 |
$(subst $(SPACE),;,$(strip \ |
57d299cdd068
8213005: Missing symbols in hs_err files on Windows after JDK-8212028
erikj
parents:
52125
diff
changeset
|
69 |
$(foreach p, $(sort $(dir $(wildcard \ |
57d299cdd068
8213005: Missing symbols in hs_err files on Windows after JDK-8212028
erikj
parents:
52125
diff
changeset
|
70 |
$(addprefix $(SYMBOLS_IMAGE_DIR)/bin/, *.pdb */*.pdb)))), \ |
57d299cdd068
8213005: Missing symbols in hs_err files on Windows after JDK-8212028
erikj
parents:
52125
diff
changeset
|
71 |
$(call FixPath, $p) \ |
57d299cdd068
8213005: Missing symbols in hs_err files on Windows after JDK-8212028
erikj
parents:
52125
diff
changeset
|
72 |
) \ |
57d299cdd068
8213005: Missing symbols in hs_err files on Windows after JDK-8212028
erikj
parents:
52125
diff
changeset
|
73 |
)) |
49147
af37d9997bd6
8199197: Set _NT_SYMBOL_PATH when running tests on windows
erikj
parents:
48061
diff
changeset
|
74 |
export _NT_SYMBOL_PATH |
52295
57d299cdd068
8213005: Missing symbols in hs_err files on Windows after JDK-8212028
erikj
parents:
52125
diff
changeset
|
75 |
$(info _NT_SYMBOL_PATH=$(_NT_SYMBOL_PATH)) |
49147
af37d9997bd6
8199197: Set _NT_SYMBOL_PATH when running tests on windows
erikj
parents:
48061
diff
changeset
|
76 |
endif |
af37d9997bd6
8199197: Set _NT_SYMBOL_PATH when running tests on windows
erikj
parents:
48061
diff
changeset
|
77 |
endif |
af37d9997bd6
8199197: Set _NT_SYMBOL_PATH when running tests on windows
erikj
parents:
48061
diff
changeset
|
78 |
|
47956
72a474c85aee
8177956: Add TEST_VM_OPTS as convenience for run-test arguments
ihse
parents:
47943
diff
changeset
|
79 |
################################################################################ |
44027 | 80 |
# Hook to include the corresponding custom file, if present. |
47314 | 81 |
$(eval $(call IncludeCustomExtension, RunTests.gmk)) |
47956
72a474c85aee
8177956: Add TEST_VM_OPTS as convenience for run-test arguments
ihse
parents:
47943
diff
changeset
|
82 |
################################################################################ |
44027 | 83 |
|
47253
92fd0e04e0e1
8187544: Replace BUILD_OUTPUT and OUTPUT_ROOT with OUTPUTDIR
ihse
parents:
47218
diff
changeset
|
84 |
TEST_RESULTS_DIR := $(OUTPUTDIR)/test-results |
92fd0e04e0e1
8187544: Replace BUILD_OUTPUT and OUTPUT_ROOT with OUTPUTDIR
ihse
parents:
47218
diff
changeset
|
85 |
TEST_SUPPORT_DIR := $(OUTPUTDIR)/test-support |
47943 | 86 |
TEST_SUMMARY := $(TEST_RESULTS_DIR)/test-summary.txt |
48042 | 87 |
TEST_LAST_IDS := $(TEST_SUPPORT_DIR)/test-last-ids.txt |
44027 | 88 |
|
47937
c1437939b0d8
8177957: run-test summary lines look bad/misleading with long test names
ihse
parents:
47932
diff
changeset
|
89 |
ifeq ($(CUSTOM_ROOT), ) |
c1437939b0d8
8177957: run-test summary lines look bad/misleading with long test names
ihse
parents:
47932
diff
changeset
|
90 |
JTREG_TOPDIR := $(TOPDIR) |
c1437939b0d8
8177957: run-test summary lines look bad/misleading with long test names
ihse
parents:
47932
diff
changeset
|
91 |
else |
c1437939b0d8
8177957: run-test summary lines look bad/misleading with long test names
ihse
parents:
47932
diff
changeset
|
92 |
JTREG_TOPDIR := $(CUSTOM_ROOT) |
c1437939b0d8
8177957: run-test summary lines look bad/misleading with long test names
ihse
parents:
47932
diff
changeset
|
93 |
endif |
44027 | 94 |
|
47986 | 95 |
JTREG_FAILURE_HANDLER_DIR := $(TEST_IMAGE_DIR)/failure_handler |
96 |
JTREG_FAILURE_HANDLER := $(JTREG_FAILURE_HANDLER_DIR)/jtregFailureHandler.jar |
|
97 |
||
98 |
ifneq ($(wildcard $(JTREG_FAILURE_HANDLER)), ) |
|
99 |
JTREG_FAILURE_HANDLER_OPTIONS := \ |
|
100 |
-timeoutHandlerDir:$(JTREG_FAILURE_HANDLER) \ |
|
101 |
-observerDir:$(JTREG_FAILURE_HANDLER) \ |
|
102 |
-timeoutHandler:jdk.test.failurehandler.jtreg.GatherProcessInfoTimeoutHandler \ |
|
103 |
-observer:jdk.test.failurehandler.jtreg.GatherDiagnosticInfoObserver \ |
|
104 |
-timeoutHandlerTimeout:0 |
|
105 |
endif |
|
106 |
||
48058
c5eefa465e37
8192995: run-test gtest should use all jvm variants, not just "server"
ihse
parents:
48042
diff
changeset
|
107 |
GTEST_LAUNCHER_DIRS := $(patsubst %/gtestLauncher, %, $(wildcard $(TEST_IMAGE_DIR)/hotspot/gtest/*/gtestLauncher)) |
c5eefa465e37
8192995: run-test gtest should use all jvm variants, not just "server"
ihse
parents:
48042
diff
changeset
|
108 |
GTEST_VARIANTS := $(strip $(patsubst $(TEST_IMAGE_DIR)/hotspot/gtest/%, %, $(GTEST_LAUNCHER_DIRS))) |
c5eefa465e37
8192995: run-test gtest should use all jvm variants, not just "server"
ihse
parents:
48042
diff
changeset
|
109 |
|
44027 | 110 |
################################################################################ |
52393
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
111 |
# Optionally create AOT libraries for specified modules before running tests. |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
112 |
# Note, this could not be done during JDK build time. |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
113 |
################################################################################ |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
114 |
|
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
115 |
# Note, this could not be done during JDK build time. |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
116 |
|
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
117 |
# Parameter 1 is the name of the rule. |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
118 |
# |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
119 |
# Remaining parameters are named arguments. |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
120 |
# MODULE The module to generate a library for |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
121 |
# BIN Output directory in which to put the library |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
122 |
# VM_OPTIONS List of JVM arguments to use when creating library |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
123 |
# OPTIONS_VAR Name of variable to put AOT java options in |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
124 |
# PREREQS_VAR Name of variable to put all AOT prerequisite rule targets in |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
125 |
# for test rules to depend on |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
126 |
# |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
127 |
SetupAotModule = $(NamedParamsMacroTemplate) |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
128 |
define SetupAotModuleBody |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
129 |
$1_AOT_LIB := $$($1_BIN)/$$(call SHARED_LIBRARY,$$($1_MODULE)) |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
130 |
$1_AOT_CCLIST := $$(wildcard $$(TOPDIR)/test/hotspot/jtreg/compiler/aot/scripts/$$($1_MODULE)-list.txt) |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
131 |
|
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
132 |
ifeq ($(OPENJDK_TARGET_OS), windows) |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
133 |
$1_LD := $$(addsuffix $$(EXE_SUFFIX), $$(filter-out $$(FIXPATH), $$(LD))) |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
134 |
else |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
135 |
$1_LD := $$(LD) |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
136 |
endif |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
137 |
|
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
138 |
$1_JAOTC_OPTS := \ |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
139 |
-J-Xmx4g --info \ |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
140 |
$$(addprefix -J, $$($1_VM_OPTIONS)) \ |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
141 |
$$(addprefix --compile-commands$(SPACE), $$($1_AOT_CCLIST)) \ |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
142 |
--linker-path $$($1_LD) \ |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
143 |
# |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
144 |
|
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
145 |
ifneq ($$(filter -ea, $$($1_VM_OPTIONS)), ) |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
146 |
$1_JAOTC_OPTS += --compile-with-assertions |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
147 |
endif |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
148 |
|
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
149 |
$$($1_AOT_LIB): $$(JDK_IMAGE_DIR)/release \ |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
150 |
$$(call DependOnVariable, $1_JAOTC_OPTS) \ |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
151 |
$$(call DependOnVariable, JDK_IMAGE_DIR) |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
152 |
$$(call LogWarn, Generating $$(patsubst $$(OUTPUTDIR)/%, %, $$@)) |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
153 |
$$(call MakeTargetDir) |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
154 |
$$(call ExecuteWithLog, $$@, \ |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
155 |
$$(FIXPATH) $$(JDK_IMAGE_DIR)/bin/jaotc \ |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
156 |
$$($1_JAOTC_OPTS) --output $$@ --module $$($1_MODULE) \ |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
157 |
) |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
158 |
$$(call ExecuteWithLog, $$@.check, \ |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
159 |
$$(FIXPATH) $$(JDK_IMAGE_DIR)/bin/java \ |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
160 |
$$($1_VM_OPTIONS) -XX:+PrintAOT -XX:+UseAOTStrictLoading -XX:AOTLibrary=$$@ -version \ |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
161 |
> $$@.verify-aot \ |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
162 |
) |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
163 |
|
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
164 |
$1_AOT_OPTIONS += -XX:AOTLibrary=$$($1_AOT_LIB) |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
165 |
$1_AOT_TARGETS += $$($1_AOT_LIB) |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
166 |
endef |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
167 |
|
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
168 |
# Parameter 1 is the name of the rule. |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
169 |
# |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
170 |
# Remaining parameters are named arguments. |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
171 |
# MODULES The modules to generate a library for |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
172 |
# VM_OPTIONS List of JVM arguments to use when creating libraries |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
173 |
# |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
174 |
# After calling this, the following variables are defined |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
175 |
# $1_AOT_OPTIONS List of all java options needed to use the AOT libraries |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
176 |
# $1_AOT_TARGETS List of all targets that the test rule will need to depend on |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
177 |
# |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
178 |
SetupAot = $(NamedParamsMacroTemplate) |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
179 |
define SetupAotBody |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
180 |
$$(info Running with AOTd libraries for $$($1_MODULES)) |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
181 |
# Put aot libraries in a separate directory so they are not deleted between |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
182 |
# test runs and may be reused between make invocations. |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
183 |
$$(foreach m, $$($1_MODULES), \ |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
184 |
$$(eval $$(call SetupAotModule, $1_$$m, \ |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
185 |
MODULE := $$m, \ |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
186 |
BIN := $$(TEST_SUPPORT_DIR)/aot/$1, \ |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
187 |
VM_OPTIONS := $$($1_VM_OPTIONS), \ |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
188 |
)) \ |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
189 |
$$(eval $1_AOT_OPTIONS += $$($1_$$m_AOT_OPTIONS)) \ |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
190 |
$$(eval $1_AOT_TARGETS += $$($1_$$m_AOT_TARGETS)) \ |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
191 |
) |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
192 |
endef |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
193 |
|
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
194 |
################################################################################ |
52125
28375a1de254
8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents:
51856
diff
changeset
|
195 |
# Setup global test running parameters |
28375a1de254
8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents:
51856
diff
changeset
|
196 |
################################################################################ |
28375a1de254
8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents:
51856
diff
changeset
|
197 |
|
28375a1de254
8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents:
51856
diff
changeset
|
198 |
# Each factor variable comes in 3 variants. The first one is reserved for users |
28375a1de254
8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents:
51856
diff
changeset
|
199 |
# to use on command line. The other two are for predifined configurations in JDL |
28375a1de254
8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents:
51856
diff
changeset
|
200 |
# and for machine specific configurations respectively. |
28375a1de254
8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents:
51856
diff
changeset
|
201 |
TEST_JOBS_FACTOR ?= 1 |
28375a1de254
8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents:
51856
diff
changeset
|
202 |
TEST_JOBS_FACTOR_JDL ?= 1 |
28375a1de254
8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents:
51856
diff
changeset
|
203 |
TEST_JOBS_FACTOR_MACHINE ?= 1 |
28375a1de254
8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents:
51856
diff
changeset
|
204 |
|
28375a1de254
8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents:
51856
diff
changeset
|
205 |
ifeq ($(TEST_JOBS), 0) |
28375a1de254
8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents:
51856
diff
changeset
|
206 |
# Concurrency based on min(cores / 2, 12) * TEST_JOBS_FACTOR |
28375a1de254
8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents:
51856
diff
changeset
|
207 |
TEST_JOBS := $(shell $(AWK) \ |
28375a1de254
8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents:
51856
diff
changeset
|
208 |
'BEGIN { \ |
28375a1de254
8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents:
51856
diff
changeset
|
209 |
c = $(NUM_CORES) / 2; \ |
28375a1de254
8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents:
51856
diff
changeset
|
210 |
if (c > 12) c = 12; \ |
28375a1de254
8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents:
51856
diff
changeset
|
211 |
c = c * $(TEST_JOBS_FACTOR); \ |
28375a1de254
8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents:
51856
diff
changeset
|
212 |
c = c * $(TEST_JOBS_FACTOR_JDL); \ |
28375a1de254
8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents:
51856
diff
changeset
|
213 |
c = c * $(TEST_JOBS_FACTOR_MACHINE); \ |
28375a1de254
8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents:
51856
diff
changeset
|
214 |
if (c < 1) c = 1; \ |
28375a1de254
8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents:
51856
diff
changeset
|
215 |
printf "%.0f", c; \ |
28375a1de254
8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents:
51856
diff
changeset
|
216 |
}') |
28375a1de254
8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents:
51856
diff
changeset
|
217 |
endif |
28375a1de254
8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents:
51856
diff
changeset
|
218 |
|
28375a1de254
8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents:
51856
diff
changeset
|
219 |
################################################################################ |
44027 | 220 |
# Parse control variables |
221 |
################################################################################ |
|
222 |
||
47956
72a474c85aee
8177956: Add TEST_VM_OPTS as convenience for run-test arguments
ihse
parents:
47943
diff
changeset
|
223 |
ifneq ($(TEST_OPTS), ) |
72a474c85aee
8177956: Add TEST_VM_OPTS as convenience for run-test arguments
ihse
parents:
47943
diff
changeset
|
224 |
# Inform the user |
72a474c85aee
8177956: Add TEST_VM_OPTS as convenience for run-test arguments
ihse
parents:
47943
diff
changeset
|
225 |
$(info Running tests using TEST_OPTS control variable '$(TEST_OPTS)') |
72a474c85aee
8177956: Add TEST_VM_OPTS as convenience for run-test arguments
ihse
parents:
47943
diff
changeset
|
226 |
endif |
72a474c85aee
8177956: Add TEST_VM_OPTS as convenience for run-test arguments
ihse
parents:
47943
diff
changeset
|
227 |
|
52125
28375a1de254
8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents:
51856
diff
changeset
|
228 |
$(eval $(call SetTestOpt,VM_OPTIONS,JTREG)) |
28375a1de254
8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents:
51856
diff
changeset
|
229 |
$(eval $(call SetTestOpt,JAVA_OPTIONS,JTREG)) |
28375a1de254
8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents:
51856
diff
changeset
|
230 |
$(eval $(call SetTestOpt,VM_OPTIONS,GTEST)) |
28375a1de254
8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents:
51856
diff
changeset
|
231 |
$(eval $(call SetTestOpt,JAVA_OPTIONS,GTEST)) |
28375a1de254
8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents:
51856
diff
changeset
|
232 |
|
52393
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
233 |
$(eval $(call SetTestOpt,AOT_MODULES,JTREG)) |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
234 |
$(eval $(call SetTestOpt,AOT_MODULES,GTEST)) |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
235 |
|
52125
28375a1de254
8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents:
51856
diff
changeset
|
236 |
$(eval $(call SetTestOpt,JOBS,JTREG)) |
28375a1de254
8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents:
51856
diff
changeset
|
237 |
$(eval $(call SetTestOpt,TIMEOUT_FACTOR,JTREG)) |
28375a1de254
8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents:
51856
diff
changeset
|
238 |
|
44027 | 239 |
$(eval $(call ParseKeywordVariable, JTREG, \ |
52125
28375a1de254
8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents:
51856
diff
changeset
|
240 |
SINGLE_KEYWORDS := JOBS TIMEOUT_FACTOR TEST_MODE ASSERT VERBOSE RETAIN MAX_MEM \ |
52393
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
241 |
EXTRA_PROBLEM_LISTS KEYWORDS AOT_MODULES, \ |
44027 | 242 |
STRING_KEYWORDS := OPTIONS JAVA_OPTIONS VM_OPTIONS, \ |
243 |
)) |
|
244 |
||
245 |
ifneq ($(JTREG), ) |
|
246 |
# Inform the user |
|
247 |
$(info Running tests using JTREG control variable '$(JTREG)') |
|
248 |
endif |
|
249 |
||
250 |
$(eval $(call ParseKeywordVariable, GTEST, \ |
|
52393
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
251 |
SINGLE_KEYWORDS := REPEAT AOT_MODULES, \ |
52125
28375a1de254
8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents:
51856
diff
changeset
|
252 |
STRING_KEYWORDS := OPTIONS VM_OPTIONS JAVA_OPTIONS, \ |
44027 | 253 |
)) |
254 |
||
255 |
ifneq ($(GTEST), ) |
|
256 |
# Inform the user |
|
257 |
$(info Running tests using GTEST control variable '$(GTEST)') |
|
258 |
endif |
|
259 |
||
260 |
||
261 |
################################################################################ |
|
262 |
# Component-specific Jtreg settings |
|
263 |
################################################################################ |
|
264 |
||
265 |
hotspot_JTREG_MAX_MEM := 0 |
|
266 |
hotspot_JTREG_ASSERT := false |
|
267 |
hotspot_JTREG_NATIVEPATH := $(TEST_IMAGE_DIR)/hotspot/jtreg/native |
|
268 |
jdk_JTREG_NATIVEPATH := $(TEST_IMAGE_DIR)/jdk/jtreg/native |
|
269 |
||
47941
d91b0d2d45cb
8179554: make run-test does not respect ProblemList.txt
ihse
parents:
47939
diff
changeset
|
270 |
jdk_JTREG_PROBLEM_LIST += $(TOPDIR)/test/jdk/ProblemList.txt |
d91b0d2d45cb
8179554: make run-test does not respect ProblemList.txt
ihse
parents:
47939
diff
changeset
|
271 |
jaxp_JTREG_PROBLEM_LIST += $(TOPDIR)/test/jaxp/ProblemList.txt |
d91b0d2d45cb
8179554: make run-test does not respect ProblemList.txt
ihse
parents:
47939
diff
changeset
|
272 |
langtools_JTREG_PROBLEM_LIST += $(TOPDIR)/test/langtools/ProblemList.txt |
d91b0d2d45cb
8179554: make run-test does not respect ProblemList.txt
ihse
parents:
47939
diff
changeset
|
273 |
nashorn_JTREG_PROBLEM_LIST += $(TOPDIR)/test/nashorn/ProblemList.txt |
d91b0d2d45cb
8179554: make run-test does not respect ProblemList.txt
ihse
parents:
47939
diff
changeset
|
274 |
hotspot_JTREG_PROBLEM_LIST += $(TOPDIR)/test/hotspot/jtreg/ProblemList.txt |
44027 | 275 |
|
52125
28375a1de254
8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents:
51856
diff
changeset
|
276 |
langtools_JTREG_MAX_MEM := 768m |
28375a1de254
8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents:
51856
diff
changeset
|
277 |
|
44027 | 278 |
################################################################################ |
279 |
# Parse test selection |
|
280 |
# |
|
281 |
# The user has given a test selection in the TEST variable. We must parse it |
|
282 |
# and determine what that means in terms of actual calls to the test framework. |
|
283 |
# |
|
284 |
# The parse functions take as argument a test specification as given by the |
|
285 |
# user, and returns a fully qualified test descriptor if it was a match, or |
|
286 |
# nothing if not. A single test specification can result in multiple test |
|
287 |
# descriptors being returned. A valid test descriptor must always be accepted |
|
288 |
# and returned identically. |
|
289 |
################################################################################ |
|
290 |
||
291 |
# Helper function to determine if a test specification is a Gtest test |
|
292 |
# |
|
293 |
# It is a Gtest test if it is either "gtest", or "gtest:" followed by an optional |
|
48058
c5eefa465e37
8192995: run-test gtest should use all jvm variants, not just "server"
ihse
parents:
48042
diff
changeset
|
294 |
# test filter string, and an optional "/<variant>" to select a specific JVM |
c5eefa465e37
8192995: run-test gtest should use all jvm variants, not just "server"
ihse
parents:
48042
diff
changeset
|
295 |
# variant. If no variant is specified, all found variants are tested. |
44027 | 296 |
define ParseGtestTestSelection |
297 |
$(if $(filter gtest%, $1), \ |
|
298 |
$(if $(filter gtest, $1), \ |
|
48058
c5eefa465e37
8192995: run-test gtest should use all jvm variants, not just "server"
ihse
parents:
48042
diff
changeset
|
299 |
$(addprefix gtest:all/, $(GTEST_VARIANTS)) \ |
44027 | 300 |
, \ |
48058
c5eefa465e37
8192995: run-test gtest should use all jvm variants, not just "server"
ihse
parents:
48042
diff
changeset
|
301 |
$(if $(strip $(or $(filter gtest/%, $1) $(filter gtest:/%, $1))), \ |
c5eefa465e37
8192995: run-test gtest should use all jvm variants, not just "server"
ihse
parents:
48042
diff
changeset
|
302 |
$(patsubst gtest:/%, gtest:all/%, $(patsubst gtest/%, gtest:/%, $1)) \ |
44027 | 303 |
, \ |
48058
c5eefa465e37
8192995: run-test gtest should use all jvm variants, not just "server"
ihse
parents:
48042
diff
changeset
|
304 |
$(if $(filter gtest:%, $1), \ |
c5eefa465e37
8192995: run-test gtest should use all jvm variants, not just "server"
ihse
parents:
48042
diff
changeset
|
305 |
$(if $(findstring /, $1), \ |
c5eefa465e37
8192995: run-test gtest should use all jvm variants, not just "server"
ihse
parents:
48042
diff
changeset
|
306 |
$1 \ |
c5eefa465e37
8192995: run-test gtest should use all jvm variants, not just "server"
ihse
parents:
48042
diff
changeset
|
307 |
, \ |
c5eefa465e37
8192995: run-test gtest should use all jvm variants, not just "server"
ihse
parents:
48042
diff
changeset
|
308 |
$(addprefix $1/, $(GTEST_VARIANTS)) \ |
c5eefa465e37
8192995: run-test gtest should use all jvm variants, not just "server"
ihse
parents:
48042
diff
changeset
|
309 |
) \ |
c5eefa465e37
8192995: run-test gtest should use all jvm variants, not just "server"
ihse
parents:
48042
diff
changeset
|
310 |
) \ |
44027 | 311 |
) \ |
312 |
) \ |
|
313 |
) |
|
314 |
endef |
|
315 |
||
47937
c1437939b0d8
8177957: run-test summary lines look bad/misleading with long test names
ihse
parents:
47932
diff
changeset
|
316 |
# Helper function that removes the TOPDIR part |
c1437939b0d8
8177957: run-test summary lines look bad/misleading with long test names
ihse
parents:
47932
diff
changeset
|
317 |
CleanupJtregPath = \ |
c1437939b0d8
8177957: run-test summary lines look bad/misleading with long test names
ihse
parents:
47932
diff
changeset
|
318 |
$(strip $(patsubst %/, %, $(subst $(JTREG_TOPDIR)/,, $1))) |
c1437939b0d8
8177957: run-test summary lines look bad/misleading with long test names
ihse
parents:
47932
diff
changeset
|
319 |
|
47932
0c22f6b9b5e2
8191820: Fix run-test jtreg test selection and component calculation
ihse
parents:
47928
diff
changeset
|
320 |
# Take a partial Jtreg root path and return a full, absolute path to that Jtreg |
0c22f6b9b5e2
8191820: Fix run-test jtreg test selection and component calculation
ihse
parents:
47928
diff
changeset
|
321 |
# root. Also support having "hotspot" as an alias for "hotspot/jtreg". |
0c22f6b9b5e2
8191820: Fix run-test jtreg test selection and component calculation
ihse
parents:
47928
diff
changeset
|
322 |
ExpandJtregRoot = \ |
47937
c1437939b0d8
8177957: run-test summary lines look bad/misleading with long test names
ihse
parents:
47932
diff
changeset
|
323 |
$(call CleanupJtregPath, $(wildcard \ |
47932
0c22f6b9b5e2
8191820: Fix run-test jtreg test selection and component calculation
ihse
parents:
47928
diff
changeset
|
324 |
$(if $(filter /%, $1), \ |
47937
c1437939b0d8
8177957: run-test summary lines look bad/misleading with long test names
ihse
parents:
47932
diff
changeset
|
325 |
$(if $(wildcard $(strip $1)/TEST.ROOT), \ |
c1437939b0d8
8177957: run-test summary lines look bad/misleading with long test names
ihse
parents:
47932
diff
changeset
|
326 |
$1 \ |
c1437939b0d8
8177957: run-test summary lines look bad/misleading with long test names
ihse
parents:
47932
diff
changeset
|
327 |
) \ |
47932
0c22f6b9b5e2
8191820: Fix run-test jtreg test selection and component calculation
ihse
parents:
47928
diff
changeset
|
328 |
, \ |
0c22f6b9b5e2
8191820: Fix run-test jtreg test selection and component calculation
ihse
parents:
47928
diff
changeset
|
329 |
$(filter $(addprefix %, $1), $(JTREG_TESTROOTS) $(addsuffix /, $(JTREG_TESTROOTS))) \ |
0c22f6b9b5e2
8191820: Fix run-test jtreg test selection and component calculation
ihse
parents:
47928
diff
changeset
|
330 |
$(filter $(addprefix %, $(strip $1)/jtreg), $(JTREG_TESTROOTS) $(addsuffix /, $(JTREG_TESTROOTS))) \ |
0c22f6b9b5e2
8191820: Fix run-test jtreg test selection and component calculation
ihse
parents:
47928
diff
changeset
|
331 |
) \ |
47937
c1437939b0d8
8177957: run-test summary lines look bad/misleading with long test names
ihse
parents:
47932
diff
changeset
|
332 |
)) |
47932
0c22f6b9b5e2
8191820: Fix run-test jtreg test selection and component calculation
ihse
parents:
47928
diff
changeset
|
333 |
|
0c22f6b9b5e2
8191820: Fix run-test jtreg test selection and component calculation
ihse
parents:
47928
diff
changeset
|
334 |
# Take a partial Jtreg test path and return a full, absolute path to that Jtreg |
0c22f6b9b5e2
8191820: Fix run-test jtreg test selection and component calculation
ihse
parents:
47928
diff
changeset
|
335 |
# test. Also support having "hotspot" as an alias for "hotspot/jtreg". |
0c22f6b9b5e2
8191820: Fix run-test jtreg test selection and component calculation
ihse
parents:
47928
diff
changeset
|
336 |
ExpandJtregPath = \ |
0c22f6b9b5e2
8191820: Fix run-test jtreg test selection and component calculation
ihse
parents:
47928
diff
changeset
|
337 |
$(if $(call ExpandJtregRoot, $1), \ |
0c22f6b9b5e2
8191820: Fix run-test jtreg test selection and component calculation
ihse
parents:
47928
diff
changeset
|
338 |
$(call ExpandJtregRoot, $1) \ |
0c22f6b9b5e2
8191820: Fix run-test jtreg test selection and component calculation
ihse
parents:
47928
diff
changeset
|
339 |
, \ |
47937
c1437939b0d8
8177957: run-test summary lines look bad/misleading with long test names
ihse
parents:
47932
diff
changeset
|
340 |
$(call CleanupJtregPath, $(wildcard \ |
47932
0c22f6b9b5e2
8191820: Fix run-test jtreg test selection and component calculation
ihse
parents:
47928
diff
changeset
|
341 |
$(if $(filter /%, $1), \ |
0c22f6b9b5e2
8191820: Fix run-test jtreg test selection and component calculation
ihse
parents:
47928
diff
changeset
|
342 |
$1 \ |
0c22f6b9b5e2
8191820: Fix run-test jtreg test selection and component calculation
ihse
parents:
47928
diff
changeset
|
343 |
, \ |
0c22f6b9b5e2
8191820: Fix run-test jtreg test selection and component calculation
ihse
parents:
47928
diff
changeset
|
344 |
$(addsuffix /$(strip $1), $(JTREG_TESTROOTS) $(TEST_BASEDIRS)) \ |
0c22f6b9b5e2
8191820: Fix run-test jtreg test selection and component calculation
ihse
parents:
47928
diff
changeset
|
345 |
$(addsuffix $(strip $(patsubst hotspot/%, /hotspot/jtreg/%, $1)), $(JTREG_TESTROOTS) $(TEST_BASEDIRS)) \ |
0c22f6b9b5e2
8191820: Fix run-test jtreg test selection and component calculation
ihse
parents:
47928
diff
changeset
|
346 |
) \ |
47937
c1437939b0d8
8177957: run-test summary lines look bad/misleading with long test names
ihse
parents:
47932
diff
changeset
|
347 |
)) \ |
47932
0c22f6b9b5e2
8191820: Fix run-test jtreg test selection and component calculation
ihse
parents:
47928
diff
changeset
|
348 |
) |
0c22f6b9b5e2
8191820: Fix run-test jtreg test selection and component calculation
ihse
parents:
47928
diff
changeset
|
349 |
|
44027 | 350 |
# Helper function to determine if a test specification is a Jtreg test |
351 |
# |
|
352 |
# It is a Jtreg test if it optionally begins with jtreg:, and then is either |
|
353 |
# an unspecified group name (possibly prefixed by :), or a group in a |
|
47932
0c22f6b9b5e2
8191820: Fix run-test jtreg test selection and component calculation
ihse
parents:
47928
diff
changeset
|
354 |
# specified test root, or a path to a test or test directory, |
0c22f6b9b5e2
8191820: Fix run-test jtreg test selection and component calculation
ihse
parents:
47928
diff
changeset
|
355 |
# either absolute or relative to any of the TEST_BASEDIRS or test roots. |
44027 | 356 |
define ParseJtregTestSelection |
357 |
$(eval TEST_NAME := $(strip $(patsubst jtreg:%, %, $1))) \ |
|
358 |
$(if $(or $(findstring :, $(TEST_NAME)), $(findstring /, $(TEST_NAME))), , \ |
|
359 |
$(eval TEST_NAME := :$(TEST_NAME)) \ |
|
360 |
) \ |
|
361 |
$(if $(findstring :, $(TEST_NAME)), \ |
|
362 |
$(if $(filter :%, $(TEST_NAME)), \ |
|
47932
0c22f6b9b5e2
8191820: Fix run-test jtreg test selection and component calculation
ihse
parents:
47928
diff
changeset
|
363 |
$(eval TEST_GROUP := $(patsubst :%, %, $(TEST_NAME))) \ |
48042 | 364 |
$(eval TEST_ROOTS := $(foreach test_root, $(JTREG_TESTROOTS), \ |
365 |
$(call CleanupJtregPath, $(test_root)))) \ |
|
44027 | 366 |
, \ |
47932
0c22f6b9b5e2
8191820: Fix run-test jtreg test selection and component calculation
ihse
parents:
47928
diff
changeset
|
367 |
$(eval TEST_PATH := $(word 1, $(subst :, $(SPACE), $(TEST_NAME)))) \ |
0c22f6b9b5e2
8191820: Fix run-test jtreg test selection and component calculation
ihse
parents:
47928
diff
changeset
|
368 |
$(eval TEST_GROUP := $(word 2, $(subst :, $(SPACE), $(TEST_NAME)))) \ |
0c22f6b9b5e2
8191820: Fix run-test jtreg test selection and component calculation
ihse
parents:
47928
diff
changeset
|
369 |
$(eval TEST_ROOTS := $(call ExpandJtregRoot, $(TEST_PATH))) \ |
0c22f6b9b5e2
8191820: Fix run-test jtreg test selection and component calculation
ihse
parents:
47928
diff
changeset
|
370 |
) \ |
0c22f6b9b5e2
8191820: Fix run-test jtreg test selection and component calculation
ihse
parents:
47928
diff
changeset
|
371 |
$(foreach test_root, $(TEST_ROOTS), \ |
47937
c1437939b0d8
8177957: run-test summary lines look bad/misleading with long test names
ihse
parents:
47932
diff
changeset
|
372 |
$(if $(filter /%, $(test_root)), \ |
47932
0c22f6b9b5e2
8191820: Fix run-test jtreg test selection and component calculation
ihse
parents:
47928
diff
changeset
|
373 |
jtreg:$(test_root):$(TEST_GROUP) \ |
47937
c1437939b0d8
8177957: run-test summary lines look bad/misleading with long test names
ihse
parents:
47932
diff
changeset
|
374 |
, \ |
c1437939b0d8
8177957: run-test summary lines look bad/misleading with long test names
ihse
parents:
47932
diff
changeset
|
375 |
$(if $(filter $(TEST_GROUP), $($(JTREG_TOPDIR)/$(test_root)_JTREG_TEST_GROUPS)), \ |
c1437939b0d8
8177957: run-test summary lines look bad/misleading with long test names
ihse
parents:
47932
diff
changeset
|
376 |
jtreg:$(test_root):$(TEST_GROUP) \ |
c1437939b0d8
8177957: run-test summary lines look bad/misleading with long test names
ihse
parents:
47932
diff
changeset
|
377 |
) \ |
44027 | 378 |
) \ |
379 |
) \ |
|
380 |
, \ |
|
47937
c1437939b0d8
8177957: run-test summary lines look bad/misleading with long test names
ihse
parents:
47932
diff
changeset
|
381 |
$(eval TEST_PATHS := $(call ExpandJtregPath, $(TEST_NAME))) \ |
c1437939b0d8
8177957: run-test summary lines look bad/misleading with long test names
ihse
parents:
47932
diff
changeset
|
382 |
$(foreach test_path, $(TEST_PATHS), \ |
c1437939b0d8
8177957: run-test summary lines look bad/misleading with long test names
ihse
parents:
47932
diff
changeset
|
383 |
jtreg:$(test_path) \ |
44027 | 384 |
) \ |
385 |
) |
|
386 |
endef |
|
387 |
||
48061
665769d3cee4
8193014: Add "special" tests to run-test to cover odd cases
ihse
parents:
48058
diff
changeset
|
388 |
# Helper function to determine if a test specification is a special test |
665769d3cee4
8193014: Add "special" tests to run-test to cover odd cases
ihse
parents:
48058
diff
changeset
|
389 |
# |
52342 | 390 |
# It is a special test if it is "special:" followed by a test name, |
391 |
# if it is "make:" or "make-" followed by a make test, or any of the special test names |
|
392 |
# as a single word. |
|
48061
665769d3cee4
8193014: Add "special" tests to run-test to cover odd cases
ihse
parents:
48058
diff
changeset
|
393 |
define ParseSpecialTestSelection |
665769d3cee4
8193014: Add "special" tests to run-test to cover odd cases
ihse
parents:
48058
diff
changeset
|
394 |
$(if $(filter special:%, $1), \ |
665769d3cee4
8193014: Add "special" tests to run-test to cover odd cases
ihse
parents:
48058
diff
changeset
|
395 |
$1 \ |
52342 | 396 |
) \ |
397 |
$(if $(filter make%, $1), \ |
|
398 |
$(if $(filter make:%, $1), \ |
|
399 |
special:$(strip $1) \ |
|
400 |
) \ |
|
401 |
$(if $(filter make-%, $1), \ |
|
402 |
special:$(patsubst make-%,make:%, $1) \ |
|
403 |
) \ |
|
404 |
$(if $(filter make, $1), \ |
|
405 |
special:make:all \ |
|
406 |
) |
|
407 |
) \ |
|
52396
e292e94b448a
8213058: remove ExecuteInternalVMTests and VerboseInternalVMTests flags
iignatyev
parents:
52393
diff
changeset
|
408 |
$(if $(filter failure-handler, $1), \ |
52342 | 409 |
special:$(strip $1) \ |
48061
665769d3cee4
8193014: Add "special" tests to run-test to cover odd cases
ihse
parents:
48058
diff
changeset
|
410 |
) |
665769d3cee4
8193014: Add "special" tests to run-test to cover odd cases
ihse
parents:
48058
diff
changeset
|
411 |
endef |
665769d3cee4
8193014: Add "special" tests to run-test to cover odd cases
ihse
parents:
48058
diff
changeset
|
412 |
|
44027 | 413 |
ifeq ($(TEST), ) |
414 |
$(info No test selection given in TEST!) |
|
52342 | 415 |
$(info Please use e.g. 'make test TEST=tier1' or 'make test-tier1') |
47928
fb62d4519338
8191715: Update documentation pointing to "common" directory
ihse
parents:
47329
diff
changeset
|
416 |
$(info See doc/testing.[md|html] for help) |
44027 | 417 |
$(error Cannot continue) |
418 |
endif |
|
419 |
||
420 |
# Now intelligently convert the test selection given by the user in TEST |
|
421 |
# into a list of fully qualified test descriptors of the tests to run. |
|
422 |
TESTS_TO_RUN := |
|
423 |
$(foreach test, $(TEST), \ |
|
424 |
$(eval PARSED_TESTS := $(call ParseCustomTestSelection, $(test))) \ |
|
425 |
$(if $(strip $(PARSED_TESTS)), , \ |
|
426 |
$(eval PARSED_TESTS += $(call ParseGtestTestSelection, $(test))) \ |
|
427 |
) \ |
|
428 |
$(if $(strip $(PARSED_TESTS)), , \ |
|
429 |
$(eval PARSED_TESTS += $(call ParseJtregTestSelection, $(test))) \ |
|
430 |
) \ |
|
431 |
$(if $(strip $(PARSED_TESTS)), , \ |
|
48061
665769d3cee4
8193014: Add "special" tests to run-test to cover odd cases
ihse
parents:
48058
diff
changeset
|
432 |
$(eval PARSED_TESTS += $(call ParseSpecialTestSelection, $(test))) \ |
665769d3cee4
8193014: Add "special" tests to run-test to cover odd cases
ihse
parents:
48058
diff
changeset
|
433 |
) \ |
665769d3cee4
8193014: Add "special" tests to run-test to cover odd cases
ihse
parents:
48058
diff
changeset
|
434 |
$(if $(strip $(PARSED_TESTS)), , \ |
44027 | 435 |
$(eval UNKNOWN_TEST := $(test)) \ |
436 |
) \ |
|
437 |
$(eval TESTS_TO_RUN += $(PARSED_TESTS)) \ |
|
438 |
) |
|
439 |
||
440 |
ifneq ($(UNKNOWN_TEST), ) |
|
441 |
$(info Unknown test selection: '$(UNKNOWN_TEST)') |
|
47928
fb62d4519338
8191715: Update documentation pointing to "common" directory
ihse
parents:
47329
diff
changeset
|
442 |
$(info See doc/testing.[md|html] for help) |
44027 | 443 |
$(error Cannot continue) |
444 |
endif |
|
445 |
||
446 |
TESTS_TO_RUN := $(strip $(TESTS_TO_RUN)) |
|
447 |
||
448 |
||
449 |
# Present the result of our parsing to the user |
|
450 |
$(info Test selection '$(TEST)', will run:) |
|
451 |
$(foreach test, $(TESTS_TO_RUN), $(info * $(test))) |
|
452 |
||
453 |
||
454 |
################################################################################ |
|
455 |
# Functions for setting up rules for running the selected tests |
|
456 |
# |
|
457 |
# The SetupRun*Test functions all have the same interface: |
|
458 |
# |
|
459 |
# Parameter 1 is the name of the rule. This is the test id, based on the test |
|
460 |
# descriptor, and this is also used as variable prefix, and the targets |
|
461 |
# generated are listed in a variable by that name. |
|
462 |
# |
|
463 |
# Remaining parameters are named arguments. Currently this is only: |
|
464 |
# TEST -- The properly formatted fully qualified test descriptor |
|
465 |
# |
|
466 |
# After the rule named by the test id has been executed, the following |
|
467 |
# variables will be available: |
|
468 |
# testid_TOTAL - the total number of tests run |
|
469 |
# testid_PASSED - the number of successful tests |
|
470 |
# testid_FAILED - the number of failed tests |
|
471 |
# testid_ERROR - the number of tests was neither successful or failed |
|
472 |
# |
|
473 |
################################################################################ |
|
474 |
||
475 |
### Rules for Gtest |
|
476 |
||
477 |
SetupRunGtestTest = $(NamedParamsMacroTemplate) |
|
478 |
define SetupRunGtestTestBody |
|
479 |
$1_TEST_RESULTS_DIR := $$(TEST_RESULTS_DIR)/$1 |
|
480 |
$1_TEST_SUPPORT_DIR := $$(TEST_SUPPORT_DIR)/$1 |
|
48042 | 481 |
$1_EXITCODE := $$($1_TEST_RESULTS_DIR)/exitcode.txt |
44027 | 482 |
|
48058
c5eefa465e37
8192995: run-test gtest should use all jvm variants, not just "server"
ihse
parents:
48042
diff
changeset
|
483 |
$1_VARIANT := $$(lastword $$(subst /, , $$($1_TEST))) |
c5eefa465e37
8192995: run-test gtest should use all jvm variants, not just "server"
ihse
parents:
48042
diff
changeset
|
484 |
ifeq ($$(filter $$($1_VARIANT), $$(GTEST_VARIANTS)), ) |
c5eefa465e37
8192995: run-test gtest should use all jvm variants, not just "server"
ihse
parents:
48042
diff
changeset
|
485 |
$$(error Invalid gtest variant '$$($1_VARIANT)'. Valid variants: $$(GTEST_VARIANTS)) |
c5eefa465e37
8192995: run-test gtest should use all jvm variants, not just "server"
ihse
parents:
48042
diff
changeset
|
486 |
endif |
c5eefa465e37
8192995: run-test gtest should use all jvm variants, not just "server"
ihse
parents:
48042
diff
changeset
|
487 |
$1_TEST_NAME := $$(strip $$(patsubst %/$$($1_VARIANT), %, \ |
c5eefa465e37
8192995: run-test gtest should use all jvm variants, not just "server"
ihse
parents:
48042
diff
changeset
|
488 |
$$(patsubst gtest:%, %, $$($1_TEST)))) |
44027 | 489 |
ifneq ($$($1_TEST_NAME), all) |
490 |
$1_GTEST_FILTER := --gtest_filter=$$($1_TEST_NAME)* |
|
491 |
endif |
|
492 |
||
493 |
ifneq ($$(GTEST_REPEAT), ) |
|
494 |
$1_GTEST_REPEAT :=--gtest_repeat=$$(GTEST_REPEAT) |
|
495 |
endif |
|
496 |
||
52393
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
497 |
ifneq ($$(GTEST_AOT_MODULES), ) |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
498 |
$$(eval $$(call SetupAot, $1, \ |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
499 |
MODULES := $$(GTEST_AOT_MODULES), \ |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
500 |
VM_OPTIONS := $$(GTEST_VM_OPTIONS) $$(GTEST_JAVA_OPTIONS), \ |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
501 |
)) |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
502 |
endif |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
503 |
|
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
504 |
run-test-$1: $$($1_AOT_TARGETS) |
44027 | 505 |
$$(call LogWarn) |
506 |
$$(call LogWarn, Running test '$$($1_TEST)') |
|
507 |
$$(call MakeDir, $$($1_TEST_RESULTS_DIR) $$($1_TEST_SUPPORT_DIR)) |
|
508 |
$$(call ExecuteWithLog, $$($1_TEST_SUPPORT_DIR)/gtest, \ |
|
48058
c5eefa465e37
8192995: run-test gtest should use all jvm variants, not just "server"
ihse
parents:
48042
diff
changeset
|
509 |
$$(FIXPATH) $$(TEST_IMAGE_DIR)/hotspot/gtest/$$($1_VARIANT)/gtestLauncher \ |
52125
28375a1de254
8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents:
51856
diff
changeset
|
510 |
-jdk $(JDK_IMAGE_DIR) $$($1_GTEST_FILTER) \ |
28375a1de254
8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents:
51856
diff
changeset
|
511 |
--gtest_output=xml:$$($1_TEST_RESULTS_DIR)/gtest.xml \ |
28375a1de254
8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents:
51856
diff
changeset
|
512 |
$$($1_GTEST_REPEAT) $$(GTEST_OPTIONS) $$(GTEST_VM_OPTIONS) \ |
52393
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
513 |
$$(GTEST_JAVA_OPTIONS) $$($1_AOT_OPTIONS) \ |
48042 | 514 |
> >($(TEE) $$($1_TEST_RESULTS_DIR)/gtest.txt) \ |
515 |
&& $$(ECHO) $$$$? > $$($1_EXITCODE) \ |
|
516 |
|| $$(ECHO) $$$$? > $$($1_EXITCODE) \ |
|
517 |
) |
|
44027 | 518 |
|
519 |
$1_RESULT_FILE := $$($1_TEST_RESULTS_DIR)/gtest.txt |
|
520 |
||
521 |
parse-test-$1: run-test-$1 |
|
522 |
$$(call LogWarn, Finished running test '$$($1_TEST)') |
|
523 |
$$(call LogWarn, Test report is stored in $$(strip \ |
|
524 |
$$(subst $$(TOPDIR)/, , $$($1_TEST_RESULTS_DIR)))) |
|
48042 | 525 |
$$(if $$(wildcard $$($1_RESULT_FILE)), \ |
47956
72a474c85aee
8177956: Add TEST_VM_OPTS as convenience for run-test arguments
ihse
parents:
47943
diff
changeset
|
526 |
$$(eval $1_TOTAL := $$(shell $$(AWK) '/==========.* tests? from .* \ |
72a474c85aee
8177956: Add TEST_VM_OPTS as convenience for run-test arguments
ihse
parents:
47943
diff
changeset
|
527 |
test cases? ran/ { print $$$$2 }' $$($1_RESULT_FILE))) \ |
72a474c85aee
8177956: Add TEST_VM_OPTS as convenience for run-test arguments
ihse
parents:
47943
diff
changeset
|
528 |
$$(if $$($1_TOTAL), , $$(eval $1_TOTAL := 0)) \ |
72a474c85aee
8177956: Add TEST_VM_OPTS as convenience for run-test arguments
ihse
parents:
47943
diff
changeset
|
529 |
$$(eval $1_PASSED := $$(shell $$(AWK) '/\[ PASSED \] .* tests?./ \ |
72a474c85aee
8177956: Add TEST_VM_OPTS as convenience for run-test arguments
ihse
parents:
47943
diff
changeset
|
530 |
{ print $$$$4 }' $$($1_RESULT_FILE))) \ |
72a474c85aee
8177956: Add TEST_VM_OPTS as convenience for run-test arguments
ihse
parents:
47943
diff
changeset
|
531 |
$$(if $$($1_PASSED), , $$(eval $1_PASSED := 0)) \ |
72a474c85aee
8177956: Add TEST_VM_OPTS as convenience for run-test arguments
ihse
parents:
47943
diff
changeset
|
532 |
$$(eval $1_FAILED := $$(shell $$(AWK) '/\[ FAILED \] .* tests?, \ |
72a474c85aee
8177956: Add TEST_VM_OPTS as convenience for run-test arguments
ihse
parents:
47943
diff
changeset
|
533 |
listed below/ { print $$$$4 }' $$($1_RESULT_FILE))) \ |
72a474c85aee
8177956: Add TEST_VM_OPTS as convenience for run-test arguments
ihse
parents:
47943
diff
changeset
|
534 |
$$(if $$($1_FAILED), , $$(eval $1_FAILED := 0)) \ |
72a474c85aee
8177956: Add TEST_VM_OPTS as convenience for run-test arguments
ihse
parents:
47943
diff
changeset
|
535 |
$$(eval $1_ERROR := $$(shell \ |
72a474c85aee
8177956: Add TEST_VM_OPTS as convenience for run-test arguments
ihse
parents:
47943
diff
changeset
|
536 |
$$(EXPR) $$($1_TOTAL) - $$($1_PASSED) - $$($1_FAILED))) \ |
72a474c85aee
8177956: Add TEST_VM_OPTS as convenience for run-test arguments
ihse
parents:
47943
diff
changeset
|
537 |
, \ |
72a474c85aee
8177956: Add TEST_VM_OPTS as convenience for run-test arguments
ihse
parents:
47943
diff
changeset
|
538 |
$$(eval $1_PASSED := 0) \ |
72a474c85aee
8177956: Add TEST_VM_OPTS as convenience for run-test arguments
ihse
parents:
47943
diff
changeset
|
539 |
$$(eval $1_FAILED := 0) \ |
72a474c85aee
8177956: Add TEST_VM_OPTS as convenience for run-test arguments
ihse
parents:
47943
diff
changeset
|
540 |
$$(eval $1_ERROR := 1) \ |
72a474c85aee
8177956: Add TEST_VM_OPTS as convenience for run-test arguments
ihse
parents:
47943
diff
changeset
|
541 |
$$(eval $1_TOTAL := 1) \ |
72a474c85aee
8177956: Add TEST_VM_OPTS as convenience for run-test arguments
ihse
parents:
47943
diff
changeset
|
542 |
) |
44027 | 543 |
|
544 |
$1: run-test-$1 parse-test-$1 |
|
545 |
||
546 |
TARGETS += $1 |
|
547 |
endef |
|
548 |
||
549 |
################################################################################ |
|
550 |
||
551 |
### Rules for Jtreg |
|
552 |
||
553 |
# Helper function for SetupRunJtregTest. Set a JTREG_* variable from, in order: |
|
554 |
# 1) Specified by user on command line |
|
555 |
# 2) Component-specific default |
|
556 |
# 3) Generic default |
|
557 |
# |
|
558 |
# Note: No spaces are allowed around the arguments. |
|
559 |
# Arg $1 The test ID (i.e. $1 in SetupRunJtregTest) |
|
560 |
# Arg $2 Base variable, e.g. JTREG_JOBS |
|
561 |
# Arg $3 The default value (optional) |
|
562 |
define SetJtregValue |
|
563 |
ifneq ($$($2), ) |
|
564 |
$1_$2 := $$($2) |
|
565 |
else |
|
566 |
ifneq ($$($$($1_COMPONENT)_$2), ) |
|
567 |
$1_$2 := $$($$($1_COMPONENT)_$2) |
|
568 |
else |
|
569 |
ifneq ($3, ) |
|
570 |
$1_$2 := $3 |
|
571 |
endif |
|
572 |
endif |
|
573 |
endif |
|
574 |
endef |
|
575 |
||
576 |
SetupRunJtregTest = $(NamedParamsMacroTemplate) |
|
577 |
define SetupRunJtregTestBody |
|
578 |
$1_TEST_RESULTS_DIR := $$(TEST_RESULTS_DIR)/$1 |
|
579 |
$1_TEST_SUPPORT_DIR := $$(TEST_SUPPORT_DIR)/$1 |
|
48042 | 580 |
$1_EXITCODE := $$($1_TEST_RESULTS_DIR)/exitcode.txt |
44027 | 581 |
|
582 |
$1_TEST_NAME := $$(strip $$(patsubst jtreg:%, %, $$($1_TEST))) |
|
47932
0c22f6b9b5e2
8191820: Fix run-test jtreg test selection and component calculation
ihse
parents:
47928
diff
changeset
|
583 |
|
52125
28375a1de254
8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents:
51856
diff
changeset
|
584 |
$1_TEST_ROOT := \ |
47932
0c22f6b9b5e2
8191820: Fix run-test jtreg test selection and component calculation
ihse
parents:
47928
diff
changeset
|
585 |
$$(strip $$(foreach root, $$(JTREG_TESTROOTS), \ |
52125
28375a1de254
8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents:
51856
diff
changeset
|
586 |
$$(if $$(filter $$(root)%, $$(JTREG_TOPDIR)/$$($1_TEST_NAME)), $$(root)) \ |
47932
0c22f6b9b5e2
8191820: Fix run-test jtreg test selection and component calculation
ihse
parents:
47928
diff
changeset
|
587 |
)) |
52125
28375a1de254
8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents:
51856
diff
changeset
|
588 |
$1_COMPONENT := $$(lastword $$(subst /, $$(SPACE), $$($1_TEST_ROOT))) |
47932
0c22f6b9b5e2
8191820: Fix run-test jtreg test selection and component calculation
ihse
parents:
47928
diff
changeset
|
589 |
# This will work only as long as just hotspot has the additional "jtreg" directory |
0c22f6b9b5e2
8191820: Fix run-test jtreg test selection and component calculation
ihse
parents:
47928
diff
changeset
|
590 |
ifeq ($$($1_COMPONENT), jtreg) |
0c22f6b9b5e2
8191820: Fix run-test jtreg test selection and component calculation
ihse
parents:
47928
diff
changeset
|
591 |
$1_COMPONENT := hotspot |
0c22f6b9b5e2
8191820: Fix run-test jtreg test selection and component calculation
ihse
parents:
47928
diff
changeset
|
592 |
endif |
44027 | 593 |
|
45104 | 594 |
ifeq ($$(JT_HOME), ) |
595 |
$$(info Error: jtreg framework is not found.) |
|
596 |
$$(info Please run configure using --with-jtreg.) |
|
597 |
$$(error Cannot continue) |
|
598 |
endif |
|
599 |
||
44027 | 600 |
# Unfortunately, we need different defaults for some JTREG values, |
601 |
# depending on what component we're running. |
|
602 |
||
603 |
# Convert JTREG_foo into $1_JTREG_foo with a suitable value. |
|
604 |
$$(eval $$(call SetJtregValue,$1,JTREG_TEST_MODE,agentvm)) |
|
605 |
$$(eval $$(call SetJtregValue,$1,JTREG_ASSERT,true)) |
|
606 |
$$(eval $$(call SetJtregValue,$1,JTREG_MAX_MEM,512m)) |
|
607 |
$$(eval $$(call SetJtregValue,$1,JTREG_NATIVEPATH)) |
|
608 |
$$(eval $$(call SetJtregValue,$1,JTREG_BASIC_OPTIONS)) |
|
47941
d91b0d2d45cb
8179554: make run-test does not respect ProblemList.txt
ihse
parents:
47939
diff
changeset
|
609 |
$$(eval $$(call SetJtregValue,$1,JTREG_PROBLEM_LIST)) |
44027 | 610 |
|
52125
28375a1de254
8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents:
51856
diff
changeset
|
611 |
# Only the problem list for the current test root should be used. |
28375a1de254
8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents:
51856
diff
changeset
|
612 |
$1_JTREG_PROBLEM_LIST := $$(filter $$($1_TEST_ROOT)%, $$($1_JTREG_PROBLEM_LIST)) |
28375a1de254
8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents:
51856
diff
changeset
|
613 |
|
44027 | 614 |
ifneq ($(TEST_JOBS), 0) |
615 |
$$(eval $$(call SetJtregValue,$1,JTREG_JOBS,$$(TEST_JOBS))) |
|
616 |
else |
|
617 |
$$(eval $$(call SetJtregValue,$1,JTREG_JOBS,$$(JOBS))) |
|
618 |
endif |
|
619 |
||
47058
85aaac5701da
8186248: Allow more flexibility in selecting Heap % of available RAM
bobv
parents:
46230
diff
changeset
|
620 |
# Make sure MaxRAMPercentage is high enough to not cause OOM or swapping since |
44027 | 621 |
# we may end up with a lot of JVM's |
47058
85aaac5701da
8186248: Allow more flexibility in selecting Heap % of available RAM
bobv
parents:
46230
diff
changeset
|
622 |
$1_JTREG_MAX_RAM_PERCENTAGE := $$(shell $$(EXPR) 25 / $$($1_JTREG_JOBS)) |
44027 | 623 |
|
52125
28375a1de254
8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents:
51856
diff
changeset
|
624 |
JTREG_TIMEOUT_FACTOR ?= 4 |
44027 | 625 |
JTREG_VERBOSE ?= fail,error,summary |
626 |
JTREG_RETAIN ?= fail,error |
|
627 |
||
628 |
ifneq ($$($1_JTREG_MAX_MEM), 0) |
|
629 |
$1_JTREG_BASIC_OPTIONS += -vmoption:-Xmx$$($1_JTREG_MAX_MEM) |
|
630 |
$1_JTREG_LAUNCHER_OPTIONS += -Xmx$$($1_JTREG_MAX_MEM) |
|
631 |
endif |
|
632 |
||
633 |
$1_JTREG_BASIC_OPTIONS += -$$($1_JTREG_TEST_MODE) \ |
|
634 |
-verbose:$$(JTREG_VERBOSE) -retain:$$(JTREG_RETAIN) \ |
|
52125
28375a1de254
8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents:
51856
diff
changeset
|
635 |
-concurrency:$$($1_JTREG_JOBS) -timeoutFactor:$$(JTREG_TIMEOUT_FACTOR) \ |
47058
85aaac5701da
8186248: Allow more flexibility in selecting Heap % of available RAM
bobv
parents:
46230
diff
changeset
|
636 |
-vmoption:-XX:MaxRAMPercentage=$$($1_JTREG_MAX_RAM_PERCENTAGE) |
44027 | 637 |
|
52125
28375a1de254
8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents:
51856
diff
changeset
|
638 |
$1_JTREG_BASIC_OPTIONS += -automatic -ignore:quiet |
44027 | 639 |
|
47329 | 640 |
# Make it possible to specify the JIB_DATA_DIR for tests using the |
641 |
# JIB Artifact resolver |
|
642 |
$1_JTREG_BASIC_OPTIONS += -e:JIB_DATA_DIR |
|
44027 | 643 |
# Some tests needs to find a boot JDK using the JDK8_HOME variable. |
644 |
$1_JTREG_BASIC_OPTIONS += -e:JDK8_HOME=$$(BOOT_JDK) |
|
49147
af37d9997bd6
8199197: Set _NT_SYMBOL_PATH when running tests on windows
erikj
parents:
48061
diff
changeset
|
645 |
# If running on Windows, propagate the _NT_SYMBOL_PATH to enable |
af37d9997bd6
8199197: Set _NT_SYMBOL_PATH when running tests on windows
erikj
parents:
48061
diff
changeset
|
646 |
# symbol lookup in hserr files |
af37d9997bd6
8199197: Set _NT_SYMBOL_PATH when running tests on windows
erikj
parents:
48061
diff
changeset
|
647 |
ifeq ($$(OPENJDK_TARGET_OS), windows) |
af37d9997bd6
8199197: Set _NT_SYMBOL_PATH when running tests on windows
erikj
parents:
48061
diff
changeset
|
648 |
$1_JTREG_BASIC_OPTIONS += -e:_NT_SYMBOL_PATH |
af37d9997bd6
8199197: Set _NT_SYMBOL_PATH when running tests on windows
erikj
parents:
48061
diff
changeset
|
649 |
endif |
44027 | 650 |
|
651 |
$1_JTREG_BASIC_OPTIONS += \ |
|
652 |
$$(addprefix -javaoption:, $$(JTREG_JAVA_OPTIONS)) \ |
|
653 |
$$(addprefix -vmoption:, $$(JTREG_VM_OPTIONS)) \ |
|
654 |
# |
|
655 |
||
656 |
ifeq ($$($1_JTREG_ASSERT), true) |
|
657 |
$1_JTREG_BASIC_OPTIONS += -ea -esa |
|
658 |
endif |
|
659 |
||
660 |
ifneq ($$($1_JTREG_NATIVEPATH), ) |
|
661 |
$1_JTREG_BASIC_OPTIONS += -nativepath:$$($1_JTREG_NATIVEPATH) |
|
662 |
endif |
|
663 |
||
47941
d91b0d2d45cb
8179554: make run-test does not respect ProblemList.txt
ihse
parents:
47939
diff
changeset
|
664 |
ifneq ($$($1_JTREG_PROBLEM_LIST), ) |
d91b0d2d45cb
8179554: make run-test does not respect ProblemList.txt
ihse
parents:
47939
diff
changeset
|
665 |
$1_JTREG_BASIC_OPTIONS += $$(addprefix -exclude:, $$($1_JTREG_PROBLEM_LIST)) |
d91b0d2d45cb
8179554: make run-test does not respect ProblemList.txt
ihse
parents:
47939
diff
changeset
|
666 |
endif |
d91b0d2d45cb
8179554: make run-test does not respect ProblemList.txt
ihse
parents:
47939
diff
changeset
|
667 |
|
52125
28375a1de254
8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents:
51856
diff
changeset
|
668 |
ifneq ($$(JTREG_EXTRA_PROBLEM_LISTS), ) |
28375a1de254
8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents:
51856
diff
changeset
|
669 |
# Accept both absolute paths as well as relative to the current test root. |
28375a1de254
8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents:
51856
diff
changeset
|
670 |
$1_JTREG_BASIC_OPTIONS += $$(addprefix -exclude:, $$(wildcard \ |
28375a1de254
8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents:
51856
diff
changeset
|
671 |
$$(JTREG_EXTRA_PROBLEM_LISTS) \ |
28375a1de254
8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents:
51856
diff
changeset
|
672 |
$$(addprefix $$($1_TEST_ROOT)/, $$(JTREG_EXTRA_PROBLEM_LISTS)) \ |
28375a1de254
8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents:
51856
diff
changeset
|
673 |
)) |
28375a1de254
8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents:
51856
diff
changeset
|
674 |
endif |
28375a1de254
8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents:
51856
diff
changeset
|
675 |
|
51856
11b9d3a6f31c
8211037: Load jib jars dynamically from JibArtifactManager
erikj
parents:
50908
diff
changeset
|
676 |
ifneq ($$(JIB_HOME), ) |
11b9d3a6f31c
8211037: Load jib jars dynamically from JibArtifactManager
erikj
parents:
50908
diff
changeset
|
677 |
$1_JTREG_BASIC_OPTIONS += -e:JIB_HOME=$$(JIB_HOME) |
46230
e0ca0417b74d
8180600: make run-test does not work with jib test dependencies
erikj
parents:
45104
diff
changeset
|
678 |
endif |
e0ca0417b74d
8180600: make run-test does not work with jib test dependencies
erikj
parents:
45104
diff
changeset
|
679 |
|
50908 | 680 |
$1_JTREG_BASIC_OPTIONS += -e:TEST_IMAGE_GRAAL_DIR=${TEST_IMAGE_DIR}/hotspot/jtreg/graal |
681 |
||
47986 | 682 |
ifneq ($$(JTREG_FAILURE_HANDLER_OPTIONS), ) |
683 |
$1_JTREG_LAUNCHER_OPTIONS += -Djava.library.path="$(JTREG_FAILURE_HANDLER_DIR)" |
|
684 |
endif |
|
685 |
||
52125
28375a1de254
8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents:
51856
diff
changeset
|
686 |
ifneq ($$(JTREG_KEYWORDS), ) |
28375a1de254
8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents:
51856
diff
changeset
|
687 |
# The keywords string may contain problematic characters and may be quoted |
28375a1de254
8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents:
51856
diff
changeset
|
688 |
# already when it arrives here. Remove any existing quotes and replace them |
28375a1de254
8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents:
51856
diff
changeset
|
689 |
# with one set of single quotes. |
28375a1de254
8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents:
51856
diff
changeset
|
690 |
$1_JTREG_KEYWORDS := \ |
28375a1de254
8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents:
51856
diff
changeset
|
691 |
$$(strip $$(subst $$(SQUOTE),,$$(subst $$(DQUOTE),,$$(JTREG_KEYWORDS)))) |
28375a1de254
8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents:
51856
diff
changeset
|
692 |
ifneq ($$($1_JTREG_KEYWORDS), ) |
28375a1de254
8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents:
51856
diff
changeset
|
693 |
$1_JTREG_BASIC_OPTIONS += -k:'$$($1_JTREG_KEYWORDS)' |
28375a1de254
8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents:
51856
diff
changeset
|
694 |
endif |
28375a1de254
8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents:
51856
diff
changeset
|
695 |
endif |
28375a1de254
8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents:
51856
diff
changeset
|
696 |
|
52393
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
697 |
ifneq ($$(JTREG_AOT_MODULES), ) |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
698 |
$$(eval $$(call SetupAot, $1, \ |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
699 |
MODULES := $$(JTREG_AOT_MODULES), \ |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
700 |
VM_OPTIONS := $$(JTREG_VM_OPTIONS) $$(JTREG_JAVA_OPTIONS), \ |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
701 |
)) |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
702 |
endif |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
703 |
|
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
704 |
ifneq ($$($1_AOT_OPTIONS), ) |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
705 |
$1_JTREG_BASIC_OPTIONS += -vmoptions:"$$($1_AOT_OPTIONS)" |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
706 |
endif |
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
707 |
|
47939
fe7596497fb0
8179555: make run-test should always use a fresh, clean JTwork directory
ihse
parents:
47938
diff
changeset
|
708 |
clean-workdir-$1: |
fe7596497fb0
8179555: make run-test should always use a fresh, clean JTwork directory
ihse
parents:
47938
diff
changeset
|
709 |
$$(RM) -r $$($1_TEST_SUPPORT_DIR) |
fe7596497fb0
8179555: make run-test should always use a fresh, clean JTwork directory
ihse
parents:
47938
diff
changeset
|
710 |
|
52393
ff10f8f3a583
8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents:
52342
diff
changeset
|
711 |
run-test-$1: clean-workdir-$1 $$($1_AOT_TARGETS) |
44027 | 712 |
$$(call LogWarn) |
713 |
$$(call LogWarn, Running test '$$($1_TEST)') |
|
714 |
$$(call MakeDir, $$($1_TEST_RESULTS_DIR) $$($1_TEST_SUPPORT_DIR)) |
|
715 |
$$(call ExecuteWithLog, $$($1_TEST_SUPPORT_DIR)/jtreg, \ |
|
716 |
$$(JAVA) $$($1_JTREG_LAUNCHER_OPTIONS) \ |
|
717 |
-Dprogram=jtreg -jar $$(JT_HOME)/lib/jtreg.jar \ |
|
718 |
$$($1_JTREG_BASIC_OPTIONS) \ |
|
719 |
-testjdk:$$(JDK_IMAGE_DIR) \ |
|
47937
c1437939b0d8
8177957: run-test summary lines look bad/misleading with long test names
ihse
parents:
47932
diff
changeset
|
720 |
-dir:$$(JTREG_TOPDIR) \ |
44027 | 721 |
-reportDir:$$($1_TEST_RESULTS_DIR) \ |
722 |
-workDir:$$($1_TEST_SUPPORT_DIR) \ |
|
723 |
$$(JTREG_OPTIONS) \ |
|
47986 | 724 |
$$(JTREG_FAILURE_HANDLER_OPTIONS) \ |
48042 | 725 |
$$($1_TEST_NAME) \ |
726 |
&& $$(ECHO) $$$$? > $$($1_EXITCODE) \ |
|
727 |
|| $$(ECHO) $$$$? > $$($1_EXITCODE) \ |
|
728 |
) |
|
44027 | 729 |
|
730 |
$1_RESULT_FILE := $$($1_TEST_RESULTS_DIR)/text/stats.txt |
|
731 |
||
732 |
parse-test-$1: run-test-$1 |
|
733 |
$$(call LogWarn, Finished running test '$$($1_TEST)') |
|
734 |
$$(call LogWarn, Test report is stored in $$(strip \ |
|
735 |
$$(subst $$(TOPDIR)/, , $$($1_TEST_RESULTS_DIR)))) |
|
48042 | 736 |
$$(if $$(wildcard $$($1_RESULT_FILE)), \ |
47259
0b347d8efb40
8187672: RunTest displays broken output if jtreg fails completely
ihse
parents:
47253
diff
changeset
|
737 |
$$(eval $1_PASSED := $$(shell $$(AWK) '{ gsub(/[,;]/, ""); \ |
0b347d8efb40
8187672: RunTest displays broken output if jtreg fails completely
ihse
parents:
47253
diff
changeset
|
738 |
for (i=1; i<=NF; i++) { if ($$$$i == "passed:") \ |
0b347d8efb40
8187672: RunTest displays broken output if jtreg fails completely
ihse
parents:
47253
diff
changeset
|
739 |
print $$$$(i+1) } }' $$($1_RESULT_FILE))) \ |
0b347d8efb40
8187672: RunTest displays broken output if jtreg fails completely
ihse
parents:
47253
diff
changeset
|
740 |
$$(if $$($1_PASSED), , $$(eval $1_PASSED := 0)) \ |
0b347d8efb40
8187672: RunTest displays broken output if jtreg fails completely
ihse
parents:
47253
diff
changeset
|
741 |
$$(eval $1_FAILED := $$(shell $$(AWK) '{gsub(/[,;]/, ""); \ |
0b347d8efb40
8187672: RunTest displays broken output if jtreg fails completely
ihse
parents:
47253
diff
changeset
|
742 |
for (i=1; i<=NF; i++) { if ($$$$i == "failed:") \ |
0b347d8efb40
8187672: RunTest displays broken output if jtreg fails completely
ihse
parents:
47253
diff
changeset
|
743 |
print $$$$(i+1) } }' $$($1_RESULT_FILE))) \ |
0b347d8efb40
8187672: RunTest displays broken output if jtreg fails completely
ihse
parents:
47253
diff
changeset
|
744 |
$$(if $$($1_FAILED), , $$(eval $1_FAILED := 0)) \ |
0b347d8efb40
8187672: RunTest displays broken output if jtreg fails completely
ihse
parents:
47253
diff
changeset
|
745 |
$$(eval $1_ERROR := $$(shell $$(AWK) '{gsub(/[,;]/, ""); \ |
0b347d8efb40
8187672: RunTest displays broken output if jtreg fails completely
ihse
parents:
47253
diff
changeset
|
746 |
for (i=1; i<=NF; i++) { if ($$$$i == "error:") \ |
0b347d8efb40
8187672: RunTest displays broken output if jtreg fails completely
ihse
parents:
47253
diff
changeset
|
747 |
print $$$$(i+1) } }' $$($1_RESULT_FILE))) \ |
0b347d8efb40
8187672: RunTest displays broken output if jtreg fails completely
ihse
parents:
47253
diff
changeset
|
748 |
$$(if $$($1_ERROR), , $$(eval $1_ERROR := 0)) \ |
0b347d8efb40
8187672: RunTest displays broken output if jtreg fails completely
ihse
parents:
47253
diff
changeset
|
749 |
$$(eval $1_TOTAL := $$(shell \ |
0b347d8efb40
8187672: RunTest displays broken output if jtreg fails completely
ihse
parents:
47253
diff
changeset
|
750 |
$$(EXPR) $$($1_PASSED) + $$($1_FAILED) + $$($1_ERROR))) \ |
0b347d8efb40
8187672: RunTest displays broken output if jtreg fails completely
ihse
parents:
47253
diff
changeset
|
751 |
, \ |
0b347d8efb40
8187672: RunTest displays broken output if jtreg fails completely
ihse
parents:
47253
diff
changeset
|
752 |
$$(eval $1_PASSED := 0) \ |
0b347d8efb40
8187672: RunTest displays broken output if jtreg fails completely
ihse
parents:
47253
diff
changeset
|
753 |
$$(eval $1_FAILED := 0) \ |
0b347d8efb40
8187672: RunTest displays broken output if jtreg fails completely
ihse
parents:
47253
diff
changeset
|
754 |
$$(eval $1_ERROR := 1) \ |
0b347d8efb40
8187672: RunTest displays broken output if jtreg fails completely
ihse
parents:
47253
diff
changeset
|
755 |
$$(eval $1_TOTAL := 1) \ |
0b347d8efb40
8187672: RunTest displays broken output if jtreg fails completely
ihse
parents:
47253
diff
changeset
|
756 |
) |
44027 | 757 |
|
758 |
$1: run-test-$1 parse-test-$1 |
|
759 |
||
760 |
TARGETS += $1 |
|
761 |
endef |
|
762 |
||
48061
665769d3cee4
8193014: Add "special" tests to run-test to cover odd cases
ihse
parents:
48058
diff
changeset
|
763 |
################################################################################ |
665769d3cee4
8193014: Add "special" tests to run-test to cover odd cases
ihse
parents:
48058
diff
changeset
|
764 |
|
665769d3cee4
8193014: Add "special" tests to run-test to cover odd cases
ihse
parents:
48058
diff
changeset
|
765 |
### Rules for special tests |
665769d3cee4
8193014: Add "special" tests to run-test to cover odd cases
ihse
parents:
48058
diff
changeset
|
766 |
|
665769d3cee4
8193014: Add "special" tests to run-test to cover odd cases
ihse
parents:
48058
diff
changeset
|
767 |
SetupRunSpecialTest = $(NamedParamsMacroTemplate) |
665769d3cee4
8193014: Add "special" tests to run-test to cover odd cases
ihse
parents:
48058
diff
changeset
|
768 |
define SetupRunSpecialTestBody |
665769d3cee4
8193014: Add "special" tests to run-test to cover odd cases
ihse
parents:
48058
diff
changeset
|
769 |
$1_TEST_RESULTS_DIR := $$(TEST_RESULTS_DIR)/$1 |
665769d3cee4
8193014: Add "special" tests to run-test to cover odd cases
ihse
parents:
48058
diff
changeset
|
770 |
$1_TEST_SUPPORT_DIR := $$(TEST_SUPPORT_DIR)/$1 |
665769d3cee4
8193014: Add "special" tests to run-test to cover odd cases
ihse
parents:
48058
diff
changeset
|
771 |
$1_EXITCODE := $$($1_TEST_RESULTS_DIR)/exitcode.txt |
665769d3cee4
8193014: Add "special" tests to run-test to cover odd cases
ihse
parents:
48058
diff
changeset
|
772 |
|
665769d3cee4
8193014: Add "special" tests to run-test to cover odd cases
ihse
parents:
48058
diff
changeset
|
773 |
$1_FULL_TEST_NAME := $$(strip $$(patsubst special:%, %, $$($1_TEST))) |
665769d3cee4
8193014: Add "special" tests to run-test to cover odd cases
ihse
parents:
48058
diff
changeset
|
774 |
ifneq ($$(findstring :, $$($1_FULL_TEST_NAME)), ) |
665769d3cee4
8193014: Add "special" tests to run-test to cover odd cases
ihse
parents:
48058
diff
changeset
|
775 |
$1_TEST_NAME := $$(firstword $$(subst :, ,$$($1_FULL_TEST_NAME))) |
665769d3cee4
8193014: Add "special" tests to run-test to cover odd cases
ihse
parents:
48058
diff
changeset
|
776 |
$1_TEST_ARGS := $$(strip $$(patsubst special:$$($1_TEST_NAME):%, %, $$($1_TEST))) |
665769d3cee4
8193014: Add "special" tests to run-test to cover odd cases
ihse
parents:
48058
diff
changeset
|
777 |
else |
665769d3cee4
8193014: Add "special" tests to run-test to cover odd cases
ihse
parents:
48058
diff
changeset
|
778 |
$1_TEST_NAME := $$($1_FULL_TEST_NAME) |
665769d3cee4
8193014: Add "special" tests to run-test to cover odd cases
ihse
parents:
48058
diff
changeset
|
779 |
$1_TEST_ARGS := |
665769d3cee4
8193014: Add "special" tests to run-test to cover odd cases
ihse
parents:
48058
diff
changeset
|
780 |
endif |
665769d3cee4
8193014: Add "special" tests to run-test to cover odd cases
ihse
parents:
48058
diff
changeset
|
781 |
|
52396
e292e94b448a
8213058: remove ExecuteInternalVMTests and VerboseInternalVMTests flags
iignatyev
parents:
52393
diff
changeset
|
782 |
ifeq ($$($1_TEST_NAME), failure-handler) |
52342 | 783 |
ifeq ($(BUILD_FAILURE_HANDLER), true) |
784 |
$1_TEST_COMMAND_LINE := \ |
|
785 |
($(CD) $(TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) -f \ |
|
786 |
BuildFailureHandler.gmk test) |
|
787 |
else |
|
788 |
$$(error Cannot test failure handler if it is not built) |
|
789 |
endif |
|
48061
665769d3cee4
8193014: Add "special" tests to run-test to cover odd cases
ihse
parents:
48058
diff
changeset
|
790 |
else ifeq ($$($1_TEST_NAME), make) |
665769d3cee4
8193014: Add "special" tests to run-test to cover odd cases
ihse
parents:
48058
diff
changeset
|
791 |
$1_TEST_COMMAND_LINE := \ |
665769d3cee4
8193014: Add "special" tests to run-test to cover odd cases
ihse
parents:
48058
diff
changeset
|
792 |
($(CD) $(TOPDIR)/test/make && $(MAKE) $(MAKE_ARGS) -f \ |
665769d3cee4
8193014: Add "special" tests to run-test to cover odd cases
ihse
parents:
48058
diff
changeset
|
793 |
TestMake.gmk $$($1_TEST_ARGS)) |
665769d3cee4
8193014: Add "special" tests to run-test to cover odd cases
ihse
parents:
48058
diff
changeset
|
794 |
else |
665769d3cee4
8193014: Add "special" tests to run-test to cover odd cases
ihse
parents:
48058
diff
changeset
|
795 |
$$(error Invalid special test specification: $$($1_TEST_NAME)) |
665769d3cee4
8193014: Add "special" tests to run-test to cover odd cases
ihse
parents:
48058
diff
changeset
|
796 |
endif |
665769d3cee4
8193014: Add "special" tests to run-test to cover odd cases
ihse
parents:
48058
diff
changeset
|
797 |
|
52125
28375a1de254
8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents:
51856
diff
changeset
|
798 |
run-test-$1: $(TEST_PREREQS) |
48061
665769d3cee4
8193014: Add "special" tests to run-test to cover odd cases
ihse
parents:
48058
diff
changeset
|
799 |
$$(call LogWarn) |
665769d3cee4
8193014: Add "special" tests to run-test to cover odd cases
ihse
parents:
48058
diff
changeset
|
800 |
$$(call LogWarn, Running test '$$($1_TEST)') |
665769d3cee4
8193014: Add "special" tests to run-test to cover odd cases
ihse
parents:
48058
diff
changeset
|
801 |
$$(call MakeDir, $$($1_TEST_RESULTS_DIR) $$($1_TEST_SUPPORT_DIR)) |
665769d3cee4
8193014: Add "special" tests to run-test to cover odd cases
ihse
parents:
48058
diff
changeset
|
802 |
$$(call ExecuteWithLog, $$($1_TEST_SUPPORT_DIR)/test-execution, \ |
665769d3cee4
8193014: Add "special" tests to run-test to cover odd cases
ihse
parents:
48058
diff
changeset
|
803 |
$$($1_TEST_COMMAND_LINE) \ |
665769d3cee4
8193014: Add "special" tests to run-test to cover odd cases
ihse
parents:
48058
diff
changeset
|
804 |
> >($(TEE) $$($1_TEST_RESULTS_DIR)/test-output.txt) \ |
665769d3cee4
8193014: Add "special" tests to run-test to cover odd cases
ihse
parents:
48058
diff
changeset
|
805 |
&& $$(ECHO) $$$$? > $$($1_EXITCODE) \ |
665769d3cee4
8193014: Add "special" tests to run-test to cover odd cases
ihse
parents:
48058
diff
changeset
|
806 |
|| $$(ECHO) $$$$? > $$($1_EXITCODE) \ |
665769d3cee4
8193014: Add "special" tests to run-test to cover odd cases
ihse
parents:
48058
diff
changeset
|
807 |
) |
665769d3cee4
8193014: Add "special" tests to run-test to cover odd cases
ihse
parents:
48058
diff
changeset
|
808 |
|
665769d3cee4
8193014: Add "special" tests to run-test to cover odd cases
ihse
parents:
48058
diff
changeset
|
809 |
$1_RESULT_FILE := $$($1_TEST_RESULTS_DIR)/gtest.txt |
665769d3cee4
8193014: Add "special" tests to run-test to cover odd cases
ihse
parents:
48058
diff
changeset
|
810 |
|
665769d3cee4
8193014: Add "special" tests to run-test to cover odd cases
ihse
parents:
48058
diff
changeset
|
811 |
# We can not parse the various "special" tests. |
665769d3cee4
8193014: Add "special" tests to run-test to cover odd cases
ihse
parents:
48058
diff
changeset
|
812 |
parse-test-$1: run-test-$1 |
665769d3cee4
8193014: Add "special" tests to run-test to cover odd cases
ihse
parents:
48058
diff
changeset
|
813 |
$$(call LogWarn, Finished running test '$$($1_TEST)') |
665769d3cee4
8193014: Add "special" tests to run-test to cover odd cases
ihse
parents:
48058
diff
changeset
|
814 |
$$(call LogWarn, Test report is stored in $$(strip \ |
665769d3cee4
8193014: Add "special" tests to run-test to cover odd cases
ihse
parents:
48058
diff
changeset
|
815 |
$$(subst $$(TOPDIR)/, , $$($1_TEST_RESULTS_DIR)))) |
665769d3cee4
8193014: Add "special" tests to run-test to cover odd cases
ihse
parents:
48058
diff
changeset
|
816 |
$$(call LogWarn, Warning: Special test results are not properly parsed!) |
665769d3cee4
8193014: Add "special" tests to run-test to cover odd cases
ihse
parents:
48058
diff
changeset
|
817 |
$$(eval $1_PASSED := 0) |
665769d3cee4
8193014: Add "special" tests to run-test to cover odd cases
ihse
parents:
48058
diff
changeset
|
818 |
$$(eval $1_FAILED := 0) |
665769d3cee4
8193014: Add "special" tests to run-test to cover odd cases
ihse
parents:
48058
diff
changeset
|
819 |
$$(eval $1_ERROR := 0) |
665769d3cee4
8193014: Add "special" tests to run-test to cover odd cases
ihse
parents:
48058
diff
changeset
|
820 |
$$(eval $1_TOTAL := 0) |
665769d3cee4
8193014: Add "special" tests to run-test to cover odd cases
ihse
parents:
48058
diff
changeset
|
821 |
|
665769d3cee4
8193014: Add "special" tests to run-test to cover odd cases
ihse
parents:
48058
diff
changeset
|
822 |
$1: run-test-$1 parse-test-$1 |
665769d3cee4
8193014: Add "special" tests to run-test to cover odd cases
ihse
parents:
48058
diff
changeset
|
823 |
|
665769d3cee4
8193014: Add "special" tests to run-test to cover odd cases
ihse
parents:
48058
diff
changeset
|
824 |
TARGETS += $1 |
665769d3cee4
8193014: Add "special" tests to run-test to cover odd cases
ihse
parents:
48058
diff
changeset
|
825 |
endef |
44027 | 826 |
|
827 |
################################################################################ |
|
828 |
# Setup and execute make rules for all selected tests |
|
829 |
################################################################################ |
|
830 |
||
831 |
# Helper function to determine which handler to use for the given test |
|
832 |
UseGtestTestHandler = \ |
|
833 |
$(if $(filter gtest:%, $1), true) |
|
834 |
||
835 |
UseJtregTestHandler = \ |
|
836 |
$(if $(filter jtreg:%, $1), true) |
|
837 |
||
48061
665769d3cee4
8193014: Add "special" tests to run-test to cover odd cases
ihse
parents:
48058
diff
changeset
|
838 |
UseSpecialTestHandler = \ |
665769d3cee4
8193014: Add "special" tests to run-test to cover odd cases
ihse
parents:
48058
diff
changeset
|
839 |
$(if $(filter special:%, $1), true) |
665769d3cee4
8193014: Add "special" tests to run-test to cover odd cases
ihse
parents:
48058
diff
changeset
|
840 |
|
44027 | 841 |
# Now process each test to run and setup a proper make rule |
842 |
$(foreach test, $(TESTS_TO_RUN), \ |
|
843 |
$(eval TEST_ID := $(shell $(ECHO) $(strip $(test)) | \ |
|
48042 | 844 |
$(TR) -cs '[a-z][A-Z][0-9]\n' '[_*1000]')) \ |
44027 | 845 |
$(eval ALL_TEST_IDS += $(TEST_ID)) \ |
846 |
$(if $(call UseCustomTestHandler, $(test)), \ |
|
847 |
$(eval $(call SetupRunCustomTest, $(TEST_ID), \ |
|
848 |
TEST := $(test), \ |
|
849 |
)) \ |
|
850 |
) \ |
|
851 |
$(if $(call UseGtestTestHandler, $(test)), \ |
|
852 |
$(eval $(call SetupRunGtestTest, $(TEST_ID), \ |
|
853 |
TEST := $(test), \ |
|
854 |
)) \ |
|
855 |
) \ |
|
856 |
$(if $(call UseJtregTestHandler, $(test)), \ |
|
857 |
$(eval $(call SetupRunJtregTest, $(TEST_ID), \ |
|
858 |
TEST := $(test), \ |
|
859 |
)) \ |
|
860 |
) \ |
|
48061
665769d3cee4
8193014: Add "special" tests to run-test to cover odd cases
ihse
parents:
48058
diff
changeset
|
861 |
$(if $(call UseSpecialTestHandler, $(test)), \ |
665769d3cee4
8193014: Add "special" tests to run-test to cover odd cases
ihse
parents:
48058
diff
changeset
|
862 |
$(eval $(call SetupRunSpecialTest, $(TEST_ID), \ |
665769d3cee4
8193014: Add "special" tests to run-test to cover odd cases
ihse
parents:
48058
diff
changeset
|
863 |
TEST := $(test), \ |
665769d3cee4
8193014: Add "special" tests to run-test to cover odd cases
ihse
parents:
48058
diff
changeset
|
864 |
)) \ |
665769d3cee4
8193014: Add "special" tests to run-test to cover odd cases
ihse
parents:
48058
diff
changeset
|
865 |
) \ |
44027 | 866 |
) |
867 |
||
868 |
# Sort also removes duplicates, so if there is any we'll get fewer words. |
|
869 |
ifneq ($(words $(ALL_TEST_IDS)), $(words $(sort $(ALL_TEST_IDS)))) |
|
870 |
$(error Duplicate test specification) |
|
871 |
endif |
|
872 |
||
873 |
||
874 |
################################################################################ |
|
875 |
# The main target for RunTests.gmk |
|
876 |
################################################################################ |
|
877 |
||
878 |
# The SetupRun*Test functions have populated TARGETS. |
|
879 |
||
880 |
TEST_FAILURE := false |
|
881 |
||
882 |
run-test: $(TARGETS) |
|
47943 | 883 |
# Create and print a table of the result of all tests run |
884 |
$(RM) $(TEST_SUMMARY).old 2> /dev/null |
|
885 |
$(MV) $(TEST_SUMMARY) $(TEST_SUMMARY).old 2> /dev/null || true |
|
48042 | 886 |
$(RM) $(TEST_LAST_IDS).old 2> /dev/null |
887 |
$(MV) $(TEST_LAST_IDS) $(TEST_LAST_IDS).old 2> /dev/null || true |
|
47943 | 888 |
$(ECHO) >> $(TEST_SUMMARY) ============================== |
889 |
$(ECHO) >> $(TEST_SUMMARY) Test summary |
|
890 |
$(ECHO) >> $(TEST_SUMMARY) ============================== |
|
891 |
$(PRINTF) >> $(TEST_SUMMARY) "%2s %-49s %5s %5s %5s %5s %2s\n" " " \ |
|
892 |
TEST TOTAL PASS FAIL ERROR " " |
|
44027 | 893 |
$(foreach test, $(TESTS_TO_RUN), \ |
894 |
$(eval TEST_ID := $(shell $(ECHO) $(strip $(test)) | \ |
|
48042 | 895 |
$(TR) -cs '[a-z][A-Z][0-9]\n' '[_*1000]')) \ |
896 |
$(ECHO) >> $(TEST_LAST_IDS) $(TEST_ID) $(NEWLINE) \ |
|
897 |
$(eval NAME_PATTERN := $(shell $(ECHO) $(test) | $(TR) -c '\n' '[_*1000]')) \ |
|
47937
c1437939b0d8
8177957: run-test summary lines look bad/misleading with long test names
ihse
parents:
47932
diff
changeset
|
898 |
$(if $(filter __________________________________________________%, $(NAME_PATTERN)), \ |
c1437939b0d8
8177957: run-test summary lines look bad/misleading with long test names
ihse
parents:
47932
diff
changeset
|
899 |
$(eval TEST_NAME := ) \ |
47943 | 900 |
$(PRINTF) >> $(TEST_SUMMARY) "%2s %-49s\n" " " "$(test)" $(NEWLINE) \ |
47937
c1437939b0d8
8177957: run-test summary lines look bad/misleading with long test names
ihse
parents:
47932
diff
changeset
|
901 |
, \ |
c1437939b0d8
8177957: run-test summary lines look bad/misleading with long test names
ihse
parents:
47932
diff
changeset
|
902 |
$(eval TEST_NAME := $(test)) \ |
c1437939b0d8
8177957: run-test summary lines look bad/misleading with long test names
ihse
parents:
47932
diff
changeset
|
903 |
) \ |
44027 | 904 |
$(if $(filter $($(TEST_ID)_PASSED), $($(TEST_ID)_TOTAL)), \ |
47943 | 905 |
$(PRINTF) >> $(TEST_SUMMARY) "%2s %-49s %5d %5d %5d %5d %2s\n" \ |
906 |
" " "$(TEST_NAME)" $($(TEST_ID)_TOTAL) $($(TEST_ID)_PASSED) \ |
|
907 |
$($(TEST_ID)_FAILED) $($(TEST_ID)_ERROR) " " $(NEWLINE) \ |
|
44027 | 908 |
, \ |
47943 | 909 |
$(PRINTF) >> $(TEST_SUMMARY) "%2s %-49s %5d %5d %5d %5d %2s\n" \ |
910 |
">>" "$(TEST_NAME)" $($(TEST_ID)_TOTAL) $($(TEST_ID)_PASSED) \ |
|
911 |
$($(TEST_ID)_FAILED) $($(TEST_ID)_ERROR) "<<" $(NEWLINE) \ |
|
44027 | 912 |
$(eval TEST_FAILURE := true) \ |
913 |
) \ |
|
914 |
) |
|
47943 | 915 |
$(ECHO) >> $(TEST_SUMMARY) ============================== |
44027 | 916 |
$(if $(filter true, $(TEST_FAILURE)), \ |
47943 | 917 |
$(ECHO) >> $(TEST_SUMMARY) TEST FAILURE $(NEWLINE) \ |
918 |
$(MKDIR) -p $(MAKESUPPORT_OUTPUTDIR) $(NEWLINE) \ |
|
44027 | 919 |
$(TOUCH) $(MAKESUPPORT_OUTPUTDIR)/exit-with-error \ |
920 |
, \ |
|
47943 | 921 |
$(ECHO) >> $(TEST_SUMMARY) TEST SUCCESS \ |
44027 | 922 |
) |
923 |
$(ECHO) |
|
47943 | 924 |
$(CAT) $(TEST_SUMMARY) |
925 |
$(ECHO) |
|
44027 | 926 |
|
927 |
################################################################################ |
|
928 |
||
929 |
all: run-test |
|
930 |
||
931 |
.PHONY: default all run-test $(TARGETS) |