hotspot/test/Makefile
author sla
Wed, 11 May 2016 11:04:17 +0200
changeset 37869 e0f538c1694c
parent 37299 db3b0d4c3bda
child 38303 1d0016127806
permissions -rw-r--r--
8156658: Common way to run jtreg tests Reviewed-by: erikj, dsamersoff
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
#
29179
8836e3bd543b 8072842: Add support for building native JTReg tests
ihse
parents: 29075
diff changeset
     2
# Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     4
#
489c9b5090e2 Initial load
duke
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
489c9b5090e2 Initial load
duke
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
489c9b5090e2 Initial load
duke
parents:
diff changeset
     7
# published by the Free Software Foundation.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     8
#
489c9b5090e2 Initial load
duke
parents:
diff changeset
     9
# This code is distributed in the hope that it will be useful, but WITHOUT
489c9b5090e2 Initial load
duke
parents:
diff changeset
    10
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    11
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
489c9b5090e2 Initial load
duke
parents:
diff changeset
    12
# version 2 for more details (a copy is included in the LICENSE file that
489c9b5090e2 Initial load
duke
parents:
diff changeset
    13
# accompanied this code).
489c9b5090e2 Initial load
duke
parents:
diff changeset
    14
#
489c9b5090e2 Initial load
duke
parents:
diff changeset
    15
# You should have received a copy of the GNU General Public License version
489c9b5090e2 Initial load
duke
parents:
diff changeset
    16
# 2 along with this work; if not, write to the Free Software Foundation,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    17
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    18
#
5547
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 2868
diff changeset
    19
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 2868
diff changeset
    20
# or visit www.oracle.com if you need additional information or have any
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 2868
diff changeset
    21
# questions.
1132
915051915ce9 6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents: 1
diff changeset
    22
#
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    23
#
489c9b5090e2 Initial load
duke
parents:
diff changeset
    24
489c9b5090e2 Initial load
duke
parents:
diff changeset
    25
#
25628
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
    26
# Makefile to run various hotspot tests
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    27
#
489c9b5090e2 Initial load
duke
parents:
diff changeset
    28
27695
c6e0ac3339ac 8059732: improve hotspot_*test targets
iignatyev
parents: 26922
diff changeset
    29
ALT_MAKE ?= closed
c6e0ac3339ac 8059732: improve hotspot_*test targets
iignatyev
parents: 26922
diff changeset
    30
12225
232f136e7b60 7152791: wbapi tests fail on cygwin
mgerdin
parents: 12095
diff changeset
    31
GETMIXEDPATH=echo
232f136e7b60 7152791: wbapi tests fail on cygwin
mgerdin
parents: 12095
diff changeset
    32
25628
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
    33
# Utilities used
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
    34
AWK       = awk
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
    35
CAT       = cat
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
    36
CD        = cd
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
    37
CHMOD     = chmod
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
    38
CP        = cp
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
    39
CUT       = cut
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
    40
DIRNAME   = dirname
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
    41
ECHO      = echo
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
    42
EGREP     = egrep
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
    43
EXPAND    = expand
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
    44
FIND      = find
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
    45
MKDIR     = mkdir
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
    46
PWD       = pwd
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
    47
SED       = sed
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
    48
SORT      = sort
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
    49
TEE       = tee
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
    50
UNAME     = uname
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
    51
UNIQ      = uniq
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
    52
WC        = wc
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
    53
ZIP       = zip
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
    54
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
    55
# Get OS name from uname (Cygwin inexplicably adds _NT-5.1)
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
    56
UNAME_S := $(shell $(UNAME) -s | $(CUT) -f1 -d_)
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
    57
ifeq ($(UNAME_S), SunOS)
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    58
  PLATFORM = solaris
2024
859d11cea3f8 6799452: HotSpot tests Makefile should take care of ALT_SLASH_JAVA
twisti
parents: 1132
diff changeset
    59
  SLASH_JAVA = /java
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    60
  ARCH = $(shell uname -p)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    61
  ifeq ($(ARCH), i386)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    62
    ARCH=i586
489c9b5090e2 Initial load
duke
parents:
diff changeset
    63
  endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
    64
endif
25628
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
    65
ifeq ($(UNAME_S), Linux)
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    66
  PLATFORM = linux
2024
859d11cea3f8 6799452: HotSpot tests Makefile should take care of ALT_SLASH_JAVA
twisti
parents: 1132
diff changeset
    67
  SLASH_JAVA = /java
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    68
  ARCH = $(shell uname -m)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    69
  ifeq ($(ARCH), i386)
1132
915051915ce9 6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents: 1
diff changeset
    70
    ARCH = i586
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    71
  endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
    72
endif
25628
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
    73
ifeq ($(UNAME_S), Darwin)
10565
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents: 7662
diff changeset
    74
  PLATFORM = bsd
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents: 7662
diff changeset
    75
  SLASH_JAVA = /java
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents: 7662
diff changeset
    76
  ARCH = $(shell uname -m)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents: 7662
diff changeset
    77
  ifeq ($(ARCH), i386)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents: 7662
diff changeset
    78
    ARCH = i586
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents: 7662
diff changeset
    79
  endif
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents: 7662
diff changeset
    80
endif
25628
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
    81
ifeq ($(findstring BSD,$(UNAME_S)), BSD)
10565
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents: 7662
diff changeset
    82
  PLATFORM = bsd
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents: 7662
diff changeset
    83
  SLASH_JAVA = /java
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents: 7662
diff changeset
    84
  ARCH = $(shell uname -m)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents: 7662
diff changeset
    85
  ifeq ($(ARCH), i386)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents: 7662
diff changeset
    86
    ARCH = i586
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents: 7662
diff changeset
    87
  endif
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents: 7662
diff changeset
    88
endif
12225
232f136e7b60 7152791: wbapi tests fail on cygwin
mgerdin
parents: 12095
diff changeset
    89
