8149777: Enable enhanced failure handler for "make test"
authorerikj
Thu, 14 Apr 2016 15:13:42 +0200
changeset 37356 6e2cd4a6bc18
parent 37355 5ab49ea6e03a
child 37357 b4ec5a9e18ac
8149777: Enable enhanced failure handler for "make test" Reviewed-by: ihse
jdk/test/Makefile
--- a/jdk/test/Makefile	Thu Apr 14 14:51:11 2016 +0200
+++ b/jdk/test/Makefile	Thu Apr 14 15:13:42 2016 +0200
@@ -125,6 +125,24 @@
   JTREG_NATIVE_PATH = -nativepath:$(shell $(GETMIXEDPATH) "$(TESTNATIVE_DIR)/jdk/jtreg/native")
 endif
 
+# jtreg failure handler config
+ifeq ($(FAILURE_HANDLER_DIR), )
+  ifneq ($(TESTNATIVE_DIR), )
+    FAILURE_HANDLER_DIR := $(TESTNATIVE_DIR)/failure_handler
+  endif
+endif
+ifneq ($(FAILURE_HANDLER_DIR), )
+  FAILURE_HANDLER_DIR_MIXED := $(shell $(GETMIXEDPATH) "$(FAILURE_HANDLER_DIR)")
+  JTREG_FAILURE_HANDLER_OPTIONS := \
+      -timeoutHandlerDir:$(FAILURE_HANDLER_DIR_MIXED)/jtregFailureHandler.jar \
+      -observerDir:$(FAILURE_HANDLER_DIR_MIXED)/jtregFailureHandler.jar \
+      -timeoutHandler:jdk.test.failurehandler.jtreg.GatherProcessInfoTimeoutHandler \
+      -observer:jdk.test.failurehandler.jtreg.GatherDiagnosticInfoObserver
+  ifeq ($(UNAME_S), CYGWIN)
+    JTREG_FAILURE_HANDLER_OPTIONS += -J-Djava.library.path="$(FAILURE_HANDLER_DIR_MIXED)"
+  endif
+endif
+
 # Expect JPRT to set JPRT_ARCHIVE_BUNDLE (path to zip bundle for results)
 ifdef JPRT_ARCHIVE_BUNDLE
   ARCHIVE_BUNDLE = $(JPRT_ARCHIVE_BUNDLE)
@@ -329,6 +347,7 @@
               -w:$(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/JTwork")    \
               -jdk:$(shell $(GETMIXEDPATH) "$(PRODUCT_HOME)")                \
               $(JTREG_NATIVE_PATH)                                           \
+              $(JTREG_FAILURE_HANDLER_OPTIONS)                               \
               $(JTREG_EXCLUSIONS)                                            \
               $(JTREG_TEST_OPTIONS)                                          \
               $(TEST_SELECTION)                                                    \