langtools/test/Makefile

Print this page

        

@@ -14,50 +14,64 @@
 
 # JPRT
 # JPRT may invoke this Makefile directly, as part of a langtools build,
 # or indirectly, via FOREST/test/Makefile, as part of a control build.
 
-# Get OS/ARCH specifics
-OSNAME = $(shell uname -s)
+# Utilities used
+AWK       = awk
+CAT       = cat
+CD        = cd
+CHMOD     = chmod
+CP        = cp
+CUT       = cut
+DIRNAME   = dirname
+ECHO      = echo
+EGREP     = egrep
+EXPAND    = expand
+FIND      = find
+MKDIR     = mkdir
+PWD       = pwd
+SED       = sed
+SORT      = sort
+TEE       = tee
+UNAME     = uname
+UNIQ      = uniq
+WHICH     = which
+WC        = wc
+ZIP       = zip
+
+# Get OS name from uname (Cygwin inexplicably adds _NT-5.1)
+OSNAME := $(shell $(UNAME) -s | $(CUT) -f1 -d_)
 ifeq ($(OSNAME), SunOS)
   SLASH_JAVA = /java
   PLATFORM = solaris
-  JT_PLATFORM = solaris
-  ARCH = $(shell uname -p)
+  ARCH = $(shell $(UNAME) -p)
   ifeq ($(ARCH), i386)
     ARCH=i586
   endif
 endif
 ifeq ($(OSNAME), Linux)
   SLASH_JAVA = /java
   PLATFORM = linux
-  JT_PLATFORM = linux
-  ARCH = $(shell uname -m)
+  ARCH = $(shell $(UNAME) -m)
   ifeq ($(ARCH), i386)
     ARCH=i586
   endif
 endif
 ifeq ($(OSNAME), Darwin)
   PLATFORM = bsd
-  JT_PLATFORM = linux
-  ARCH = $(shell uname -m)
+  ARCH = $(shell $(UNAME) -m)
   ifeq ($(ARCH), i386)
     ARCH=i586
   endif
 endif
-ifeq ($(OSNAME), Windows_NT)
-  # MKS
-  PLATFORM=windows
-endif
-ifeq ($(PLATFORM),)
+ifeq ($(OSNAME), CYGWIN)
   PLATFORM = windows
   CYGPATH = | cygpath -m -s -f -
 endif
 
 ifeq ($(PLATFORM), windows)
-  SLASH_JAVA = J:
-  JT_PLATFORM = win32
   ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)),ia64)
     ARCH=ia64
   else
     ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)),AMD64)
       ARCH=x64

@@ -85,38 +99,39 @@
   SLASH_JAVA = J:
 else
   SLASH_JAVA = /java
 endif
 
-# Default JTREG to run
-ifdef JPRT_JTREG_HOME
-  JTREG_HOME = $(JPRT_JTREG_HOME)
-else
-  JTREG_HOME = $(SLASH_JAVA)/re/jtreg/4.1/promoted/latest/binaries/jtreg
+# Expect JTREG or JT_HOME to be set for jtreg tests.
+ifndef JTREG
+  ifdef JT_HOME
+    # windows executable works for everybody
+    JTREG = $(JT_HOME)/win32/bin/jtreg
+  else
+    # maybe it's on the path?
+    JTREG=$(shell $(WHICH) jtreg 2> /dev/null | $(GREP) -v '^no jtreg in')
+  endif
+endif
+
+# Expect JTDIFF or JT_HOME to be set for jtdiff tests.
+ifndef JTDIFF
+  ifdef JT_HOME
+    # windows executable works for everybody
+    JTDIFF = $(JT_HOME)/win32/bin/jtdiff
+  else
+    # maybe it's on the path?
+    JTDIFF=$(shell $(WHICH) jtdiff 2> /dev/null | $(GREP) -v '^no jtdiff in')
+  endif
 endif
-JTREG = $(JTREG_HOME)/$(JT_PLATFORM)/bin/jtreg
-JTDIFF = $(JTREG_HOME)/$(JT_PLATFORM)/bin/jtdiff
 
 # Default JCK to run
 ifdef JPRT_JCK_HOME
   JCK_HOME = $(JPRT_JCK_HOME)
 else
   JCK_HOME = $(SLASH_JAVA)/re/jck/8/promoted/latest/binaries
 endif
 
-# Default JDK for JTREG and JCK
-#
-# JT_JAVA is the version of java used to run jtreg/JCK. Since it is now
-# standard to execute tests in sameVM mode, it should normally be set the
-# same as TESTJAVA (although not necessarily so.)
-#
-ifdef JPRT_JAVA_HOME
-  JT_JAVA = $(JPRT_JAVA_HOME)
-else
-  JT_JAVA = $(SLASH_JAVA)/re/jdk/1.7.0/archive/fcs/binaries/$(PLATFORM)-$(ARCH)
-endif
-
 # Default JDK to test
 ifdef JPRT_IMPORT_PRODUCT_HOME
   TESTJAVA = $(JPRT_IMPORT_PRODUCT_HOME)
 else
   TESTJAVA = $(SLASH_JAVA)/re/jdk/1.7.0/promoted/latest/binaries/$(PLATFORM)-$(ARCH)

@@ -134,10 +149,26 @@
   ifeq ($(shell [ -r $(PRODUCT_HOME)/bin/javac$(EXE_SUFFIX) ]; echo $$?),0)
     TESTJAVA = $(PRODUCT_HOME)
   endif
 endif
 
+# Default JDK for JTREG and JCK
+#
+# JT_JAVA is the version of java used to run jtreg/JCK.
+#
+ifndef JT_JAVA
+  ifdef JPRT_JAVA_HOME
+    JT_JAVA = $(JPRT_JAVA_HOME)
+  else
+    ifdef TESTJAVA
+        JT_JAVA = $(TESTJAVA)
+    else
+        JT_JAVA = $(SLASH_JAVA)/re/jdk/1.7.0/archive/fcs/binaries/$(PLATFORM)-$(ARCH)
+    endif
+  endif
+endif
+
 ifdef TESTBOOTCLASSPATH
   JTREG_OPTIONS += -Xbootclasspath/p:$(TESTBOOTCLASSPATH)
 ### In the following, -refvmoptions is an undocumented option
 ### The following does not work JCK 7 b30 2/6/2010. Awaiting b31.
   JCK_OPTIONS += \

@@ -146,11 +177,11 @@
 endif
 
 # Concurrency is the number of tests that can execute at once.
 # On an otherwise empty machine, suggest setting to (#cpus + 2)
 # If unset, the default is (#cpus)
-### RFE: determine and use #cpus
+# when invoked via root repo "make test" it is set to $(JOBS)
 ifdef CONCURRENCY
   JTREG_OPTIONS += -agentvm -concurrency:$(CONCURRENCY)
 else
   JTREG_OPTIONS += -samevm
 endif