--- a/test/failure_handler/Makefile Tue Mar 22 17:02:40 2016 +0000
+++ b/test/failure_handler/Makefile Wed Mar 23 20:12:31 2016 +0100
@@ -29,7 +29,7 @@
CLASSES_DIR := ${BUILD_DIR}/classes
IMAGE_DIR := ${BUILD_DIR}/image
RUN_DIR := $(shell pwd)/run
-
+CLASSPATH := ${JTREG_HOME}/lib/jtreg.jar:${JAVA_HOME}/lib/tools.jar
SRC_DIR := src/share/classes/
SOURCES := ${SRC_DIR}/jdk/test/failurehandler/*.java \
${SRC_DIR}/jdk/test/failurehandler/action/*.java \
@@ -47,9 +47,12 @@
ifeq ("${OS_NAME}", "Cygwin")
BUILD_DIR := $(shell cygpath -m "${BUILD_DIR}")
CLASSES_DIR := $(shell cygpath -m "${CLASSES_DIR}")
-IMAGE_DIR := $(shell cygpath -m "${IMAGE_DIR}") RUN_DIR := $(shell cygpath -m "${RUN_DIR}")
+IMAGE_DIR := $(shell cygpath -m "${IMAGE_DIR}")
+RUN_DIR := $(shell cygpath -m "${RUN_DIR}")
SRC_DIR := $(shell cygpath -m "${SRC_DIR}")
+JAVA_HOME := $(shell cygpath -m "${JAVA_HOME}")
JTREG_HOME := $(shell cygpath -m "${JTREG_HOME}")
+CLASSPATH := $(shell cygpath -pm "${CLASSPATH}")
CC := "cl.exe"
endif
@@ -57,33 +60,33 @@
native: require_env
ifeq ("${OS_NAME}", "Cygwin")
- "${CC}" src/windows/native/jdk/test/failurehandler/jtreg/*.c \
- -I"$(shell cygpath -w ${JAVA_HOME}/include)" \
- -I"$(shell cygpath -w ${JAVA_HOME}/include/win32)" \
- /link /MACHINE:X64 /DLL /OUT:timeoutHandler.dll
+ "${CC}" src/windows/native/jdk/test/failurehandler/jtreg/*.c \
+ -I"$(shell cygpath -w "${JAVA_HOME}/include")" \
+ -I"$(shell cygpath -w "${JAVA_HOME}/include/win32")" \
+ /link /DLL /OUT:timeoutHandler.dll
endif
check_defined = $(foreach 1,$1,$(__check_defined))
__check_defined = $(if $(value $1),, $(error $1 is not set))
classes: require_env
- mkdir -p ${IMAGE_DIR}/bin ${IMAGE_DIR}/lib ${CLASSES_DIR}
- "${JAVA_HOME}"/bin/javac -target ${JAVA_RELEASE} -source ${JAVA_RELEASE} \
- -sourcepath $(shell pwd) \
- -classpath ${JTREG_HOME}/lib/jtreg.jar:${JAVA_HOME}/lib/tools.jar \
- -d ${CLASSES_DIR} \
+ mkdir -p ${IMAGE_DIR}/bin ${IMAGE_DIR}/lib ${CLASSES_DIR}
+ "${JAVA_HOME}"/bin/javac -target ${JAVA_RELEASE} -source ${JAVA_RELEASE} \
+ -sourcepath "$(shell pwd)" \
+ -cp "${CLASSPATH}" \
+ -d ${CLASSES_DIR} \
${SOURCES}
- "${JAVA_HOME}"/bin/jar cf ${TARGET_JAR} -C ${CLASSES_DIR} .
- "${JAVA_HOME}"/bin/jar uf ${TARGET_JAR} -C ${CONF_DIR} .
+ "${JAVA_HOME}"/bin/jar cf "${TARGET_JAR}" -C "${CLASSES_DIR}" .
+ "${JAVA_HOME}"/bin/jar uf "${TARGET_JAR}" -C "${CONF_DIR}" .
#
# Use JTREG_TEST_OPTS for test VM options
# Use JTREG_TESTS for jtreg tests parameter
#
test: require_env build
- rm -rf ${RUN_DIR}
- mkdir -p ${RUN_DIR}
- "${JTREG_HOME}"/bin/jtreg \
+ rm -rf "${RUN_DIR}"
+ mkdir -p "${RUN_DIR}"
+ "${JTREG_HOME}"/bin/jtreg \
-jdk:"${JAVA_HOME}" \
${JTREG_TEST_OPTS} \
-timeout:0.1 -va -retain:all \
@@ -93,7 +96,8 @@
-th:jdk.test.failurehandler.jtreg.GatherProcessInfoTimeoutHandler \
-od:"${TARGET_JAR}" \
-o:jdk.test.failurehandler.jtreg.GatherDiagnosticInfoObserver \
- -w:${RUN_DIR}/JTwork -r:${RUN_DIR}/JTreport \
+ -w:"${RUN_DIR}/JTwork" \
+ -r:"${RUN_DIR}/JTreport" \
$(if ${JTREG_TESTS}, ${JTREG_TESTS}, test) \
&& false || true
@@ -101,11 +105,11 @@
debug: test
require_env:
- $(call check_defined, JAVA_HOME)
- $(call check_defined, JTREG_HOME)
+ $(call check_defined, JAVA_HOME)
+ $(call check_defined, JTREG_HOME)
clean:
- rm -rf "${BUILD_DIR}" "${RUN_DIR}"
+ rm -rf "${BUILD_DIR}" "${RUN_DIR}"
build: classes native
--- a/test/failure_handler/src/share/classes/jdk/test/failurehandler/jtreg/GatherProcessInfoTimeoutHandler.java Tue Mar 22 17:02:40 2016 +0000
+++ b/test/failure_handler/src/share/classes/jdk/test/failurehandler/jtreg/GatherProcessInfoTimeoutHandler.java Wed Mar 23 20:12:31 2016 +0100
@@ -39,12 +39,16 @@
* process and its children.
*/
public class GatherProcessInfoTimeoutHandler extends TimeoutHandler {
+ private static final boolean HAS_NATIVE_LIBRARY;
static {
+ boolean value = true;
try {
System.loadLibrary("timeoutHandler");
} catch (UnsatisfiedLinkError ignore) {
// not all os need timeoutHandler native-library
+ value = false;
}
+ HAS_NATIVE_LIBRARY = value;
}
private static final String LOG_FILENAME = "processes.log";
private static final String OUTPUT_FILENAME = "processes.html";
@@ -105,7 +109,7 @@
if (result == 0L) {
/* jtreg didn't find pid, most probably we are on JDK < 9
there is no Process::getPid */
- if ("windows".equals(OS.current().family)) {
+ if (HAS_NATIVE_LIBRARY && "windows".equals(OS.current().family)) {
try {
Field field = process.getClass().getDeclaredField("handle");
boolean old = field.isAccessible();
--- a/test/failure_handler/test/sanity/Suicide.java Tue Mar 22 17:02:40 2016 +0000
+++ b/test/failure_handler/test/sanity/Suicide.java Wed Mar 23 20:12:31 2016 +0100
@@ -28,7 +28,7 @@
/*
* @test
* @summary Suicide test
- * @run main/othervm Crash
+ * @run main/othervm Suicide
*/
public class Suicide {
public static void main(String[] args) {