ifeq ($(PLATFORM),)
25628
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
    90
  # detect whether we're running in MKS or cygwin
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
    91
  ifeq ($(UNAME_S), Windows_NT) # MKS
12225
232f136e7b60 7152791: wbapi tests fail on cygwin
mgerdin
parents: 12095
diff changeset
    92
    GETMIXEDPATH=dosname -s
232f136e7b60 7152791: wbapi tests fail on cygwin
mgerdin
parents: 12095
diff changeset
    93
  endif
25628
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
    94
  ifeq ($(findstring CYGWIN,$(UNAME_S)), CYGWIN)
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
    95
    GETMIXEDPATH=cygpath -m
12225
232f136e7b60 7152791: wbapi tests fail on cygwin
mgerdin
parents: 12095
diff changeset
    96
  endif
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    97
  PLATFORM = windows
1132
915051915ce9 6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents: 1
diff changeset
    98
  SLASH_JAVA = J:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    99
  ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)),ia64)
1132
915051915ce9 6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents: 1
diff changeset
   100
    ARCH = ia64
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   101
  else
489c9b5090e2 Initial load
duke
parents:
diff changeset
   102
    ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)),AMD64)
1132
915051915ce9 6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents: 1
diff changeset
   103
      ARCH = x64
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   104
    else
489c9b5090e2 Initial load
duke
parents:
diff changeset
   105
      ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)),EM64T)
1132
915051915ce9 6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents: 1
diff changeset
   106
        ARCH = x64
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   107
      else
1132
915051915ce9 6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents: 1
diff changeset
   108
        ARCH = i586
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   109
      endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   110
    endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   111
  endif
1132
915051915ce9 6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents: 1
diff changeset
   112
  EXESUFFIX = .exe
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   113
endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   114
2024
859d11cea3f8 6799452: HotSpot tests Makefile should take care of ALT_SLASH_JAVA
twisti
parents: 1132
diff changeset
   115
ifdef ALT_SLASH_JAVA
859d11cea3f8 6799452: HotSpot tests Makefile should take care of ALT_SLASH_JAVA
twisti
parents: 1132
diff changeset
   116
  SLASH_JAVA = $(ALT_SLASH_JAVA)
859d11cea3f8 6799452: HotSpot tests Makefile should take care of ALT_SLASH_JAVA
twisti
parents: 1132
diff changeset
   117
endif
859d11cea3f8 6799452: HotSpot tests Makefile should take care of ALT_SLASH_JAVA
twisti
parents: 1132
diff changeset
   118
1132
915051915ce9 6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents: 1
diff changeset
   119
# Root of this test area (important to use full paths in some places)
915051915ce9 6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents: 1
diff changeset
   120
TEST_ROOT := $(shell pwd)
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   121
489c9b5090e2 Initial load
duke
parents:
diff changeset
   122
# Root of all test results
37869
e0f538c1694c 8156658: Common way to run jtreg tests
sla
parents: 37299
diff changeset
   123
ifdef TEST_OUTPUT_DIR
e0f538c1694c 8156658: Common way to run jtreg tests
sla
parents: 37299
diff changeset
   124
  $(shell $(MKDIR) -p $(TEST_OUTPUT_DIR)/jtreg)
e0f538c1694c 8156658: Common way to run jtreg tests
sla
parents: 37299
diff changeset
   125
  ABS_TEST_OUTPUT_DIR := \
e0f538c1694c 8156658: Common way to run jtreg tests
sla
parents: 37299
diff changeset
   126
    $(shell $(CD) $(TEST_OUTPUT_DIR)/jtreg && $(PWD))
7102
a20be5bfcbee 6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents: 5547
diff changeset
   127
else
37869
e0f538c1694c 8156658: Common way to run jtreg tests
sla
parents: 37299
diff changeset
   128
  ifdef ALT_OUTPUTDIR
e0f538c1694c 8156658: Common way to run jtreg tests
sla
parents: 37299
diff changeset
   129
    ABS_OUTPUTDIR = $(shell $(CD) $(ALT_OUTPUTDIR) && $(PWD))
e0f538c1694c 8156658: Common way to run jtreg tests
sla
parents: 37299
diff changeset
   130
  else
e0f538c1694c 8156658: Common way to run jtreg tests
sla
parents: 37299
diff changeset
   131
    ABS_OUTPUTDIR = $(shell $(CD) $(TEST_ROOT)/.. && $(PWD))
e0f538c1694c 8156658: Common way to run jtreg tests
sla
parents: 37299
diff changeset
   132
  endif
e0f538c1694c 8156658: Common way to run jtreg tests
sla
parents: 37299
diff changeset
   133
e0f538c1694c 8156658: Common way to run jtreg tests
sla
parents: 37299
diff changeset
   134
  ABS_PLATFORM_BUILD_ROOT = $(ABS_OUTPUTDIR)
e0f538c1694c 8156658: Common way to run jtreg tests
sla
parents: 37299
diff changeset
   135
  ABS_TEST_OUTPUT_DIR := $(ABS_PLATFORM_BUILD_ROOT)/testoutput/$(UNIQUE_DIR)
7102
a20be5bfcbee 6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents: 5547
diff changeset
   136
endif
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   137
1132
915051915ce9 6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents: 1
diff changeset
   138
# Expect JPRT to set PRODUCT_HOME (the product or jdk in this case to test)
915051915ce9 6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents: 1
diff changeset
   139
ifndef PRODUCT_HOME
37869
e0f538c1694c 8156658: Common way to run jtreg tests
sla
parents: 37299
diff changeset
   140
  # Try to use images/jdk if it exists
e0f538c1694c 8156658: Common way to run jtreg tests
sla
parents: 37299
diff changeset
   141
  ABS_JDK_IMAGE = $(ABS_PLATFORM_BUILD_ROOT)/images/jdk
e0f538c1694c 8156658: Common way to run jtreg tests
sla
parents: 37299
diff changeset
   142
  PRODUCT_HOME :=                       		\
