langtools/test/Makefile
author martin
Fri, 11 Jun 2010 18:55:45 -0700
changeset 5786 f60ef38202e7
parent 5214 b71be6b1f652
child 5647 9a0b03523aa9
permissions -rw-r--r--
6944584: Improvements to subprocess handling on Unix Summary: use thread pool for reaper thread; move most I/O operations out of reaper thread Reviewed-by: michaelm, hiroshi
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     1
#
5214
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
     2
# Makefile to run jtreg and other tests
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
     3
#
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
     4
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
     5
# Product builds and langtools builds
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
     6
#
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
     7
# A full product build (or "control" build) creates a complete JDK image.
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
     8
# To test a product build, set TESTJAVA to the path for the image.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     9
#
5214
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
    10
# A langtools build just builds the langtools components of a JDK. 
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
    11
# To test a langtools build, set TESTJAVA to the path for a recent JDK
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
    12
# build, and set TESTBOOTCLASSPATH to the compiled langtools classes --
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
    13
# for example build/classes or dist/lib/classes.jar.
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
    14
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
    15
# JPRT
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
    16
# JPRT may invoke this Makefile directly, as part of a langtools build,
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
    17
# or indirectly, via FOREST/test/Makefile, as part of a control build.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    18
06bc494ca11e Initial load
duke
parents:
diff changeset
    19
# Get OS/ARCH specifics
06bc494ca11e Initial load
duke
parents:
diff changeset
    20
OSNAME = $(shell uname -s)
06bc494ca11e Initial load
duke
parents:
diff changeset
    21
ifeq ($(OSNAME), SunOS)
06bc494ca11e Initial load
duke
parents:
diff changeset
    22
  PLATFORM = solaris
06bc494ca11e Initial load
duke
parents:
diff changeset
    23
  JT_PLATFORM = solaris
06bc494ca11e Initial load
duke
parents:
diff changeset
    24
  ARCH = $(shell uname -p)
06bc494ca11e Initial load
duke
parents:
diff changeset
    25
  ifeq ($(ARCH), i386)
06bc494ca11e Initial load
duke
parents:
diff changeset
    26
    ARCH=i586
06bc494ca11e Initial load
duke
parents:
diff changeset
    27
  endif
06bc494ca11e Initial load
duke
parents:
diff changeset
    28
endif
06bc494ca11e Initial load
duke
parents:
diff changeset
    29
ifeq ($(OSNAME), Linux)
06bc494ca11e Initial load
duke
parents:
diff changeset
    30
  PLATFORM = linux
06bc494ca11e Initial load
duke
parents:
diff changeset
    31
  JT_PLATFORM = linux
06bc494ca11e Initial load
duke
parents:
diff changeset
    32
  ARCH = $(shell uname -m)
06bc494ca11e Initial load
duke
parents:
diff changeset
    33
  ifeq ($(ARCH), i386)
06bc494ca11e Initial load
duke
parents:
diff changeset
    34
    ARCH=i586
06bc494ca11e Initial load
duke
parents:
diff changeset
    35
  endif
06bc494ca11e Initial load
duke
parents:
diff changeset
    36
endif
06bc494ca11e Initial load
duke
parents:
diff changeset
    37
ifeq ($(OSNAME), Windows_NT)
06bc494ca11e Initial load
duke
parents:
diff changeset
    38
  PLATFORM = windows
06bc494ca11e Initial load
duke
parents:
diff changeset
    39
  JT_PLATFORM = win32
06bc494ca11e Initial load
duke
parents:
diff changeset
    40
  ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)),ia64)
06bc494ca11e Initial load
duke
parents:
diff changeset
    41
    ARCH=ia64
06bc494ca11e Initial load
duke
parents:
diff changeset
    42
  else
06bc494ca11e Initial load
duke
parents:
diff changeset
    43
    ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)),AMD64)
06bc494ca11e Initial load
duke
parents:
diff changeset
    44
      ARCH=x64
06bc494ca11e Initial load
duke
parents:
diff changeset
    45
    else
06bc494ca11e Initial load
duke
parents:
diff changeset
    46
      ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)),EM64T)
06bc494ca11e Initial load
duke
parents:
diff changeset
    47
        ARCH=x64
06bc494ca11e Initial load
duke
parents:
diff changeset
    48
      else
06bc494ca11e Initial load
duke
parents:
diff changeset
    49
        ARCH=i586
