jdk

Форк
0
/
BuildFailureHandler.gmk 
113 строк · 3.9 Кб
1
#
2
# Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
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: build
27

28
include $(SPEC)
29
include MakeBase.gmk
30

31
include CopyFiles.gmk
32
include JavaCompilation.gmk
33

34
TARGETS :=
35

36
################################################################################
37

38
FH_BASEDIR := $(TOPDIR)/test/failure_handler
39
FH_SUPPORT := $(SUPPORT_OUTPUTDIR)/test/failure_handler
40
FH_JAR := $(FH_SUPPORT)/jtregFailureHandler.jar
41

42
JTREG_JAR := $(JT_HOME)/lib/jtreg.jar
43
ifeq ($(wildcard $(JTREG_JAR)), )
44
  $(error Cannot build failure handler without jtreg)
45
endif
46
# tools.jar is only needed if it exists in the boot jdk
47
TOOLS_JAR := $(wildcard $(BOOT_JDK)/lib/tools.jar)
48

49
FH_CLASSPATH := $(call PathList, $(JTREG_JAR) $(TOOLS_JAR))
50

51
$(eval $(call SetupJavaCompilation, BUILD_FAILURE_HANDLER, \
52
    TARGET_RELEASE := $(TARGET_RELEASE_BOOTJDK), \
53
    SRC := $(FH_BASEDIR)/src/share/classes $(FH_BASEDIR)/src/share/conf, \
54
    BIN := $(FH_SUPPORT)/classes, \
55
    DISABLED_WARNINGS := options serial try this-escape, \
56
    COPY := .properties, \
57
    CLASSPATH := $(JTREG_JAR) $(TOOLS_JAR), \
58
    JAR := $(FH_JAR), \
59
    JAVAC_FLAGS := -XDstringConcat=inline, \
60
))
61

62
TARGETS += $(BUILD_FAILURE_HANDLER)
63

64
################################################################################
65
# Targets for building test-image.
66
################################################################################
67

68
# Copy to hotspot jtreg test image
69
$(eval $(call SetupCopyFiles, COPY_FH, \
70
    SRC := $(FH_SUPPORT), \
71
    DEST := $(TEST_IMAGE_DIR)/failure_handler, \
72
    FILES := $(FH_JAR) $(BUILD_LIBTIMEOUT_HANDLER), \
73
))
74

75
IMAGES_TARGETS += $(COPY_FH)
76

77
################################################################################
78
# Test the failure handler itself
79
################################################################################
80
#
81
# Use JTREG_TEST_OPTS for test VM options
82
# Use JTREG_TESTS for jtreg tests parameter
83
#
84
# Most likely you want to select a specific test from test/failure_handler/test
85
# and manually inspect the results. This target does not actually verify
86
# anything about the failure_handler's output or even if it ran at all.
87
#
88
RUN_DIR := $(FH_SUPPORT)/test
89

90
test:
91
	$(RM) -r $(RUN_DIR)
92
	$(MKDIR) -p $(RUN_DIR)
93
	$(CD) $(FH_BASEDIR)/test && $(JAVA) -Dprogram=jtreg \
94
	    -jar $(JT_HOME)/lib/jtreg.jar \
95
	    -jdk:$(BOOT_JDK) \
96
	    $(JTREG_TEST_OPTS) \
97
	    -timeout:0.1 -va -retain:all \
98
	    -noreport \
99
	    -agentvm \
100
	    -thd:$(FH_JAR) \
101
	    -th:jdk.test.failurehandler.jtreg.GatherProcessInfoTimeoutHandler \
102
	    -od:$(FH_JAR) \
103
	    -o:jdk.test.failurehandler.jtreg.GatherDiagnosticInfoObserver \
104
	    -w:$(RUN_DIR)/JTwork -r:$(RUN_DIR)/JTreport \
105
	    $(if $(JTREG_TESTS), $(JTREG_TESTS), .) \
106
	    || true
107

108
################################################################################
109

110
build: $(TARGETS)
111
images: $(IMAGES_TARGETS)
112

113
.PHONY: all images test
114

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.