e0f538c1694c 8156658: Common way to run jtreg tests
sla
parents: 37299
diff changeset
   143
    $(shell                             		\
e0f538c1694c 8156658: Common way to run jtreg tests
sla
parents: 37299
diff changeset
   144
      if [ -d $(ABS_JDK_IMAGE) ] ; then 		\
e0f538c1694c 8156658: Common way to run jtreg tests
sla
parents: 37299
diff changeset
   145
         $(ECHO) "$(ABS_JDK_IMAGE)";    		\
e0f538c1694c 8156658: Common way to run jtreg tests
sla
parents: 37299
diff changeset
   146
       else                             		\
e0f538c1694c 8156658: Common way to run jtreg tests
sla
parents: 37299
diff changeset
   147
         $(ECHO) "$(ABS_PLATFORM_BUILD_ROOT)";		\
1132
915051915ce9 6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents: 1
diff changeset
   148
       fi)
37869
e0f538c1694c 8156658: Common way to run jtreg tests
sla
parents: 37299
diff changeset
   149
  PRODUCT_HOME := $(PRODUCT_HOME)
1132
915051915ce9 6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents: 1
diff changeset
   150
endif
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   151
1132
915051915ce9 6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents: 1
diff changeset
   152
# Expect JPRT to set JAVA_ARGS (e.g. -server etc.)
29179
8836e3bd543b 8072842: Add support for building native JTReg tests
ihse
parents: 29075
diff changeset
   153
JAVA_OPTIONS =
1132
915051915ce9 6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents: 1
diff changeset
   154
ifdef JAVA_ARGS
915051915ce9 6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents: 1
diff changeset
   155
  JAVA_OPTIONS = $(JAVA_ARGS)
915051915ce9 6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents: 1
diff changeset
   156
endif
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   157
29179
8836e3bd543b 8072842: Add support for building native JTReg tests
ihse
parents: 29075
diff changeset
   158
# jtreg -nativepath <dir>
8836e3bd543b 8072842: Add support for building native JTReg tests
ihse
parents: 29075
diff changeset
   159
#
8836e3bd543b 8072842: Add support for building native JTReg tests
ihse
parents: 29075
diff changeset
   160
# Local make tests will be TEST_IMAGE_DIR and JPRT with jprt.use.reg.test.bundle=true
8836e3bd543b 8072842: Add support for building native JTReg tests
ihse
parents: 29075
diff changeset
   161
# should be JPRT_TESTNATIVE_PATH
8836e3bd543b 8072842: Add support for building native JTReg tests
ihse
parents: 29075
diff changeset
   162
ifdef TEST_IMAGE_DIR
8836e3bd543b 8072842: Add support for building native JTReg tests
ihse
parents: 29075
diff changeset
   163
  TESTNATIVE_DIR = $(TEST_IMAGE_DIR)
8836e3bd543b 8072842: Add support for building native JTReg tests
ihse
parents: 29075
diff changeset
   164
else ifdef JPRT_TESTNATIVE_PATH
8836e3bd543b 8072842: Add support for building native JTReg tests
ihse
parents: 29075
diff changeset
   165
  TESTNATIVE_DIR = $(JPRT_TESTNATIVE_PATH)
8836e3bd543b 8072842: Add support for building native JTReg tests
ihse
parents: 29075
diff changeset
   166
endif
8836e3bd543b 8072842: Add support for building native JTReg tests
ihse
parents: 29075
diff changeset
   167
ifdef TESTNATIVE_DIR
8836e3bd543b 8072842: Add support for building native JTReg tests
ihse
parents: 29075
diff changeset
   168
  JTREG_NATIVE_PATH = -nativepath:$(shell $(GETMIXEDPATH) "$(TESTNATIVE_DIR)/hotspot/jtreg/native")
8836e3bd543b 8072842: Add support for building native JTReg tests
ihse
parents: 29075
diff changeset
   169
endif
8836e3bd543b 8072842: Add support for building native JTReg tests
ihse
parents: 29075
diff changeset
   170
37299
db3b0d4c3bda 8149777: Enable enhanced failure handler for "make test"
erikj
parents: 35526
diff changeset
   171
# jtreg failure handler config
db3b0d4c3bda 8149777: Enable enhanced failure handler for "make test"
erikj
parents: 35526
diff changeset
   172
ifeq ($(FAILURE_HANDLER_DIR), )
db3b0d4c3bda 8149777: Enable enhanced failure handler for "make test"
erikj
parents: 35526
diff changeset
   173
  ifneq ($(TESTNATIVE_DIR), )
db3b0d4c3bda 8149777: Enable enhanced failure handler for "make test"
erikj
parents: 35526
diff changeset
   174
    FAILURE_HANDLER_DIR := $(TESTNATIVE_DIR)/failure_handler
db3b0d4c3bda 8149777: Enable enhanced failure handler for "make test"
erikj
parents: 35526
diff changeset
   175
  endif
db3b0d4c3bda 8149777: Enable enhanced failure handler for "make test"
erikj
parents: 35526
diff changeset
   176
endif
db3b0d4c3bda 8149777: Enable enhanced failure handler for "make test"
erikj
parents: 35526
diff changeset
   177
ifneq ($(FAILURE_HANDLER_DIR), )
db3b0d4c3bda 8149777: Enable enhanced failure handler for "make test"
erikj
parents: 35526
diff changeset
   178
  FAILURE_HANDLER_DIR_MIXED := $(shell $(GETMIXEDPATH) "$(FAILURE_HANDLER_DIR)")
db3b0d4c3bda 8149777: Enable enhanced failure handler for "make test"
erikj
parents: 35526
diff changeset
   179
  JTREG_FAILURE_HANDLER_OPTIONS := \
db3b0d4c3bda 8149777: Enable enhanced failure handler for "make test"
erikj
parents: 35526
diff changeset
   180
      -timeoutHandlerDir:$(FAILURE_HANDLER_DIR_MIXED)/jtregFailureHandler.jar \
db3b0d4c3bda 8149777: Enable enhanced failure handler for "make test"
erikj
parents: 35526
diff changeset
   181
      -observerDir:$(FAILURE_HANDLER_DIR_MIXED)/jtregFailureHandler.jar \