06bc494ca11e Initial load
duke
parents:
diff changeset
    50
      endif
06bc494ca11e Initial load
duke
parents:
diff changeset
    51
    endif
06bc494ca11e Initial load
duke
parents:
diff changeset
    52
  endif
06bc494ca11e Initial load
duke
parents:
diff changeset
    53
endif
06bc494ca11e Initial load
duke
parents:
diff changeset
    54
06bc494ca11e Initial load
duke
parents:
diff changeset
    55
# Root of this test area (important to use full paths in some places)
06bc494ca11e Initial load
duke
parents:
diff changeset
    56
TEST_ROOT := $(shell pwd)
06bc494ca11e Initial load
duke
parents:
diff changeset
    57
5214
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
    58
# Default bundle of all test results (passed or not) (JPRT only)
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
    59
ifdef JPRT_JOB_ID
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
    60
  JPRT_CLEAN = clean
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
    61
  JPRT_ARCHIVE_BUNDLE = $(TEST_ROOT)/JPRT_ARCHIVE_BUNDLE.zip
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
    62
endif
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    63
06bc494ca11e Initial load
duke
parents:
diff changeset
    64
ifeq ($(PLATFORM), windows)
06bc494ca11e Initial load
duke
parents:
diff changeset
    65
  SLASH_JAVA = J:
06bc494ca11e Initial load
duke
parents:
diff changeset
    66
else
06bc494ca11e Initial load
duke
parents:
diff changeset
    67
  SLASH_JAVA = /java
06bc494ca11e Initial load
duke
parents:
diff changeset
    68
endif
06bc494ca11e Initial load
duke
parents:
diff changeset
    69
06bc494ca11e Initial load
duke
parents:
diff changeset
    70
# Default JTREG to run
3779
8b3fc577aec6 6877763: update langtools/test/Makefile for JPRT
jjg
parents: 1261
diff changeset
    71
ifdef JPRT_JTREG_HOME
8b3fc577aec6 6877763: update langtools/test/Makefile for JPRT
jjg
parents: 1261
diff changeset
    72
  JTREG_HOME = $(JPRT_JTREG_HOME)
8b3fc577aec6 6877763: update langtools/test/Makefile for JPRT
jjg
parents: 1261
diff changeset
    73
else
8b3fc577aec6 6877763: update langtools/test/Makefile for JPRT
jjg
parents: 1261
diff changeset
    74
  JTREG_HOME = $(SLASH_JAVA)/re/jtreg/4.0/promoted/latest/binaries/jtreg
8b3fc577aec6 6877763: update langtools/test/Makefile for JPRT
jjg
parents: 1261
diff changeset
    75
endif
8b3fc577aec6 6877763: update langtools/test/Makefile for JPRT
jjg
parents: 1261
diff changeset
    76
JTREG = $(JTREG_HOME)/$(JT_PLATFORM)/bin/jtreg
5214
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
    77
JTDIFF = $(JTREG_HOME)/$(JT_PLATFORM)/bin/jtdiff
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    78
5214
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
    79
# Default JCK to run
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
    80
ifdef JPRT_JCK_HOME
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
    81
  JCK_HOME = $(JPRT_JCK_HOME)
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
    82
else
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
    83
  JCK_HOME = $(SLASH_JAVA)/re/jck/7/promoted/latest/binaries
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
    84
endif
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
    85
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
    86
# Default JDK for JTREG and JCK
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
    87
#
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
    88
# JT_JAVA is the version of java used to run jtreg/JCK. Since it is now
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
    89
# standard to execute tests in sameVM mode, it should normally be set the
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
    90
# same as TESTJAVA (although not necessarily so.)
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
    91
#
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    92
ifdef JPRT_JAVA_HOME
06bc494ca11e Initial load
duke
parents:
diff changeset
    93
  JT_JAVA = $(JPRT_JAVA_HOME)
06bc494ca11e Initial load
duke
parents:
diff changeset
    94
else
06bc494ca11e Initial load
duke
parents:
diff changeset
    95
  JT_JAVA = $(SLASH_JAVA)/re/jdk/1.6.0/archive/fcs/binaries/$(PLATFORM)-$(ARCH)
06bc494ca11e Initial load
duke
parents:
diff changeset
    96
endif
06bc494ca11e Initial load
duke
parents:
diff changeset
    97
