changeset 228:01fd672743cc

. Add BSD support. . Allow overriding the location of jtreg. . Test with and test the JDK that was just built. . Allow overriding of the TESTDIRS to run. . Don't insist on /opt/jprt existing.
author glewis@misty.eyesbeyond.com
date Sun, 01 Mar 2009 09:33:46 -0800
parents 34c8a5598394
children 5aa8afbdacbc
files test/Makefile test/jprt.config
diffstat 2 files changed, 58 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/test/Makefile	Sat Feb 21 11:29:50 2009 -0800
+++ b/test/Makefile	Sun Mar 01 09:33:46 2009 -0800
@@ -20,6 +20,22 @@
     ARCH=i586
   endif
 endif
+ifeq ($(OSNAME), Darwin)
+  PLATFORM = bsd
+  JT_PLATFORM = linux
+  ARCH = $(shell uname -m)
+  ifeq ($(ARCH), i386)
+    ARCH=i586
+  endif
+endif
+ifeq ($(findstring BSD,$(OSNAME)), BSD)
+  PLATFORM = bsd
+  JT_PLATFORM = linux
+  ARCH = $(shell uname -m)
+  ifeq ($(ARCH), i386)
+    ARCH=i586
+  endif
+endif
 ifeq ($(OSNAME), Windows_NT)
   PLATFORM = windows
   JT_PLATFORM = win32
@@ -53,22 +69,30 @@
 
 # Default JTREG to run
 JT_HOME = $(SLASH_JAVA)/svc/jct-tools3.2.2_02
+ifdef JPRT_JTREG_HOME
+  JT_HOME = $(JPRT_JTREG_HOME)
+endif
 JTREG = $(JT_HOME)/$(JT_PLATFORM)/bin/jtreg
 
+# Default JDK to test
+
+# The test directories to run
 # Default JDK for JTREG
 ifdef JPRT_JAVA_HOME
   JT_JAVA = $(JPRT_JAVA_HOME)
 else
-  JT_JAVA = $(SLASH_JAVA)/re/jdk/1.6.0/archive/fcs/binaries/$(PLATFORM)-$(ARCH)
+  JT_JAVA = $(TEST_ROOT)/../../build/$(PLATFORM)-$(ARCH)
 endif
 
 # Default JDK to test
-TESTJAVA = $(SLASH_JAVA)/re/jdk/1.7.0/promoted/latest/binaries/$(PLATFORM)-$(ARCH)
-TESTBOOTCLASSPATH = $(PRODUCT_HOME)/dist/lib/classes.jar
+TESTJAVA = $(TEST_ROOT)/../../build/$(PLATFORM)-$(ARCH)
+TESTBOOTCLASSPATH = $(TEST_ROOT)/../../build/$(PLATFORM)-$(ARCH)/langtools/dist/lib/classes.jar
 
 # The test directories to run
 DEFAULT_TESTDIRS = .
-TESTDIRS = $(DEFAULT_TESTDIRS)
+ifndef TESTDIRS
+  TESTDIRS = $(DEFAULT_TESTDIRS)
+endif
 
 # Root of all test results
 TEST_OUTPUT_DIR = $(TEST_ROOT)/o_$(PLATFORM)-$(ARCH)
@@ -96,7 +120,7 @@
 
 # Run the tests
 jtreg-tests: FRC
-	ls /opt/jprt /opt/jprt/jdk*
+	-ls /opt/jprt /opt/jprt/jdk*
 	@echo "Using export JAVA_TOOL_OPTIONS=$(JAVA_TOOL_OPTIONS)"
 	@rm -f -r $(TEST_OUTPUT_DIR)/JTwork $(TEST_OUTPUT_DIR)/JTreport
 	@mkdir -p $(TEST_OUTPUT_DIR)
--- a/test/jprt.config	Sat Feb 21 11:29:50 2009 -0800
+++ b/test/jprt.config	Sun Mar 01 09:33:46 2009 -0800
@@ -71,8 +71,8 @@
 
 # Uses 'uname -s', but only expect SunOS or Linux, assume Windows otherwise.
 osname=`uname -s`
-if [ "${osname}" = SunOS ] ; then
-   
+case "${osname}" in
+  SunOS)
     # SOLARIS: Sparc or X86
     osarch=`uname -p`
     if [ "${osarch}" = sparc ] ; then
@@ -96,9 +96,9 @@
 
     # File creation mask
     umask 002
+    ;;
 
-elif [ "${osname}" = Linux ] ; then
-   
+  Linux | Darwin )
     # Add basic paths
     path4sdk=/usr/bin:/bin:/usr/sbin:/sbin
 
@@ -107,9 +107,31 @@
     fileMustExist "${make}" make
 
     umask 002
+    ;;
 
-else
+  FreeBSD | OpenBSD )
+    # Add basic paths
+    path4sdk=/usr/bin:/bin:/usr/sbin:/sbin
 
+    # Find GNU make
+    make=/usr/local/bin/gmake
+    fileMustExist "${make}" make
+
+    umask 002
+    ;;
+
+  NetBSD )
+    # Add basic paths
+    path4sdk=/usr/bin:/bin:/usr/sbin:/sbin
+
+    # Find GNU make
+    make=/usr/pkg/bin/gmake
+    fileMustExist "${make}" make
+
+    umask 002
+    ;;
+
+  *)
     # Windows: Differs on CYGWIN vs. MKS.
    
     # We need to determine if we are running a CYGWIN shell or an MKS shell
@@ -150,8 +172,8 @@
     if [ "${unix_toolset}" = CYGWIN ] ; then
 	path4sdk="`/usr/bin/cygpath -p ${path4sdk}`"
     fi
-
-fi
+    ;;
+esac
 
 # Export PATH setting
 PATH="${path4sdk}"