db3b0d4c3bda 8149777: Enable enhanced failure handler for "make test"
erikj
parents: 35526
diff changeset
   182
      -timeoutHandler:jdk.test.failurehandler.jtreg.GatherProcessInfoTimeoutHandler \
db3b0d4c3bda 8149777: Enable enhanced failure handler for "make test"
erikj
parents: 35526
diff changeset
   183
      -observer:jdk.test.failurehandler.jtreg.GatherDiagnosticInfoObserver
db3b0d4c3bda 8149777: Enable enhanced failure handler for "make test"
erikj
parents: 35526
diff changeset
   184
  ifeq ($(PLATFORM), windows)
db3b0d4c3bda 8149777: Enable enhanced failure handler for "make test"
erikj
parents: 35526
diff changeset
   185
    JTREG_FAILURE_HANDLER_OPTIONS += -J-Djava.library.path="$(FAILURE_HANDLER_DIR_MIXED)"
db3b0d4c3bda 8149777: Enable enhanced failure handler for "make test"
erikj
parents: 35526
diff changeset
   186
  endif
db3b0d4c3bda 8149777: Enable enhanced failure handler for "make test"
erikj
parents: 35526
diff changeset
   187
endif
db3b0d4c3bda 8149777: Enable enhanced failure handler for "make test"
erikj
parents: 35526
diff changeset
   188
1132
915051915ce9 6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents: 1
diff changeset
   189
# Expect JPRT to set JPRT_ARCHIVE_BUNDLE (path to zip bundle for results)
915051915ce9 6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents: 1
diff changeset
   190
ARCHIVE_BUNDLE = $(ABS_TEST_OUTPUT_DIR)/ARCHIVE_BUNDLE.zip
915051915ce9 6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents: 1
diff changeset
   191
ifdef JPRT_ARCHIVE_BUNDLE
915051915ce9 6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents: 1
diff changeset
   192
  ARCHIVE_BUNDLE = $(JPRT_ARCHIVE_BUNDLE)
915051915ce9 6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents: 1
diff changeset
   193
endif
915051915ce9 6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents: 1
diff changeset
   194
915051915ce9 6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents: 1
diff changeset
   195
# How to create the test bundle (pass or fail, we want to create this)
25628
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   196
#   Follow command with ";$(BUNDLE_UP_AND_EXIT)", so it always gets executed.
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   197
ZIP_UP_RESULTS = ( $(MKDIR) -p `$(DIRNAME) $(ARCHIVE_BUNDLE)`     \
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   198
	           && $(CD) $(ABS_TEST_OUTPUT_DIR)             \
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   199
	           && $(CHMOD) -R a+r . \
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   200
	           && $(ZIP) -q -r $(ARCHIVE_BUNDLE) . )
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   201
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   202
# important results files
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   203
SUMMARY_TXT = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/JTreport/text/summary.txt")
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   204
STATS_TXT_NAME = Stats.txt
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   205
STATS_TXT = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/$(STATS_TXT_NAME)")
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   206
RUNLIST   = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/runlist.txt")
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   207
PASSLIST  = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/passlist.txt")
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   208
FAILLIST  = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/faillist.txt")
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   209
EXITCODE  = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/exitcode.txt")
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   210
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   211
TESTEXIT = \
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   212
  if [ ! -s $(EXITCODE) ] ; then \
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   213
    $(ECHO) "ERROR: EXITCODE file not filled in."; \
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   214
    $(ECHO) "1" > $(EXITCODE); \
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   215
  fi ; \
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   216
  testExitCode=`$(CAT) $(EXITCODE)`; \
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   217
  $(ECHO) "EXIT CODE: $${testExitCode}"; \
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   218
  exit $${testExitCode}
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   219
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   220
BUNDLE_UP_AND_EXIT = \
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   221
( \
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   222
  jtregExitCode=$$? && \
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   223
  _summary="$(SUMMARY_TXT)"; \
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   224
  $(RM) -f $(STATS_TXT) $(RUNLIST) $(PASSLIST) $(FAILLIST) $(EXITCODE); \
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   225
  $(ECHO) "$${jtregExitCode}" > $(EXITCODE); \
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   226
  if [ -r "$${_summary}" ] ; then \
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   227
    $(ECHO) "Summary: $(UNIQUE_DIR)" > $(STATS_TXT); \
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   228
    $(EXPAND) $${_summary} | $(EGREP) -v ' Not run\.' > $(RUNLIST); \
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   229
    $(EGREP) ' Passed\.' $(RUNLIST) \
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   230
      | $(EGREP) -v ' Error\.' \
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   231
      | $(EGREP) -v ' Failed\.' > $(PASSLIST); \
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   232
    ( $(EGREP) ' Failed\.' $(RUNLIST); \
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   233
      $(EGREP) ' Error\.' $(RUNLIST); \
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   234
      $(EGREP) -v ' Passed\.' $(RUNLIST) ) \
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   235
      | $(SORT) | $(UNIQ) > $(FAILLIST); \
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   236
    if [ $${jtregExitCode} != 0 -o -s $(FAILLIST) ] ; then \
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   237
      $(EXPAND) $(FAILLIST) \
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   238
        | $(CUT) -d' ' -f1 \
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   239
        | $(SED) -e 's@^@FAILED: @' >> $(STATS_TXT); \
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   240
      if [ $${jtregExitCode} = 0 ] ; then \
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   241
        jtregExitCode=1; \
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   242
      fi; \
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   243
    fi; \
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   244
    runc="`$(CAT) $(RUNLIST)      | $(WC) -l | $(AWK) '{print $$1;}'`"; \
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   245
    passc="`$(CAT) $(PASSLIST)    | $(WC) -l | $(AWK) '{print $$1;}'`"; \
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   246
    failc="`$(CAT) $(FAILLIST)    | $(WC) -l | $(AWK) '{print $$1;}'`"; \
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   247
    exclc="FIXME CODETOOLS-7900176"; \
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   248
    $(ECHO) "TEST STATS: name=$(UNIQUE_DIR)  run=$${runc}  pass=$${passc}  fail=$${failc}" \
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   249
      >> $(STATS_TXT); \
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   250
  else \
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   251
    $(ECHO) "Missing file: $${_summary}" >> $(STATS_TXT); \
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   252
  fi; \
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   253
  if [ -f $(STATS_TXT) ] ; then \
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   254
    $(CAT) $(STATS_TXT); \
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   255
  fi; \
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   256
  $(ZIP_UP_RESULTS) ; \
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   257
  $(TESTEXIT) \
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   258
)
1132
915051915ce9 6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents: 1
diff changeset
   259