06bc494ca11e Initial load
duke
parents:
diff changeset
    98
# Default JDK to test
3779
8b3fc577aec6 6877763: update langtools/test/Makefile for JPRT
jjg
parents: 1261
diff changeset
    99
ifdef JPRT_IMPORT_PRODUCT_HOME
8b3fc577aec6 6877763: update langtools/test/Makefile for JPRT
jjg
parents: 1261
diff changeset
   100
  TESTJAVA = $(JPRT_IMPORT_PRODUCT_HOME)
8b3fc577aec6 6877763: update langtools/test/Makefile for JPRT
jjg
parents: 1261
diff changeset
   101
else
8b3fc577aec6 6877763: update langtools/test/Makefile for JPRT
jjg
parents: 1261
diff changeset
   102
  TESTJAVA = $(SLASH_JAVA)/re/jdk/1.7.0/promoted/latest/binaries/$(PLATFORM)-$(ARCH)
8b3fc577aec6 6877763: update langtools/test/Makefile for JPRT
jjg
parents: 1261
diff changeset
   103
endif
8b3fc577aec6 6877763: update langtools/test/Makefile for JPRT
jjg
parents: 1261
diff changeset
   104
5214
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   105
# PRODUCT_HOME is a JPRT variable pointing to a directory containing the output from 
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   106
# make/Makefile
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   107
# For langtools, this is a directory containing build and dist
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   108
# For a control build, this is build/$(PRODUCT)-$(ARCH)/j2sdk-image
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   109
ifdef PRODUCT_HOME
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   110
  ifeq ($(shell [ -r $(PRODUCT_HOME)/dist/lib/classes.jar ]; echo $$?),0)
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   111
    TESTBOOTCLASSPATH = $(PRODUCT_HOME)/dist/lib/classes.jar
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   112
  endif
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   113
  ifeq ($(shell [ -r $(PRODUCT_HOME)/lib/tools.jar ]; echo $$?),0)
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   114
    TESTJAVA = $(PRODUCT_HOME)
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   115
  endif
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   116
endif
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   117
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   118
ifdef TESTBOOTCLASSPATH
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   119
  JTREG_OPTIONS += -Xbootclasspath/p:$(TESTBOOTCLASSPATH)
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   120
### In the following, -refvmoptions is an undocumented option
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   121
### The following does not work JCK 7 b30 2/6/2010. Awaiting b31. 
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   122
  JCK_OPTIONS += \
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   123
	-vmoptions:-Xbootclasspath/p:$(TESTBOOTCLASSPATH) \
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   124
	-refvmoptions:-Xbootclasspath/p:$(TESTBOOTCLASSPATH)
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   125
endif
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   126
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   127
# Concurrency is the number of tests that can execute at once. 
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   128
# Supported for JCK, not supported for jtreg.
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   129
# On an otherwise empty machine, suggest setting to (#cpus + 2)
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   130
# If unset, the default is (#cpus)
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   131
### RFE: determine and use #cpus
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   132
ifdef JCK_CONCURRENCY
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   133
  JCK_OPTIONS += -concurrency:$(JCK_CONCURRENCY)
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   134
endif
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   135
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   136
# JCK is executed using "Multi-JVM Group Mode", which is a hybrid
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   137
# of otherVM and sameVM modes. New JVMs are created and reused for
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   138
# a number of tests, then eventually discarded and a new one started.
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   139
# This amortizes the JVM startup time.  The "group size" defines
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   140
# how many tests are run in a JVM before it is replaced.
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   141
# If unset, the default is 100.
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   142
JCK_GROUP_SIZE = 1000
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   143
ifdef JCK_GROUP_SIZE
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   144
  JCK_COMPILER_OPTIONS += \
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   145
    -jtoptions:-Ejck.env.compiler.testCompile.groupMode.groupSize=$(JCK_GROUP_SIZE) \
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   146
    -jtoptions:-Ejck.env.compiler.compRefExecute.groupMode.groupSize=$(JCK_GROUP_SIZE)
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   147
### The following is not supported. Awaiting RFE 6924287
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   148
### 6924287: Jck4Jdk: Allow to configure test group size for group mode via simple command line option
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   149
###  JCK_RUNTIME_OPTIONS += \
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   150
###    -jtoptions:-Ejck.env.runtime.testCompile.groupMode.groupSize=$(JCK_GROUP_SIZE)
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   151
endif
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   152
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   153
# Assertions: some tests show failures when assertions are enabled.
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   154
# Since javac is typically loaded via the bootclassloader (either via TESTJAVA
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   155
# or TESTBOOTCLASSPATH), you may need -esa to enable assertions in javac.
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   156
JTREG_OPTIONS += $(ASSERTION_OPTIONS)
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   157
JCK_OPTIONS += $(ASSERTION_OPTIONS:%=-vmoptions:%)
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   158
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   159
# Include shared options
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   160
JCK_COMPILER_OPTIONS += $(JCK_OPTIONS)
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   161
JCK_RUNTIME_OPTIONS += $(JCK_OPTIONS)
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   162
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   163
# Exit codes:
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   164
# jtreg, jck:   0: OK, 1: tests failed, 2: tests error; 3+: SERIOUS
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   165
FATAL_JTREG_EXIT = 3
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   166
FATAL_JCK_EXIT = 3
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   167
# jtdiff: 0: OK, 1: differences found; 2+: SERIOUS
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   168
FATAL_JTDIFF_EXIT = 2
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   169
#
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   170
# Exit -- used for final "normal" exit from "make". Redefine to "true" to avoid
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   171
# having make exit with non-zero return code.
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   172
EXIT = exit
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   173
# Function to exit shell if exit code of preceding command is greater than or equal 
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   174
# to a given level. Redefine function or preceding FATAL_*_EXIT codes as needed.
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   175
EXIT_IF_FATAL = status=$$?; if [ $$status -ge $(1) ]; then exit $$status ; fi
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   176
06bc494ca11e Initial load
duke
parents:
diff changeset
   177
