author | bharadwaj |
Thu, 21 Apr 2016 15:04:00 -0400 | |
changeset 38338 | f3909e996a6a |
parent 35016 | b509dfa96469 |
child 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 |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
32 |
|
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}") |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
50 |
IMAGE_DIR := $(shell cygpath -m "${IMAGE_DIR}") RUN_DIR := $(shell cygpath -m "${RUN_DIR}") |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
51 |
SRC_DIR := $(shell cygpath -m "${SRC_DIR}") |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
52 |
JTREG_HOME := $(shell cygpath -m "${JTREG_HOME}") |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
53 |
CC := "cl.exe" |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
54 |
endif |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
55 |
|
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
56 |
all: clean test |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
57 |
|
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
58 |
native: require_env |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
59 |
ifeq ("${OS_NAME}", "Cygwin") |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
60 |
"${CC}" src/windows/native/jdk/test/failurehandler/jtreg/*.c \ |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
61 |
-I"$(shell cygpath -w ${JAVA_HOME}/include)" \ |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
62 |
-I"$(shell cygpath -w ${JAVA_HOME}/include/win32)" \ |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
63 |
/link /MACHINE:X64 /DLL /OUT:timeoutHandler.dll |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
64 |
endif |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
65 |
|
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
66 |
check_defined = $(foreach 1,$1,$(__check_defined)) |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
67 |
__check_defined = $(if $(value $1),, $(error $1 is not set)) |
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 |
classes: require_env |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
70 |
mkdir -p ${IMAGE_DIR}/bin ${IMAGE_DIR}/lib ${CLASSES_DIR} |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
71 |
"${JAVA_HOME}"/bin/javac -target ${JAVA_RELEASE} -source ${JAVA_RELEASE} \ |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
72 |
-sourcepath $(shell pwd) \ |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
73 |
-classpath ${JTREG_HOME}/lib/jtreg.jar:${JAVA_HOME}/lib/tools.jar \ |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
74 |
-d ${CLASSES_DIR} \ |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
75 |
${SOURCES} |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
76 |
"${JAVA_HOME}"/bin/jar cf ${TARGET_JAR} -C ${CLASSES_DIR} . |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
77 |
"${JAVA_HOME}"/bin/jar uf ${TARGET_JAR} -C ${CONF_DIR} . |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
78 |
|
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
79 |
# |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
80 |
# Use JTREG_TEST_OPTS for test VM options |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
81 |
# Use JTREG_TESTS for jtreg tests parameter |
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 |
test: require_env build |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
84 |
rm -rf ${RUN_DIR} |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
85 |
mkdir -p ${RUN_DIR} |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
86 |
"${JTREG_HOME}"/bin/jtreg \ |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
87 |
-jdk:"${JAVA_HOME}" \ |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
88 |
${JTREG_TEST_OPTS} \ |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
89 |
-timeout:0.1 -va -retain:all \ |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
90 |
-noreport \ |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
91 |
-agentvm \ |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
92 |
-thd:"${TARGET_JAR}" \ |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
93 |
-th:jdk.test.failurehandler.jtreg.GatherProcessInfoTimeoutHandler \ |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
94 |
-od:"${TARGET_JAR}" \ |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
95 |
-o:jdk.test.failurehandler.jtreg.GatherDiagnosticInfoObserver \ |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
96 |
-w:${RUN_DIR}/JTwork -r:${RUN_DIR}/JTreport \ |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
97 |
$(if ${JTREG_TESTS}, ${JTREG_TESTS}, test) \ |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
98 |
&& false || true |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
99 |
|
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
100 |
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
|
101 |
debug: test |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
102 |
|
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
103 |
require_env: |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
104 |
$(call check_defined, JAVA_HOME) |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
105 |
$(call check_defined, JTREG_HOME) |
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 |
clean: |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
108 |
rm -rf "${BUILD_DIR}" "${RUN_DIR}" |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
109 |
|
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
110 |
build: classes native |
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 |
.PHONY: all build classes native test require_env clean |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
113 |
.DEFAULT: all |
b509dfa96469
8132961: JEP 279: Improve Test-Failure Troubleshooting
iignatyev
parents:
diff
changeset
|
114 |