author | sla |
Mon, 24 Oct 2016 09:12:40 +0200 | |
changeset 42009 | 86b8dcbbe5a4 |
parent 37015 | 150bc828e27c |
permissions | -rw-r--r-- |
35016
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
1 |
# |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
2 |
# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
3 |
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
4 |
# |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
5 |
# This code is free software; you can redistribute it and/or modify it |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
6 |
# under the terms of the GNU General Public License version 2 only, as |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
7 |
# published by the Free Software Foundation. |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
8 |
# |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
9 |
# This code is distributed in the hope that it will be useful, but WITHOUT |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
10 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
11 |
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
12 |
# version 2 for more details (a copy is included in the LICENSE file that |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
13 |
# accompanied this code). |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
14 |
# |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
15 |
# You should have received a copy of the GNU General Public License version |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
16 |
# 2 along with this work; if not, write to the Free Software Foundation, |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
17 |
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
18 |
# |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
19 |
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
20 |
# or visit www.oracle.com if you need additional information or have any |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
21 |
# questions. |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
22 |
# |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
23 |
|
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
24 |
# |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
25 |
# This is a temporary standalone makefile |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
26 |
# |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
27 |
|
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
28 |
BUILD_DIR := $(shell pwd)/build |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
29 |
CLASSES_DIR := ${BUILD_DIR}/classes |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
30 |
IMAGE_DIR := ${BUILD_DIR}/image |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
31 |
RUN_DIR := $(shell pwd)/run |
37015 | 32 |
CLASSPATH := ${JTREG_HOME}/lib/jtreg.jar:${JAVA_HOME}/lib/tools.jar |
35016
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
33 |
SRC_DIR := src/share/classes/ |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
34 |
SOURCES := ${SRC_DIR}/jdk/test/failurehandler/*.java \ |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
35 |
${SRC_DIR}/jdk/test/failurehandler/action/*.java \ |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
36 |
${SRC_DIR}/jdk/test/failurehandler/jtreg/*.java \ |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
37 |
${SRC_DIR}/jdk/test/failurehandler/value/*.java |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
38 |
|
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
39 |
CONF_DIR = src/share/conf |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
40 |
|
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
41 |
JAVA_RELEASE = 7 |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
42 |
|
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
43 |
TARGET_JAR = ${IMAGE_DIR}/lib/jtregFailureHandler.jar |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
44 |
|
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
45 |
OS_NAME := $(shell uname -o 2>&1) |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
46 |
|
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
47 |
ifeq ("${OS_NAME}", "Cygwin") |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
48 |
BUILD_DIR := $(shell cygpath -m "${BUILD_DIR}") |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
49 |
CLASSES_DIR := $(shell cygpath -m "${CLASSES_DIR}") |
37015 | 50 |
IMAGE_DIR := $(shell cygpath -m "${IMAGE_DIR}") |
51 |
RUN_DIR := $(shell cygpath -m "${RUN_DIR}") |
|
35016
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
52 |
SRC_DIR := $(shell cygpath -m "${SRC_DIR}") |
37015 | 53 |
JAVA_HOME := $(shell cygpath -m "${JAVA_HOME}") |
35016
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
54 |
JTREG_HOME := $(shell cygpath -m "${JTREG_HOME}") |
37015 | 55 |
CLASSPATH := $(shell cygpath -pm "${CLASSPATH}") |
35016
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
56 |
CC := "cl.exe" |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
57 |
endif |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
58 |
|
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
59 |
all: clean test |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
60 |
|
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
61 |
native: require_env |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
62 |
ifeq ("${OS_NAME}", "Cygwin") |
37015 | 63 |
"${CC}" src/windows/native/jdk/test/failurehandler/jtreg/*.c \ |
64 |
-I"$(shell cygpath -w "${JAVA_HOME}/include")" \ |
|
65 |
-I"$(shell cygpath -w "${JAVA_HOME}/include/win32")" \ |
|
66 |
/link /DLL /OUT:timeoutHandler.dll |
|
35016
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
67 |
endif |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
68 |
|
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
69 |
check_defined = $(foreach 1,$1,$(__check_defined)) |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
70 |
__check_defined = $(if $(value $1),, $(error $1 is not set)) |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
71 |
|
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
72 |
classes: require_env |
37015 | 73 |
mkdir -p ${IMAGE_DIR}/bin ${IMAGE_DIR}/lib ${CLASSES_DIR} |
74 |
"${JAVA_HOME}"/bin/javac -target ${JAVA_RELEASE} -source ${JAVA_RELEASE} \ |
|
75 |
-sourcepath "$(shell pwd)" \ |
|
76 |
-cp "${CLASSPATH}" \ |
|
77 |
-d ${CLASSES_DIR} \ |
|
35016
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
78 |
${SOURCES} |
37015 | 79 |
"${JAVA_HOME}"/bin/jar cf "${TARGET_JAR}" -C "${CLASSES_DIR}" . |
80 |
"${JAVA_HOME}"/bin/jar uf "${TARGET_JAR}" -C "${CONF_DIR}" . |
|
35016
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
81 |
|
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
82 |
# |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
83 |
# Use JTREG_TEST_OPTS for test VM options |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
84 |
# Use JTREG_TESTS for jtreg tests parameter |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
85 |
# |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
86 |
test: require_env build |
37015 | 87 |
rm -rf "${RUN_DIR}" |
88 |
mkdir -p "${RUN_DIR}" |
|
42009 | 89 |
"${JTREG_HOME}"/bin/jtreg \ |
35016
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
90 |
-jdk:"${JAVA_HOME}" \ |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
91 |
${JTREG_TEST_OPTS} \ |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
92 |
-timeout:0.1 -va -retain:all \ |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
93 |
-noreport \ |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
94 |
-agentvm \ |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
95 |
-thd:"${TARGET_JAR}" \ |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
96 |
-th:jdk.test.failurehandler.jtreg.GatherProcessInfoTimeoutHandler \ |
42009 | 97 |
-thtimeout:0 \ |
35016
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
98 |
-od:"${TARGET_JAR}" \ |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
99 |
-o:jdk.test.failurehandler.jtreg.GatherDiagnosticInfoObserver \ |
37015 | 100 |
-w:"${RUN_DIR}/JTwork" \ |
101 |
-r:"${RUN_DIR}/JTreport" \ |
|
35016
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
102 |
$(if ${JTREG_TESTS}, ${JTREG_TESTS}, test) \ |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
103 |
&& false || true |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
104 |
|
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
105 |
debug: JTREG_TEST_OPTS += "-J-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005'" |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
106 |
debug: test |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
107 |
|
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
108 |
require_env: |
37015 | 109 |
$(call check_defined, JAVA_HOME) |
110 |
$(call check_defined, JTREG_HOME) |
|
35016
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
111 |
|
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
112 |
clean: |
37015 | 113 |
rm -rf "${BUILD_DIR}" "${RUN_DIR}" |
35016
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
114 |
|
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
115 |
build: classes native |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
116 |
|
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
117 |
.PHONY: all build classes native test require_env clean |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
118 |
.DEFAULT: all |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
119 |