# The test directories to run
06bc494ca11e Initial load
duke
parents:
diff changeset
   178
DEFAULT_TESTDIRS = .
06bc494ca11e Initial load
duke
parents:
diff changeset
   179
TESTDIRS = $(DEFAULT_TESTDIRS)
06bc494ca11e Initial load
duke
parents:
diff changeset
   180
06bc494ca11e Initial load
duke
parents:
diff changeset
   181
# Root of all test results
5214
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   182
TEST_OUTPUT_DIR = $(TEST_ROOT)/../build/$(PLATFORM)-$(ARCH)/test/langtools
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   183
ABS_TEST_OUTPUT_DIR := \
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   184
	$(shell mkdir -p $(TEST_ROOT)/../build/$(PLATFORM)-$(ARCH)/test/langtools; \
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   185
		cd  $(TEST_ROOT)/../build/$(PLATFORM)-$(ARCH)/test/langtools; \
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   186
		pwd )
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   187
# Subdirectories for different test runs
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   188
JTREG_OUTPUT_DIR = $(ABS_TEST_OUTPUT_DIR)/jtreg
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   189
JCK_COMPILER_OUTPUT_DIR = $(ABS_TEST_OUTPUT_DIR)/jck-compiler
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   190
JCK_RUNTIME_OUTPUT_DIR = $(ABS_TEST_OUTPUT_DIR)/jck-runtime-Xcompile
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   191
5214
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   192
# Default make rule -- warning, may take a while
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   193
all: $(JPRT_CLEAN) jtreg-tests jck-compiler-tests jck-runtime-tests $(JPRT_ARCHIVE_BUNDLE) all-summary
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   194
	@echo "Testing completed successfully"
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   195
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   196
jtreg apt javac javadoc javah javap: $(JPRT_CLEAN) jtreg-tests $(JPRT_ARCHIVE_BUNDLE) jtreg-summary
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   197
	@echo "Testing completed successfully"
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   198
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   199
jck-compiler: $(JPRT_CLEAN) jck-compiler-tests $(JPRT_ARCHIVE_BUNDLE) jck-compiler-summary
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   200
	@echo "Testing completed successfully"
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   201
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   202
jck-runtime: $(JPRT_CLEAN) jck-runtime-tests $(JPRT_ARCHIVE_BUNDLE) jck-runtime-summary
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   203
	@echo "Testing completed successfully"
06bc494ca11e Initial load
duke
parents:
diff changeset
   204
06bc494ca11e Initial load
duke
parents:
diff changeset
   205