915051915ce9 6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents: 1
diff changeset
   260
################################################################
915051915ce9 6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents: 1
diff changeset
   261
915051915ce9 6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents: 1
diff changeset
   262
# Default make rule (runs jtreg_tests)
25628
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   263
all: hotspot_all
1132
915051915ce9 6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents: 1
diff changeset
   264
	@$(ECHO) "Testing completed successfully"
915051915ce9 6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents: 1
diff changeset
   265
25628
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   266
# Support "hotspot_" prefixed test make targets (too)
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   267
# The hotspot_% targets are used by the top level Makefile
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   268
# Unless explicitly defined below, hotspot_<x> is interpreted as a jtreg test group name
24433
492c1fb41098 8042804: Support invoking Hotspot tests from top level
mikael
parents: 22234
diff changeset
   269
hotspot_%:
25628
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   270
	$(ECHO) "Running tests: $@"
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   271
	$(MAKE) -j 1 TEST_SELECTION=":$@" UNIQUE_DIR=$@ jtreg_tests;
24433
492c1fb41098 8042804: Support invoking Hotspot tests from top level
mikael
parents: 22234
diff changeset
   272
33588
13edf132ffa0 8139256: Add Makefile target to run internal VM tests
ehelin
parents: 30595
diff changeset
   273
hotspot_internal:
13edf132ffa0 8139256: Add Makefile target to run internal VM tests
ehelin
parents: 30595
diff changeset
   274
	$(ALT_OUTPUTDIR)/jdk/bin/java -XX:+ExecuteInternalVMTests -XX:+ShowMessageBoxOnError -version
13edf132ffa0 8139256: Add Makefile target to run internal VM tests
ehelin
parents: 30595
diff changeset
   275
1132
915051915ce9 6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents: 1
diff changeset
   276
# Prep for output
915051915ce9 6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents: 1
diff changeset
   277
prep: clean
915051915ce9 6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents: 1
diff changeset
   278
	@$(MKDIR) -p $(ABS_TEST_OUTPUT_DIR)
915051915ce9 6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents: 1
diff changeset
   279
	@$(MKDIR) -p `dirname $(ARCHIVE_BUNDLE)`
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   280
489c9b5090e2 Initial load
duke
parents:
diff changeset
   281
# Cleanup
489c9b5090e2 Initial load
duke
parents:
diff changeset
   282
clean:
35505
2babb060aaf2 8146871: Make the clean target silent in hotspot/test/Makefile
ehelin
parents: 33588
diff changeset
   283
	@$(RM) -r $(ABS_TEST_OUTPUT_DIR)
2babb060aaf2 8146871: Make the clean target silent in hotspot/test/Makefile
ehelin
parents: 33588
diff changeset
   284
	@$(RM) $(ARCHIVE_BUNDLE)
1132
915051915ce9 6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents: 1
diff changeset
   285
915051915ce9 6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents: 1
diff changeset
   286
################################################################
915051915ce9 6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents: 1
diff changeset
   287
915051915ce9 6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents: 1
diff changeset
   288
# jtreg tests
915051915ce9 6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents: 1
diff changeset
   289
915051915ce9 6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents: 1
diff changeset
   290
# Expect JT_HOME to be set for jtreg tests. (home for jtreg)
17005
f7ab7c9c3784 8011678: test/Makefile should pick up JT_HOME environment variable
twisti
parents: 15239
diff changeset
   291
ifndef JT_HOME
25628
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   292
  JT_HOME = $(SLASH_JAVA)/re/jtreg/4.1/promoted/latest/binaries/jtreg
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   293
  ifdef JPRT_JTREG_HOME
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   294
    JT_HOME = $(JPRT_JTREG_HOME)
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   295
  endif
1132
915051915ce9 6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents: 1
diff changeset
   296
endif
915051915ce9 6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents: 1
diff changeset
   297
25628
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   298
# When called from JPRT the TESTDIRS variable is set to the jtreg tests to run
1132
915051915ce9 6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents: 1
diff changeset
   299
ifdef TESTDIRS
25628
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   300
  TEST_SELECTION = $(TESTDIRS)
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   301
endif
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   302
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   303
ifdef CONCURRENCY
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   304
  EXTRA_JTREG_OPTIONS += -concurrency:$(CONCURRENCY)
1132
915051915ce9 6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents: 1
diff changeset
   305
endif
915051915ce9 6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents: 1
diff changeset
   306
26922
8134a6d3fc02 8058936: hotspot/test/Makefile should use jtreg script from $JT_HOME/bin/jreg (instead of $JT_HOME/win32/bin/jtreg)
sla
parents: 26921
diff changeset
   307
# Default JTREG to run
8134a6d3fc02 8058936: hotspot/test/Makefile should use jtreg script from $JT_HOME/bin/jreg (instead of $JT_HOME/win32/bin/jtreg)
sla
parents: 26921
diff changeset
   308
JTREG = $(JT_HOME)/bin/jtreg
1132
915051915ce9 6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents: 1
diff changeset
   309
30249
faf83ebbf040 8077608: [TESTBUG] Enable Hotspot jtreg tests to run in agentvm mode
ctornqvi
parents: 29179
diff changeset
   310
