$NetBSD: patch-jdk_test_Makefile,v 1.3 2014/09/13 14:35:25 joerg Exp $

Use tools from pkgsrc.

--- jdk/test/Makefile.orig	2014-01-01 05:53:43.000000000 +0000
+++ jdk/test/Makefile
@@ -54,6 +54,8 @@ UNAME     = uname
 UNIQ      = uniq
 WC        = wc
 ZIP       = zip
+UNZIP     = unzip
+WHICH     = which
 
 # Get OS name from uname
 UNAME_S := $(shell $(UNAME) -s)
@@ -381,6 +383,12 @@ else
   JTREG_TEST_OPTIONS = $(JAVA_ARGS:%=-javaoptions:%) $(JAVA_VM_ARGS:%=-vmoption:%)
 endif
 
+# carry over XAUTHORITY
+JTREG_TEST_OPTIONS += -e:XAUTHORITY
+
+# some tests expect to find zip and unzip on the path
+JTREG_TEST_OPTIONS += -e:PATH=/bin:/usr/bin:$(dir $(shell $(WHICH) $(ZIP))):$(dir $(shell $(WHICH) $(UNZIP)))
+
 ifdef CONCURRENCY
   EXTRA_JTREG_OPTIONS += -concurrency:$(CONCURRENCY)
 endif
@@ -641,7 +649,7 @@ JTREG_BASIC_OPTIONS += $(JTREG_IGNORE_OP
 JTREG_TIMEOUT_OPTION =  -timeoutFactor:4
 JTREG_BASIC_OPTIONS += $(JTREG_TIMEOUT_OPTION)
 # Boost the max memory for jtreg to avoid gc thrashing
-JTREG_MEMORY_OPTION = -J-Xmx512m
+JTREG_MEMORY_OPTION = -J-Xmx512m -J-XX:+UseSerialGC
 JTREG_BASIC_OPTIONS += $(JTREG_MEMORY_OPTION)
 
 # Make sure jtreg exists
@@ -825,7 +833,7 @@ endif
 
 # The jtjck.jar utility to use to run the tests
 JTJCK_JAR = $(JCK_HOME)/lib/jtjck.jar
-JTJCK_JAVA_ARGS =  -XX:MaxPermSize=256m -Xmx512m
+JTJCK_JAVA_ARGS =  -XX:MaxPermSize=256m -Xmx1024m -XX:+UseSerialGC
 JTJCK_OPTIONS = -headless -v
 
 # Default tests to run