# for use with JPRT -testrule
5214
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   206
all:		JTREG_TESTDIRS = .
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   207
jtreg:		JTREG_TESTDIRS = .
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   208
apt:		JTREG_TESTDIRS = tools/apt
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   209
javac: 		JTREG_TESTDIRS = tools/javac
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   210
javadoc:	JTREG_TESTDIRS = tools/javadoc com/sun/javadoc
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   211
javah:		JTREG_TESTDIRS = tools/javah
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   212
javap:		JTREG_TESTDIRS = tools/javap
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   213
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   214
# Run jtreg tests
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   215
#
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   216
# JTREG_HOME
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   217
#	Installed location of jtreg
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   218
# JT_JAVA
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   219
#	Version of java used to run jtreg.  Should normally be the same as TESTJAVA
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   220
# TESTJAVA
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   221
# 	Version of java to be tested.  
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   222
# JTREG_OPTIONS
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   223
#	Additional options for jtreg
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   224
# JTREG_TESTDIRS
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   225
#	Directories of tests to be run
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   226
# JTREG_OUTPUT_DIR
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   227
#	Where to write the results
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   228
# JTREG_REFERENCE
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   229
#	(Optional) reference results (e.g. work, report or summary.txt)
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   230
#
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   231
jtreg-tests: check-jtreg FRC
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   232
	@rm -f -r $(JTREG_OUTPUT_DIR)/JTwork $(JTREG_OUTPUT_DIR)/JTreport \
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   233
	    $(JTREG_OUTPUT_DIR)/diff.html $(JTREG_OUTPUT_DIR)/status.txt
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   234
	@mkdir -p $(JTREG_OUTPUT_DIR)
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   235
	JT_JAVA=$(JT_JAVA) $(JTREG) \
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   236
	  -J-Xmx512m \
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   237
	  -a -samevm -ignore:quiet -v:fail,error,nopass \
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   238
          -r:$(JTREG_OUTPUT_DIR)/JTreport \
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   239
          -w:$(JTREG_OUTPUT_DIR)/JTwork \
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   240
          -jdk:$(TESTJAVA) \
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   241
          $(JAVA_ARGS:%=-vmoption:%) \
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   242
	  $(JTREG_OPTIONS) \
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   243
          $(JTREG_TESTDIRS) \
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   244
	|| ( $(call EXIT_IF_FATAL,$(FATAL_JTREG_EXIT)) ; \
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   245
	    echo $$status > $(JTREG_OUTPUT_DIR)/status.txt \
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   246
	)
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   247
ifdef JTREG_REFERENCE
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   248
	JT_JAVA=$(JT_JAVA) $(JTDIFF) -o $(JTREG_OUTPUT_DIR)/diff.html \
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   249
	    $(JTREG_REFERENCE) $(JTREG_OUTPUT_DIR)/JTreport \
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   250
	|| ( $(call EXIT_IF_FATAL,$(FATAL_JTDIFF_EXIT)) )
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   251
endif
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   252
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   253
jtreg-summary: FRC
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   254
	if [ -r $(JTREG_OUTPUT_DIR)/status.txt ]; then \
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   255
	    echo ; echo "Summary of jtreg test failures" ; \
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   256
	    cat $(JTREG_OUTPUT_DIR)/JTreport/text/summary.txt | \
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   257
		grep -v 'Not run' | grep -v 'Passed' ; \
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   258
	    echo ; \
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   259
	    $(EXIT) `cat $(JTREG_OUTPUT_DIR)/status.txt` ; \
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   260
	fi
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   261
06bc494ca11e Initial load
duke
parents:
diff changeset
   262