# Use agent mode
faf83ebbf040 8077608: [TESTBUG] Enable Hotspot jtreg tests to run in agentvm mode
ctornqvi
parents: 29179
diff changeset
   311
JTREG_BASIC_OPTIONS += -agentvm
25628
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   312
# Only run automatic tests
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   313
JTREG_BASIC_OPTIONS += -a
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   314
# Report details on all failed or error tests, times too
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   315
JTREG_BASIC_OPTIONS += -v:fail,error,time
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   316
# Retain all files for failing tests
29075
ad5e1490d635 8073167: Undo change to -retain argument in hotspot/test/Makefile
cjplummer
parents: 29071
diff changeset
   317
JTREG_BASIC_OPTIONS += -retain:fail,error
25628
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   318
# Ignore tests are not run and completely silent about it
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   319
JTREG_IGNORE_OPTION = -ignore:quiet
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   320
JTREG_BASIC_OPTIONS += $(JTREG_IGNORE_OPTION)
28021
e19f567fcac2 8066508: JTReg tests timeout on slow devices when run using JPRT
cjplummer
parents: 26922
diff changeset
   321
# Multiply by 4 the timeout factor
e19f567fcac2 8066508: JTReg tests timeout on slow devices when run using JPRT
cjplummer
parents: 26922
diff changeset
   322
JTREG_TIMEOUT_OPTION =  -timeoutFactor:4
e19f567fcac2 8066508: JTReg tests timeout on slow devices when run using JPRT
cjplummer
parents: 26922
diff changeset
   323
JTREG_BASIC_OPTIONS += $(JTREG_TIMEOUT_OPTION)
25628
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   324
# Add any extra options
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   325
JTREG_BASIC_OPTIONS += $(EXTRA_JTREG_OPTIONS)
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   326
# Set other vm and test options
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   327
JTREG_TEST_OPTIONS = $(JAVA_ARGS:%=-javaoptions:%) $(JAVA_OPTIONS:%=-vmoption:%) $(JAVA_VM_ARGS:%=-vmoption:%)
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   328
1132
915051915ce9 6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents: 1
diff changeset
   329
# Option to tell jtreg to not run tests marked with "ignore"
915051915ce9 6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents: 1
diff changeset
   330
ifeq ($(PLATFORM), windows)
915051915ce9 6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents: 1
diff changeset
   331
  JTREG_KEY_OPTION = -k:!ignore
915051915ce9 6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents: 1
diff changeset
   332
else
915051915ce9 6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents: 1
diff changeset
   333
  JTREG_KEY_OPTION = -k:\!ignore
915051915ce9 6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents: 1
diff changeset
   334
endif
25628
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   335
JTREG_BASIC_OPTIONS += $(JTREG_KEY_OPTION)
1132
915051915ce9 6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents: 1
diff changeset
   336
30569
28d0b4c56125 8074016: Add convenient way of adding custom test targets to hotspot's test makefile
iaberg
parents: 30560
diff changeset
   337
-include $(ALT_MAKE)/Makefile
28d0b4c56125 8074016: Add convenient way of adding custom test targets to hotspot's test makefile
iaberg
parents: 30560
diff changeset
   338
