author | bpatel |
Fri, 19 Aug 2016 12:54:02 -0700 | |
changeset 40511 | 1b3c502e0bdc |
parent 37015 | 150bc828e27c |
child 42009 | 86b8dcbbe5a4 |
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}" |
|
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 \ |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
97 |
-od:"${TARGET_JAR}" \ |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
98 |
-o:jdk.test.failurehandler.jtreg.GatherDiagnosticInfoObserver \ |
37015 | 99 |
-w:"${RUN_DIR}/JTwork" \ |
100 |
-r:"${RUN_DIR}/JTreport" \ |
|
35016
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
101 |
$(if ${JTREG_TESTS}, ${JTREG_TESTS}, test) \ |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
102 |
&& false || true |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
103 |
|
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
104 |
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
|
105 |
debug: test |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
106 |
|
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
107 |
require_env: |
37015 | 108 |
$(call check_defined, JAVA_HOME) |
109 |
$(call check_defined, JTREG_HOME) |
|
35016
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
110 |
|
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
111 |
clean: |
37015 | 112 |
rm -rf "${BUILD_DIR}" "${RUN_DIR}" |
35016
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
113 |
|
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
114 |
build: classes native |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
115 |
|
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
116 |
.PHONY: all build classes native test require_env clean |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
117 |
.DEFAULT: all |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
118 |