# Check to make sure these directories exist
5214
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   263
check-jtreg: $(JT_HOME) $(PRODUCT_HOME) $(JTREG)
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   264
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   265
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   266
# Run JCK-compiler tests
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   267
#
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   268
# JCK_HOME
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   269
#	Installed location of JCK: should include JCK-compiler, and JCK-extras
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   270
# JT_JAVA
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   271
#	Version of java used to run JCK.  Should normally be the same as TESTJAVA
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   272
# TESTJAVA
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   273
# 	Version of java to be tested.  
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   274
# JCK_COMPILER_OPTIONS
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   275
#	Additional options for JCK-compiler
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   276
# JCK_COMPILER_TESTDIRS
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   277
#	Directories of tests to be run
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   278
# JCK_COMPILER_OUTPUT_DIR
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   279
#	Where to write the results
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   280
# JCK_COMPILER_REFERENCE
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   281
#	(Optional) reference results (e.g. work, report or summary.txt)
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   282
#
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   283
jck-compiler-tests: check-jck FRC
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   284
	@rm -f -r $(JCK_COMPILER_OUTPUT_DIR)/work $(JCK_COMPILER_OUTPUT_DIR)/report \
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   285
	    $(JCK_COMPILER_OUTPUT_DIR)/diff.html $(JCK_COMPILER_OUTPUT_DIR)/status.txt
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   286
	@mkdir -p $(JCK_COMPILER_OUTPUT_DIR)
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   287
	$(JT_JAVA)/bin/java -XX:MaxPermSize=256m -Xmx512m \
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   288
	    -jar $(JCK_HOME)/JCK-compiler-7/lib/jtjck.jar \
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   289
	    -v:non-pass \
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   290
            -r:$(JCK_COMPILER_OUTPUT_DIR)/report \
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   291
            -w:$(JCK_COMPILER_OUTPUT_DIR)/work \
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   292
            -jdk:$(TESTJAVA) \
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   293
	    $(JCK_COMPILER_OPTIONS) \
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   294
            $(JCK_COMPILER_TESTDIRS) \
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   295
	|| ( $(call EXIT_IF_FATAL,$(FATAL_JCK_EXIT)) ; \
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   296
	    echo $$status > $(JCK_COMPILER_OUTPUT_DIR)/status.txt \
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   297
	)
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   298
ifdef JCK_COMPILER_REFERENCE
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   299
	JT_JAVA=$(JT_JAVA) $(JTDIFF) -o $(JCK_COMPILER_OUTPUT_DIR)/diff.html \
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   300
	    $(JCK_COMPILER_REFERENCE) $(JCK_COMPILER_OUTPUT_DIR)/report \
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   301
	|| ( $(call EXIT_IF_FATAL,$(FATAL_JTDIFF_EXIT)) )
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   302
endif
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   303
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   304
jck-compiler-summary: FRC
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   305
	if [ -r $(JCK_COMPILER_OUTPUT_DIR)/status.txt ]; then \
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   306
	    echo ; echo "Summary of JCK-compiler test failures" ; \
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   307
	    cat $(JCK_COMPILER_OUTPUT_DIR)/report/text/summary.txt | \
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   308
		grep -v 'Not run' | grep -v 'Passed' ; \
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   309
	    echo ; \
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   310
	    $(EXIT) `cat $(JCK_COMPILER_OUTPUT_DIR)/status.txt` ; \
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   311
	fi
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   312
5214
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   313
# Run JCK-runtime tests in -Xcompile mode
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   314
# This is a special mode to test javac by compiling the tests in the JCK-runtime test suite
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   315
# Normal JCK-runtime invocation belongs in the jdk/ repository.
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   316
#
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   317
# JCK_HOME
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   318
#	Installed location of JCK: should include JCK-compiler, JCK-runtime and JCK-extras
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   319
# JT_JAVA
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   320
#	Version of java used to run JCK.  Should normally be the same as TESTJAVA
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   321
# TESTJAVA
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   322
# 	Version of java to be tested.  
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   323
# JCK_RUNTIME_OPTIONS
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   324
#	Additional options for JCK-runtime
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   325
# JCK_RUNTIME_TESTDIRS
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   326
#	Directories of tests to be run
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   327
# JCK_RUNTIME_OUTPUT_DIR
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   328
#	Where to write the results
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   329
# JCK_RUNTIME_REFERENCE
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   330
#	(Optional) reference results (e.g. work, report or summary.txt)
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   331
#
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   332
jck-runtime-tests: check-jck FRC
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   333
	@rm -f -r $(JCK_RUNTIME_OUTPUT_DIR)/work $(JCK_RUNTIME_OUTPUT_DIR)/report \
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   334
	    $(JCK_RUNTIME_OUTPUT_DIR)/diff.html $(JCK_RUNTIME_OUTPUT_DIR)/status.txt
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   335
	@mkdir -p $(JCK_RUNTIME_OUTPUT_DIR)
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   336
	$(JT_JAVA)/bin/java -XX:MaxPermSize=256m -Xmx512m \
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   337
	    -jar $(JCK_HOME)/JCK-runtime-7/lib/jtjck.jar \
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   338
	    -v:non-pass \
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   339
            -r:$(JCK_RUNTIME_OUTPUT_DIR)/report \
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   340
            -w:$(JCK_RUNTIME_OUTPUT_DIR)/work \
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   341
            -jdk:$(TESTJAVA) \
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   342
	    -Xcompile \
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   343
	    $(JCK_RUNTIME_OPTIONS) \
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   344
            $(JCK_RUNTIME_TESTDIRS) \
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   345
	|| ( $(call EXIT_IF_FATAL,$(FATAL_JCK_EXIT)) ; \
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   346
	    echo $$status > $(JCK_RUNTIME_OUTPUT_DIR)/status.txt \
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   347
	)
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   348
ifdef JCK_RUNTIME_REFERENCE
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   349
	JT_JAVA=$(JT_JAVA) $(JTDIFF) -o $(JCK_RUNTIME_OUTPUT_DIR)/diff.html \
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   350
	    $(JCK_RUNTIME_REFERENCE) $(JCK_RUNTIME_OUTPUT_DIR)/report \
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   351
	|| ( $(call EXIT_IF_FATAL,$(FATAL_JTDIFF_EXIT)) )
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   352
endif
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   353
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   354
jck-runtime-summary: FRC
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   355
	if [ -r $(JCK_RUNTIME_OUTPUT_DIR)/status.txt ]; then \
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   356
	    echo ; echo "Summary of JCK-runtime test failures" ; \
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   357
	    cat $(JCK_RUNTIME_OUTPUT_DIR)/report/text/summary.txt | \
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   358
		grep -v 'Not run' | grep -v 'Passed' ; \
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   359
	    echo ; \
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   360
	    $(EXIT) `cat $(JCK_RUNTIME_OUTPUT_DIR)/status.txt` ; \
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   361
	fi
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   362
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   363
# Check to make sure these directories exist
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   364
check-jck: $(JT_HOME) $(JCK_HOME) $(PRODUCT_HOME)
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   365
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   366
all-summary: FRC
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   367
	if [ -n "`find $(TEST_OUTPUT_DIR) -name status.txt`" ]; then
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   368
	    echo ; echo "Summary of test failures" ; \
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   369
	    cat `find $(TEST_OUTPUT_DIR) -name summary.txt` | \
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   370
		grep -v 'Not run' | grep -v 'Passed' ; \
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   371
	    echo ; \
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   372
	    $(EXIT) 1
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   373
	fi
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   374
06bc494ca11e Initial load
duke
parents:
diff changeset
   375