25628
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   339
# Make sure jtreg exists
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   340
$(JTREG): $(JT_HOME)
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   341
25628
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   342
jtreg_tests: prep $(PRODUCT_HOME) $(JTREG)
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   343
	(                                                                    \
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   344
	  ( JT_HOME=$(shell $(GETMIXEDPATH) "$(JT_HOME)");                   \
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   345
            export JT_HOME;                                                  \
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   346
            $(shell $(GETMIXEDPATH) "$(JTREG)")                              \
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   347
              $(JTREG_BASIC_OPTIONS)                                         \
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   348
              -r:$(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/JTreport")  \
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   349
              -w:$(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/JTwork")    \
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   350
              -jdk:$(shell $(GETMIXEDPATH) "$(PRODUCT_HOME)")                \
29179
8836e3bd543b 8072842: Add support for building native JTReg tests
ihse
parents: 29075
diff changeset
   351
              $(JTREG_NATIVE_PATH)                                           \
37299
db3b0d4c3bda 8149777: Enable enhanced failure handler for "make test"
erikj
parents: 35526
diff changeset
   352
              $(JTREG_FAILURE_HANDLER_OPTIONS)                               \
25628
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   353
              $(JTREG_EXCLUSIONS)                                            \
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   354
              $(JTREG_TEST_OPTIONS)                                          \
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   355
              $(TEST_SELECTION)                                              \
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   356
	  ) ;                                                                \
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   357
	  $(BUNDLE_UP_AND_EXIT)                                              \
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   358
	) 2>&1 | $(TEE) $(ABS_TEST_OUTPUT_DIR)/output.txt ; $(TESTEXIT)
1132
915051915ce9 6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents: 1
diff changeset
   359
915051915ce9 6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents: 1
diff changeset
   360
PHONY_LIST += jtreg_tests
915051915ce9 6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents: 1
diff changeset
   361
27695
c6e0ac3339ac 8059732: improve hotspot_*test targets
iignatyev
parents: 26922
diff changeset
   362
# flags used to execute java in test targets
29179
8836e3bd543b 8072842: Add support for building native JTReg tests
ihse
parents: 29075
diff changeset
   363
TEST_FLAGS += -version -Xinternalversion -X -help
27695
c6e0ac3339ac 8059732: improve hotspot_*test targets
iignatyev
parents: 26922
diff changeset
   364
c6e0ac3339ac 8059732: improve hotspot_*test targets
iignatyev
parents: 26922
diff changeset
   365
sanitytest: prep $(PRODUCT_HOME)
c6e0ac3339ac 8059732: improve hotspot_*test targets
iignatyev
parents: 26922
diff changeset
   366
	@for flag in $(TEST_FLAGS);                                             \
c6e0ac3339ac 8059732: improve hotspot_*test targets
iignatyev
parents: 26922
diff changeset
   367
	do                                                                      \
c6e0ac3339ac 8059732: improve hotspot_*test targets
iignatyev
parents: 26922
diff changeset
   368
	    echo Executing java $(JAVA_OPTIONS) $$flag;                         \
c6e0ac3339ac 8059732: improve hotspot_*test targets
iignatyev
parents: 26922
diff changeset
   369
	    $(PRODUCT_HOME)/bin/java $(JAVA_OPTIONS) $$flag;                    \
c6e0ac3339ac 8059732: improve hotspot_*test targets
iignatyev
parents: 26922
diff changeset
   370
	    res=$$?;                                                            \
c6e0ac3339ac 8059732: improve hotspot_*test targets
iignatyev
parents: 26922
diff changeset
   371
	    if [ $$res -ne 0 ]; then                                            \
c6e0ac3339ac 8059732: improve hotspot_*test targets
iignatyev
parents: 26922
diff changeset
   372
	        exit $$res;                                                     \
c6e0ac3339ac 8059732: improve hotspot_*test targets
iignatyev
parents: 26922
diff changeset
   373
	    fi;                                                                 \
c6e0ac3339ac 8059732: improve hotspot_*test targets
iignatyev
parents: 26922
diff changeset
   374
	done
c6e0ac3339ac 8059732: improve hotspot_*test targets
iignatyev
parents: 26922
diff changeset
   375
c6e0ac3339ac 8059732: improve hotspot_*test targets
iignatyev
parents: 26922
diff changeset
   376
PHONY_LIST += sanitytest
c6e0ac3339ac 8059732: improve hotspot_*test targets
iignatyev
parents: 26922
diff changeset
   377
1132
915051915ce9 6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents: 1
diff changeset
   378
################################################################
915051915ce9 6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents: 1
diff changeset
   379
30267
e35e0c092042 8078017: Introduce hotspot_basicvmtest
mikael
parents: 29179
diff changeset
   380
# basicvmtest (make sure various basic java options work)
e35e0c092042 8078017: Introduce hotspot_basicvmtest
mikael
parents: 29179
diff changeset
   381
e35e0c092042 8078017: Introduce hotspot_basicvmtest
mikael
parents: 29179
diff changeset
   382
# Set up the directory in which the jvm directories live (client/, server/, etc.)
e35e0c092042 8078017: Introduce hotspot_basicvmtest
mikael
parents: 29179
diff changeset
   383
ifeq ($(PLATFORM),windows)
e35e0c092042 8078017: Introduce hotspot_basicvmtest
mikael
parents: 29179
diff changeset
   384
JVMS_DIR := $(PRODUCT_HOME)/bin
e35e0c092042 8078017: Introduce hotspot_basicvmtest
mikael
parents: 29179
diff changeset
   385
else ifeq ($(PLATFORM),bsd)
e35e0c092042 8078017: Introduce hotspot_basicvmtest
mikael
parents: 29179
diff changeset
   386
JVMS_DIR := $(PRODUCT_HOME)/lib
e35e0c092042 8078017: Introduce hotspot_basicvmtest
mikael
parents: 29179
diff changeset
   387
else
e35e0c092042 8078017: Introduce hotspot_basicvmtest
mikael
parents: 29179
diff changeset
   388
# The jvms live in the architecture directory (amd64, sparcv9,
e35e0c092042 8078017: Introduce hotspot_basicvmtest
mikael
parents: 29179
diff changeset
   389
# etc.). By using a wildcard there's no need to figure out the exact
e35e0c092042 8078017: Introduce hotspot_basicvmtest
mikael
parents: 29179
diff changeset
   390
# name of that directory.
e35e0c092042 8078017: Introduce hotspot_basicvmtest
mikael
parents: 29179
diff changeset
   391
JVMS_DIR := $(PRODUCT_HOME)/lib/*
e35e0c092042 8078017: Introduce hotspot_basicvmtest
mikael
parents: 29179
diff changeset
   392
endif
e35e0c092042 8078017: Introduce hotspot_basicvmtest
mikael
parents: 29179
diff changeset
   393
e35e0c092042 8078017: Introduce hotspot_basicvmtest
mikael
parents: 29179
diff changeset
   394
# Use the existance of a directory as a sign that jvm variant is available
e35e0c092042 8078017: Introduce hotspot_basicvmtest
mikael
parents: 29179
diff changeset
   395
CANDIDATE_JVM_VARIANTS := client minimal server
e35e0c092042 8078017: Introduce hotspot_basicvmtest
mikael
parents: 29179
diff changeset
   396
JVM_VARIANTS := $(strip $(foreach x,$(CANDIDATE_JVM_VARIANTS),$(if $(wildcard $(JVMS_DIR)/$(x)),$(x))))
e35e0c092042 8078017: Introduce hotspot_basicvmtest
mikael
parents: 29179
diff changeset
   397
e35e0c092042 8078017: Introduce hotspot_basicvmtest
mikael
parents: 29179
diff changeset
   398
hotspot_basicvmtest:
e35e0c092042 8078017: Introduce hotspot_basicvmtest
mikael
parents: 29179
diff changeset
   399
	for variant in $(JVM_VARIANTS);                                           \
e35e0c092042 8078017: Introduce hotspot_basicvmtest
mikael
parents: 29179
diff changeset
   400
	do                                                                        \
e35e0c092042 8078017: Introduce hotspot_basicvmtest
mikael
parents: 29179
diff changeset
   401
	    $(MAKE) JAVA_ARGS="$(JAVA_ARGS) -$$variant" hotspot_$${variant}test;  \
30594
e1b420c520a0 8079545: [TESTBUG] hotspot_basicvmtest doesn't fail even if VM crashes
mikael
parents: 30280
diff changeset
   402
	    res=$$?;                                                              \
e1b420c520a0 8079545: [TESTBUG] hotspot_basicvmtest doesn't fail even if VM crashes
mikael
parents: 30280
diff changeset
   403
	    if [ $$res -ne 0 ]; then                                              \
e1b420c520a0 8079545: [TESTBUG] hotspot_basicvmtest doesn't fail even if VM crashes
mikael
parents: 30280
diff changeset
   404
	        exit $$res;                                                       \
e1b420c520a0 8079545: [TESTBUG] hotspot_basicvmtest doesn't fail even if VM crashes
mikael
parents: 30280
diff changeset
   405
	    fi;                                                                   \
30267
e35e0c092042 8078017: Introduce hotspot_basicvmtest
mikael
parents: 29179
diff changeset
   406
	done
e35e0c092042 8078017: Introduce hotspot_basicvmtest
mikael
parents: 29179
diff changeset
   407
e35e0c092042 8078017: Introduce hotspot_basicvmtest
mikael
parents: 29179
diff changeset
   408
PHONY_LIST += hotspot_basicvmtest
e35e0c092042 8078017: Introduce hotspot_basicvmtest
mikael
parents: 29179
diff changeset
   409
e35e0c092042 8078017: Introduce hotspot_basicvmtest
mikael
parents: 29179
diff changeset
   410
################################################################
e35e0c092042 8078017: Introduce hotspot_basicvmtest
mikael
parents: 29179
diff changeset
   411
2868
051eb4af737f 6839151: Add a JPRT default test of -Xshare:dump when new hotspot is built
ohair
parents: 2105
diff changeset
   412
# clienttest (make sure various basic java client options work)
051eb4af737f 6839151: Add a JPRT default test of -Xshare:dump when new hotspot is built
ohair
parents: 2105
diff changeset
   413
27695
c6e0ac3339ac 8059732: improve hotspot_*test targets
iignatyev
parents: 26922
diff changeset
   414
hotspot_clienttest clienttest: sanitytest
2868
051eb4af737f 6839151: Add a JPRT default test of -Xshare:dump when new hotspot is built
ohair
parents: 2105
diff changeset
   415
	$(RM) $(PRODUCT_HOME)/jre/lib/*/client/classes.jsa
051eb4af737f 6839151: Add a JPRT default test of -Xshare:dump when new hotspot is built
ohair
parents: 2105
diff changeset
   416
	$(RM) $(PRODUCT_HOME)/jre/bin/client/classes.jsa
051eb4af737f 6839151: Add a JPRT default test of -Xshare:dump when new hotspot is built
ohair
parents: 2105
diff changeset
   417
	$(PRODUCT_HOME)/bin/java $(JAVA_OPTIONS) -Xshare:dump
051eb4af737f 6839151: Add a JPRT default test of -Xshare:dump when new hotspot is built
ohair
parents: 2105
diff changeset
   418
25628
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   419
PHONY_LIST += hotspot_clienttest clienttest
2868
051eb4af737f 6839151: Add a JPRT default test of -Xshare:dump when new hotspot is built
ohair
parents: 2105
diff changeset
   420
051eb4af737f 6839151: Add a JPRT default test of -Xshare:dump when new hotspot is built
ohair
parents: 2105
diff changeset
   421
################################################################
051eb4af737f 6839151: Add a JPRT default test of -Xshare:dump when new hotspot is built
ohair
parents: 2105
diff changeset
   422
26921
de18c35bc62d 8058919: Add sanity test for minimal VM in test/Makefile
dholmes
parents: 25628
diff changeset
   423
# minimaltest (make sure various basic java minimal options work)
de18c35bc62d 8058919: Add sanity test for minimal VM in test/Makefile
dholmes
parents: 25628
diff changeset
   424
27695
c6e0ac3339ac 8059732: improve hotspot_*test targets
iignatyev
parents: 26922
diff changeset
   425
hotspot_minimaltest minimaltest: sanitytest
26921
de18c35bc62d 8058919: Add sanity test for minimal VM in test/Makefile
dholmes
parents: 25628
diff changeset
   426
de18c35bc62d 8058919: Add sanity test for minimal VM in test/Makefile
dholmes
parents: 25628
diff changeset
   427
PHONY_LIST += hotspot_minimaltest minimaltest
de18c35bc62d 8058919: Add sanity test for minimal VM in test/Makefile
dholmes
parents: 25628
diff changeset
   428
de18c35bc62d 8058919: Add sanity test for minimal VM in test/Makefile
dholmes
parents: 25628
diff changeset
   429
################################################################
de18c35bc62d 8058919: Add sanity test for minimal VM in test/Makefile
dholmes
parents: 25628
diff changeset
   430
2868
051eb4af737f 6839151: Add a JPRT default test of -Xshare:dump when new hotspot is built
ohair
parents: 2105
diff changeset
   431
# servertest (make sure various basic java server options work)
051eb4af737f 6839151: Add a JPRT default test of -Xshare:dump when new hotspot is built
ohair
parents: 2105
diff changeset
   432
27695
c6e0ac3339ac 8059732: improve hotspot_*test targets
iignatyev
parents: 26922
diff changeset
   433
hotspot_servertest servertest: sanitytest
2868
051eb4af737f 6839151: Add a JPRT default test of -Xshare:dump when new hotspot is built
ohair
parents: 2105
diff changeset
   434
25628
ca4c7cff1573 8049071: Add jtreg jobs to JPRT for hotspot
mikael
parents: 24433
diff changeset
   435
PHONY_LIST += hotspot_servertest servertest
2868
051eb4af737f 6839151: Add a JPRT default test of -Xshare:dump when new hotspot is built
ohair
parents: 2105
diff changeset
   436
051eb4af737f 6839151: Add a JPRT default test of -Xshare:dump when new hotspot is built
ohair
parents: 2105
diff changeset
   437
################################################################
051eb4af737f 6839151: Add a JPRT default test of -Xshare:dump when new hotspot is built
ohair
parents: 2105
diff changeset
   438
1132
915051915ce9 6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents: 1
diff changeset
   439
# Phony targets (e.g. these are not filenames)
915051915ce9 6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents: 1
diff changeset
   440
.PHONY: all clean prep $(PHONY_LIST)
915051915ce9 6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents: 1
diff changeset
   441
915051915ce9 6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents: 1
diff changeset
   442
################################################################