# Bundle up the results
06bc494ca11e Initial load
duke
parents:
diff changeset
   376
$(JPRT_ARCHIVE_BUNDLE): FRC
06bc494ca11e Initial load
duke
parents:
diff changeset
   377
	@rm -f $@
06bc494ca11e Initial load
duke
parents:
diff changeset
   378
	@mkdir -p $(@D)
06bc494ca11e Initial load
duke
parents:
diff changeset
   379
	( cd $(TEST_OUTPUT_DIR) && zip -q -r $@ . )
06bc494ca11e Initial load
duke
parents:
diff changeset
   380
06bc494ca11e Initial load
duke
parents:
diff changeset
   381
# Cleanup
06bc494ca11e Initial load
duke
parents:
diff changeset
   382
clean:
06bc494ca11e Initial load
duke
parents:
diff changeset
   383
	rm -f $(JPRT_ARCHIVE_BUNDLE)
06bc494ca11e Initial load
duke
parents:
diff changeset
   384
06bc494ca11e Initial load
duke
parents:
diff changeset
   385
# Used to force a target rules to run
06bc494ca11e Initial load
duke
parents:
diff changeset
   386
FRC:
06bc494ca11e Initial load
duke
parents:
diff changeset
   387
06bc494ca11e Initial load
duke
parents:
diff changeset
   388
# Phony targets (e.g. these are not filenames)
5214
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   389
.PHONY: all clean \
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   390
	jtreg javac javadoc javah javap jtreg-tests jtreg-summary check-jtreg \
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   391
	jck-compiler jck-compiler-tests jck-compiler-summary \
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   392
	jck-runtime jck-runtime-tests jck-runtime-summary check-jck
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   393
5214
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   394
# No use of suffix rules
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   395
.SUFFIXES:
b71be6b1f652 6934224: update langtools/test/Makefile
jjg
parents: 3779
diff changeset
   396