make/RunTests.gmk
author jjg
Thu, 16 Nov 2017 15:17:47 -0800
changeset 47851 6a9bb4f77d50
parent 47329 43b33ee91ea0
child 47928 fb62d4519338
permissions -rw-r--r--
8190822: Remove dead code that could lead to invalid HTML Reviewed-by: bpatel, ksrini
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
44027
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
     1
#
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
     2
# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
     4
#
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
     7
# published by the Free Software Foundation.  Oracle designates this
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
     8
# particular file as subject to the "Classpath" exception as provided
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
     9
# by Oracle in the LICENSE file that accompanied this code.
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    10
#
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    11
# This code is distributed in the hope that it will be useful, but WITHOUT
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    14
# version 2 for more details (a copy is included in the LICENSE file that
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    15
# accompanied this code).
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    16
#
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    17
# You should have received a copy of the GNU General Public License version
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    18
# 2 along with this work; if not, write to the Free Software Foundation,
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    20
#
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    22
# or visit www.oracle.com if you need additional information or have any
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    23
# questions.
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    24
#
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    25
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    26
default: all
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    27
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    28
include $(SPEC)
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    29
include MakeBase.gmk
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    30
include FindTests.gmk
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    31
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    32
# We will always run multiple tests serially
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    33
.NOTPARALLEL:
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    34
47218
918745561887 8187445: Forest Consolidation: Make tests work
erikj
parents: 47058
diff changeset
    35
# Directories to find jtreg tests relative to
918745561887 8187445: Forest Consolidation: Make tests work
erikj
parents: 47058
diff changeset
    36
JTREG_TEST_TOPDIRS := $(TOPDIR) $(JTREG_TESTROOTS)
918745561887 8187445: Forest Consolidation: Make tests work
erikj
parents: 47058
diff changeset
    37
44027
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    38
# Hook to include the corresponding custom file, if present.
47314
743814386712 8188814: Simplify IncludeCustomExtension
ihse
parents: 47259
diff changeset
    39
$(eval $(call IncludeCustomExtension, RunTests.gmk))
44027
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    40
47253
92fd0e04e0e1 8187544: Replace BUILD_OUTPUT and OUTPUT_ROOT with OUTPUTDIR
ihse
parents: 47218
diff changeset
    41
TEST_RESULTS_DIR := $(OUTPUTDIR)/test-results
92fd0e04e0e1 8187544: Replace BUILD_OUTPUT and OUTPUT_ROOT with OUTPUTDIR
ihse
parents: 47218
diff changeset
    42
TEST_SUPPORT_DIR := $(OUTPUTDIR)/test-support
44027
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    43
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    44
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    45
################################################################################
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    46
# Parse control variables
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    47
################################################################################
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    48
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    49
$(eval $(call ParseKeywordVariable, JTREG, \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    50
    KEYWORDS := JOBS TIMEOUT TEST_MODE ASSERT VERBOSE RETAIN MAX_MEM, \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    51
    STRING_KEYWORDS := OPTIONS JAVA_OPTIONS VM_OPTIONS, \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    52
))
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    53
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    54
ifneq ($(JTREG), )
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    55
  # Inform the user
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    56
  $(info Running tests using JTREG control variable '$(JTREG)')
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    57
endif
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    58
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    59
$(eval $(call ParseKeywordVariable, GTEST, \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    60
    KEYWORDS := REPEAT, \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    61
    STRING_KEYWORDS := OPTIONS, \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    62
))
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    63
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    64
ifneq ($(GTEST), )
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    65
  # Inform the user
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    66
  $(info Running tests using GTEST control variable '$(GTEST)')
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    67
endif
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    68
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    69
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    70
################################################################################
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    71
# Component-specific Jtreg settings
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    72
################################################################################
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    73
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    74
ifeq ($(TEST_JOBS), 0)
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    75
  # If TEST_JOBS is not specified, hotspot fallback default is
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    76
  # min(num_cores / 2, 12).
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    77
  hotspot_JTREG_JOBS := $(shell $(EXPR) $(NUM_CORES) / 2)
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    78
  ifeq ($(hotspot_JTREG_JOBS), 0)
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    79
    hotspot_JTREG_JOBS := 1
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    80
  else ifeq ($(shell $(EXPR) $(hotspot_JTREG_JOBS) \> 12), 1)
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    81
    hotspot_JTREG_JOBS := 12
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    82
  endif
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    83
endif
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    84
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    85
hotspot_JTREG_MAX_MEM := 0
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    86
hotspot_JTREG_ASSERT := false
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    87
hotspot_JTREG_NATIVEPATH := $(TEST_IMAGE_DIR)/hotspot/jtreg/native
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    88
jdk_JTREG_NATIVEPATH := $(TEST_IMAGE_DIR)/jdk/jtreg/native
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    89
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    90
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    91
################################################################################
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    92
# Parse test selection
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    93
#
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    94
# The user has given a test selection in the TEST variable. We must parse it
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    95
# and determine what that means in terms of actual calls to the test framework.
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    96
#
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    97
# The parse functions take as argument a test specification as given by the
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    98
# user, and returns a fully qualified test descriptor if it was a match, or
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
    99
# nothing if not. A single test specification can result in multiple test
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   100
# descriptors being returned. A valid test descriptor must always be accepted
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   101
# and returned identically.
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   102
################################################################################
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   103
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   104
# Helper function to determine if a test specification is a Gtest test
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   105
#
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   106
# It is a Gtest test if it is either "gtest", or "gtest:" followed by an optional
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   107
# test filter string.
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   108
define ParseGtestTestSelection
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   109
  $(if $(filter gtest%, $1), \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   110
    $(if $(filter gtest, $1), \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   111
      gtest:all \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   112
    , \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   113
      $(if $(filter gtest:, $1), \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   114
        gtest:all \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   115
      , \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   116
        $1 \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   117
      ) \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   118
    ) \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   119
  )
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   120
endef
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   121
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   122
# Helper function to determine if a test specification is a Jtreg test
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   123
#
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   124
# It is a Jtreg test if it optionally begins with jtreg:, and then is either
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   125
# an unspecified group name (possibly prefixed by :), or a group in a
47218
918745561887 8187445: Forest Consolidation: Make tests work
erikj
parents: 47058
diff changeset
   126
# specified test/<component> directory, or a path to a test or test directory,
918745561887 8187445: Forest Consolidation: Make tests work
erikj
parents: 47058
diff changeset
   127
# either absolute or relative to any of the JTREG_TEST_TOPDIRS.
44027
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   128
define ParseJtregTestSelection
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   129
  $(eval TEST_NAME := $(strip $(patsubst jtreg:%, %, $1))) \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   130
  $(if $(or $(findstring :, $(TEST_NAME)), $(findstring /, $(TEST_NAME))), , \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   131
    $(eval TEST_NAME := :$(TEST_NAME)) \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   132
  ) \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   133
  $(if $(findstring :, $(TEST_NAME)), \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   134
    $(if $(filter :%, $(TEST_NAME)), \
47218
918745561887 8187445: Forest Consolidation: Make tests work
erikj
parents: 47058
diff changeset
   135
      $(foreach root, $(JTREG_TESTROOTS), \
44027
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   136
        $(if $(filter $(patsubst :%, %, $(TEST_NAME)), \
47218
918745561887 8187445: Forest Consolidation: Make tests work
erikj
parents: 47058
diff changeset
   137
            $($(root)_JTREG_TEST_GROUPS)), \
918745561887 8187445: Forest Consolidation: Make tests work
erikj
parents: 47058
diff changeset
   138
          jtreg:$(root):$(patsubst :%,%,$(TEST_NAME)) \
44027
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   139
        ) \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   140
      ) \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   141
    , \
47218
918745561887 8187445: Forest Consolidation: Make tests work
erikj
parents: 47058
diff changeset
   142
      $(eval ROOT_PART := $(word 1, $(subst :, $(SPACE), $(TEST_NAME)))) \
918745561887 8187445: Forest Consolidation: Make tests work
erikj
parents: 47058
diff changeset
   143
      $(eval ROOT := $(filter $(addprefix %, $(ROOT_PART)), $(JTREG_TESTROOTS))) \
44027
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   144
      $(eval GROUP := $(word 2, $(subst :, $(SPACE), $(TEST_NAME)))) \
47218
918745561887 8187445: Forest Consolidation: Make tests work
erikj
parents: 47058
diff changeset
   145
      $(foreach root, $(ROOT), \
918745561887 8187445: Forest Consolidation: Make tests work
erikj
parents: 47058
diff changeset
   146
        $(if $(filter $(GROUP), $($(root)_JTREG_TEST_GROUPS)), \
918745561887 8187445: Forest Consolidation: Make tests work
erikj
parents: 47058
diff changeset
   147
          jtreg:$(root):$(GROUP) \
44027
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   148
        ) \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   149
      ) \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   150
    ) \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   151
  , \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   152
    $(if $(filter /%, $(TEST_NAME)), \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   153
      $(if $(wildcard $(TEST_NAME)), \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   154
        jtreg:$(TEST_NAME) \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   155
      ) \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   156
    , \
47218
918745561887 8187445: Forest Consolidation: Make tests work
erikj
parents: 47058
diff changeset
   157
      $(addprefix jtreg:, $(wildcard $(addsuffix /$(TEST_NAME), $(JTREG_TEST_TOPDIRS)))) \
44027
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   158
    ) \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   159
  )
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   160
endef
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   161
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   162
ifeq ($(TEST), )
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   163
  $(info No test selection given in TEST!)
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   164
  $(info Please use e.g. 'run-test TEST=tier1' or 'run-test-tier1')
44511
f3c27401a860 8177955: Add testing documentation
ihse
parents: 44027
diff changeset
   165
  $(info See common/doc/testing.[md|html] for help)
44027
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   166
  $(error Cannot continue)
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   167
endif
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   168
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   169
# Now intelligently convert the test selection given by the user in TEST
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   170
# into a list of fully qualified test descriptors of the tests to run.
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   171
TESTS_TO_RUN :=
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   172
$(foreach test, $(TEST), \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   173
  $(eval PARSED_TESTS := $(call ParseCustomTestSelection, $(test))) \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   174
  $(if $(strip $(PARSED_TESTS)), , \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   175
    $(eval PARSED_TESTS += $(call ParseGtestTestSelection, $(test))) \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   176
  ) \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   177
  $(if $(strip $(PARSED_TESTS)), , \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   178
    $(eval PARSED_TESTS += $(call ParseJtregTestSelection, $(test))) \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   179
  ) \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   180
  $(if $(strip $(PARSED_TESTS)), , \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   181
    $(eval UNKNOWN_TEST := $(test)) \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   182
  ) \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   183
  $(eval TESTS_TO_RUN += $(PARSED_TESTS)) \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   184
)
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   185
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   186
ifneq ($(UNKNOWN_TEST), )
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   187
  $(info Unknown test selection: '$(UNKNOWN_TEST)')
44511
f3c27401a860 8177955: Add testing documentation
ihse
parents: 44027
diff changeset
   188
  $(info See common/doc/testing.[md|html] for help)
44027
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   189
  $(error Cannot continue)
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   190
endif
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   191
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   192
TESTS_TO_RUN := $(strip $(TESTS_TO_RUN))
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   193
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   194
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   195
# Present the result of our parsing to the user
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   196
$(info Test selection '$(TEST)', will run:)
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   197
$(foreach test, $(TESTS_TO_RUN), $(info * $(test)))
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   198
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   199
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   200
################################################################################
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   201
# Functions for setting up rules for running the selected tests
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   202
#
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   203
# The SetupRun*Test functions all have the same interface:
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   204
#
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   205
# Parameter 1 is the name of the rule. This is the test id, based on the test
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   206
# descriptor, and this is also used as variable prefix, and the targets
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   207
# generated are listed in a variable by that name.
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   208
#
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   209
# Remaining parameters are named arguments. Currently this is only:
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   210
#   TEST -- The properly formatted fully qualified test descriptor
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   211
#
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   212
# After the rule named by the test id has been executed, the following
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   213
# variables will be available:
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   214
# testid_TOTAL - the total number of tests run
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   215
# testid_PASSED - the number of successful tests
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   216
# testid_FAILED - the number of failed tests
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   217
# testid_ERROR - the number of tests was neither successful or failed
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   218
#
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   219
################################################################################
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   220
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   221
### Rules for Gtest
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   222
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   223
SetupRunGtestTest = $(NamedParamsMacroTemplate)
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   224
define SetupRunGtestTestBody
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   225
  $1_TEST_RESULTS_DIR := $$(TEST_RESULTS_DIR)/$1
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   226
  $1_TEST_SUPPORT_DIR := $$(TEST_SUPPORT_DIR)/$1
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   227
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   228
  $1_TEST_NAME := $$(strip $$(patsubst gtest:%, %, $$($1_TEST)))
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   229
  ifneq ($$($1_TEST_NAME), all)
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   230
    $1_GTEST_FILTER := --gtest_filter=$$($1_TEST_NAME)*
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   231
  endif
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   232
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   233
  ifneq ($$(GTEST_REPEAT), )
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   234
    $1_GTEST_REPEAT :=--gtest_repeat=$$(GTEST_REPEAT)
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   235
  endif
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   236
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   237
  run-test-$1:
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   238
	$$(call LogWarn)
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   239
	$$(call LogWarn, Running test '$$($1_TEST)')
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   240
	$$(call MakeDir, $$($1_TEST_RESULTS_DIR) $$($1_TEST_SUPPORT_DIR))
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   241
	$$(call ExecuteWithLog, $$($1_TEST_SUPPORT_DIR)/gtest, \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   242
	    $$(FIXPATH) $$(TEST_IMAGE_DIR)/hotspot/gtest/server/gtestLauncher \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   243
	    -jdk $(JDK_IMAGE_DIR) $$($1_GTEST_FILTER) \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   244
	    --gtest_output=xml:$$($1_TEST_RESULTS_DIR)/gtest.xml \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   245
	    $$($1_GTEST_REPEAT) $$(GTEST_OPTIONS) \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   246
	    > >($(TEE) $$($1_TEST_RESULTS_DIR)/gtest.txt) || true )
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   247
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   248
  $1_RESULT_FILE := $$($1_TEST_RESULTS_DIR)/gtest.txt
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   249
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   250
  parse-test-$1: run-test-$1
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   251
	$$(call LogWarn, Finished running test '$$($1_TEST)')
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   252
	$$(call LogWarn, Test report is stored in $$(strip \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   253
	    $$(subst $$(TOPDIR)/, , $$($1_TEST_RESULTS_DIR))))
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   254
	$$(eval $1_TOTAL := $$(shell $$(AWK) '/==========.* tests? from .* \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   255
	    test cases? ran/ { print $$$$2 }' $$($1_RESULT_FILE)))
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   256
	$$(eval $1_PASSED := $$(shell $$(AWK) '/\[  PASSED  \] .* tests?./ \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   257
	    { print $$$$4 }' $$($1_RESULT_FILE)))
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   258
	$$(eval $1_FAILED := $$(shell $$(AWK) '/\[  FAILED  \] .* tests?, \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   259
	    listed below/ { print $$$$4 }' $$($1_RESULT_FILE)))
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   260
	$$(if $$($1_FAILED), , $$(eval $1_FAILED := 0))
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   261
	$$(eval $1_ERROR := $$(shell \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   262
	    $$(EXPR) $$($1_TOTAL) - $$($1_PASSED) - $$($1_FAILED)))
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   263
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   264
  $1: run-test-$1 parse-test-$1
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   265
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   266
  TARGETS += $1
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   267
endef
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   268
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   269
################################################################################
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   270
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   271
### Rules for Jtreg
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   272
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   273
# Helper function for SetupRunJtregTest. Set a JTREG_* variable from, in order:
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   274
# 1) Specified by user on command line
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   275
# 2) Component-specific default
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   276
# 3) Generic default
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   277
#
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   278
# Note: No spaces are allowed around the arguments.
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   279
# Arg $1 The test ID (i.e. $1 in SetupRunJtregTest)
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   280
# Arg $2 Base variable, e.g. JTREG_JOBS
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   281
# Arg $3 The default value (optional)
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   282
define SetJtregValue
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   283
  ifneq ($$($2), )
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   284
    $1_$2 := $$($2)
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   285
  else
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   286
    ifneq ($$($$($1_COMPONENT)_$2), )
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   287
      $1_$2 := $$($$($1_COMPONENT)_$2)
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   288
    else
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   289
      ifneq ($3, )
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   290
        $1_$2 := $3
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   291
      endif
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   292
    endif
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   293
  endif
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   294
endef
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   295
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   296
SetupRunJtregTest = $(NamedParamsMacroTemplate)
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   297
define SetupRunJtregTestBody
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   298
  $1_TEST_RESULTS_DIR := $$(TEST_RESULTS_DIR)/$1
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   299
  $1_TEST_SUPPORT_DIR := $$(TEST_SUPPORT_DIR)/$1
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   300
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   301
  $1_TEST_NAME := $$(strip $$(patsubst jtreg:%, %, $$($1_TEST)))
47218
918745561887 8187445: Forest Consolidation: Make tests work
erikj
parents: 47058
diff changeset
   302
  $1_COMPONENT := $$(firstword $$(subst /, $$(SPACE), \
918745561887 8187445: Forest Consolidation: Make tests work
erikj
parents: 47058
diff changeset
   303
      $$(patsubst test/%, %, $$($1_TEST_NAME))))
44027
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   304
45104
b8a6cd8674d1 8180281: --with-jtreg is broken for many use cases
ihse
parents: 44511
diff changeset
   305
  ifeq ($$(JT_HOME), )
b8a6cd8674d1 8180281: --with-jtreg is broken for many use cases
ihse
parents: 44511
diff changeset
   306
    $$(info Error: jtreg framework is not found.)
b8a6cd8674d1 8180281: --with-jtreg is broken for many use cases
ihse
parents: 44511
diff changeset
   307
    $$(info Please run configure using --with-jtreg.)
b8a6cd8674d1 8180281: --with-jtreg is broken for many use cases
ihse
parents: 44511
diff changeset
   308
    $$(error Cannot continue)
b8a6cd8674d1 8180281: --with-jtreg is broken for many use cases
ihse
parents: 44511
diff changeset
   309
  endif
b8a6cd8674d1 8180281: --with-jtreg is broken for many use cases
ihse
parents: 44511
diff changeset
   310
44027
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   311
  # Unfortunately, we need different defaults for some JTREG values,
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   312
  # depending on what component we're running.
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   313
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   314
  # Convert JTREG_foo into $1_JTREG_foo with a suitable value.
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   315
  $$(eval $$(call SetJtregValue,$1,JTREG_TEST_MODE,agentvm))
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   316
  $$(eval $$(call SetJtregValue,$1,JTREG_ASSERT,true))
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   317
  $$(eval $$(call SetJtregValue,$1,JTREG_MAX_MEM,512m))
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   318
  $$(eval $$(call SetJtregValue,$1,JTREG_NATIVEPATH))
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   319
  $$(eval $$(call SetJtregValue,$1,JTREG_BASIC_OPTIONS))
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   320
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   321
  ifneq ($(TEST_JOBS), 0)
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   322
    # User has specified TEST_JOBS, use that as fallback default
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   323
    $$(eval $$(call SetJtregValue,$1,JTREG_JOBS,$$(TEST_JOBS)))
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   324
  else
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   325
    # Use JOBS as default (except for hotspot)
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   326
    $$(eval $$(call SetJtregValue,$1,JTREG_JOBS,$$(JOBS)))
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   327
  endif
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   328
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   329
  ifeq ($$(shell $$(EXPR) $$($1_JTREG_JOBS) \> 50), 1)
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   330
    # Until CODETOOLS-7901892 is fixed, JTreg cannot handle more than 50 jobs
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   331
    $1_JTREG_JOBS := 50
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   332
  endif
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   333
47058
85aaac5701da 8186248: Allow more flexibility in selecting Heap % of available RAM
bobv
parents: 46230
diff changeset
   334
  # Make sure MaxRAMPercentage is high enough to not cause OOM or swapping since
44027
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   335
  # we may end up with a lot of JVM's
47058
85aaac5701da 8186248: Allow more flexibility in selecting Heap % of available RAM
bobv
parents: 46230
diff changeset
   336
  $1_JTREG_MAX_RAM_PERCENTAGE := $$(shell $$(EXPR) 25 / $$($1_JTREG_JOBS))
44027
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   337
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   338
  JTREG_TIMEOUT ?= 4
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   339
  JTREG_VERBOSE ?= fail,error,summary
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   340
  JTREG_RETAIN ?= fail,error
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   341
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   342
  ifneq ($$($1_JTREG_MAX_MEM), 0)
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   343
    $1_JTREG_BASIC_OPTIONS += -vmoption:-Xmx$$($1_JTREG_MAX_MEM)
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   344
    $1_JTREG_LAUNCHER_OPTIONS += -Xmx$$($1_JTREG_MAX_MEM)
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   345
  endif
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   346
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   347
  $1_JTREG_BASIC_OPTIONS += -$$($1_JTREG_TEST_MODE) \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   348
      -verbose:$$(JTREG_VERBOSE) -retain:$$(JTREG_RETAIN) \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   349
      -concurrency:$$($1_JTREG_JOBS) -timeoutFactor:$$(JTREG_TIMEOUT) \
47058
85aaac5701da 8186248: Allow more flexibility in selecting Heap % of available RAM
bobv
parents: 46230
diff changeset
   350
      -vmoption:-XX:MaxRAMPercentage=$$($1_JTREG_MAX_RAM_PERCENTAGE)
44027
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   351
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   352
  $1_JTREG_BASIC_OPTIONS += -automatic -keywords:\!ignore -ignore:quiet
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   353
47329
43b33ee91ea0 8189115: Pass JIB_DATA_DIR to jtreg harness
ctornqvi
parents: 47314
diff changeset
   354
  # Make it possible to specify the JIB_DATA_DIR for tests using the
43b33ee91ea0 8189115: Pass JIB_DATA_DIR to jtreg harness
ctornqvi
parents: 47314
diff changeset
   355
  # JIB Artifact resolver
43b33ee91ea0 8189115: Pass JIB_DATA_DIR to jtreg harness
ctornqvi
parents: 47314
diff changeset
   356
  $1_JTREG_BASIC_OPTIONS += -e:JIB_DATA_DIR
44027
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   357
  # Some tests needs to find a boot JDK using the JDK8_HOME variable.
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   358
  $1_JTREG_BASIC_OPTIONS += -e:JDK8_HOME=$$(BOOT_JDK)
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   359
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   360
  $1_JTREG_BASIC_OPTIONS += \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   361
      $$(addprefix -javaoption:, $$(JTREG_JAVA_OPTIONS)) \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   362
      $$(addprefix -vmoption:, $$(JTREG_VM_OPTIONS)) \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   363
      #
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   364
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   365
  ifeq ($$($1_JTREG_ASSERT), true)
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   366
    $1_JTREG_BASIC_OPTIONS += -ea -esa
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   367
  endif
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   368
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   369
  ifneq ($$($1_JTREG_NATIVEPATH), )
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   370
    $1_JTREG_BASIC_OPTIONS += -nativepath:$$($1_JTREG_NATIVEPATH)
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   371
  endif
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   372
46230
e0ca0417b74d 8180600: make run-test does not work with jib test dependencies
erikj
parents: 45104
diff changeset
   373
  ifneq ($$(JIB_JAR), )
e0ca0417b74d 8180600: make run-test does not work with jib test dependencies
erikj
parents: 45104
diff changeset
   374
    $1_JTREG_BASIC_OPTIONS += -cpa:$$(JIB_JAR)
e0ca0417b74d 8180600: make run-test does not work with jib test dependencies
erikj
parents: 45104
diff changeset
   375
  endif
e0ca0417b74d 8180600: make run-test does not work with jib test dependencies
erikj
parents: 45104
diff changeset
   376
44027
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   377
  run-test-$1:
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   378
	$$(call LogWarn)
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   379
	$$(call LogWarn, Running test '$$($1_TEST)')
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   380
	$$(call MakeDir, $$($1_TEST_RESULTS_DIR) $$($1_TEST_SUPPORT_DIR))
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   381
	$$(call ExecuteWithLog, $$($1_TEST_SUPPORT_DIR)/jtreg, \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   382
	    $$(JAVA) $$($1_JTREG_LAUNCHER_OPTIONS) \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   383
	        -Dprogram=jtreg -jar $$(JT_HOME)/lib/jtreg.jar \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   384
	        $$($1_JTREG_BASIC_OPTIONS) \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   385
	        -testjdk:$$(JDK_IMAGE_DIR) \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   386
	        -dir:$$(TOPDIR) \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   387
	        -reportDir:$$($1_TEST_RESULTS_DIR) \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   388
	        -workDir:$$($1_TEST_SUPPORT_DIR) \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   389
	        $$(JTREG_OPTIONS) \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   390
	        $$($1_TEST_NAME) || true )
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   391
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   392
  $1_RESULT_FILE := $$($1_TEST_RESULTS_DIR)/text/stats.txt
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   393
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   394
  parse-test-$1: run-test-$1
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   395
	$$(call LogWarn, Finished running test '$$($1_TEST)')
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   396
	$$(call LogWarn, Test report is stored in $$(strip \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   397
	    $$(subst $$(TOPDIR)/, , $$($1_TEST_RESULTS_DIR))))
47259
0b347d8efb40 8187672: RunTest displays broken output if jtreg fails completely
ihse
parents: 47253
diff changeset
   398
	$$(if  $$(wildcard $$($1_RESULT_FILE)), \
0b347d8efb40 8187672: RunTest displays broken output if jtreg fails completely
ihse
parents: 47253
diff changeset
   399
	  $$(eval $1_PASSED := $$(shell $$(AWK) '{ gsub(/[,;]/, ""); \
0b347d8efb40 8187672: RunTest displays broken output if jtreg fails completely
ihse
parents: 47253
diff changeset
   400
	      for (i=1; i<=NF; i++) { if ($$$$i == "passed:") \
0b347d8efb40 8187672: RunTest displays broken output if jtreg fails completely
ihse
parents: 47253
diff changeset
   401
	      print $$$$(i+1) } }' $$($1_RESULT_FILE))) \
0b347d8efb40 8187672: RunTest displays broken output if jtreg fails completely
ihse
parents: 47253
diff changeset
   402
	  $$(if $$($1_PASSED), , $$(eval $1_PASSED := 0)) \
0b347d8efb40 8187672: RunTest displays broken output if jtreg fails completely
ihse
parents: 47253
diff changeset
   403
	  $$(eval $1_FAILED := $$(shell $$(AWK) '{gsub(/[,;]/, ""); \
0b347d8efb40 8187672: RunTest displays broken output if jtreg fails completely
ihse
parents: 47253
diff changeset
   404
	      for (i=1; i<=NF; i++) { if ($$$$i == "failed:") \
0b347d8efb40 8187672: RunTest displays broken output if jtreg fails completely
ihse
parents: 47253
diff changeset
   405
	      print $$$$(i+1) } }' $$($1_RESULT_FILE))) \
0b347d8efb40 8187672: RunTest displays broken output if jtreg fails completely
ihse
parents: 47253
diff changeset
   406
	  $$(if $$($1_FAILED), , $$(eval $1_FAILED := 0)) \
0b347d8efb40 8187672: RunTest displays broken output if jtreg fails completely
ihse
parents: 47253
diff changeset
   407
	  $$(eval $1_ERROR := $$(shell $$(AWK) '{gsub(/[,;]/, ""); \
0b347d8efb40 8187672: RunTest displays broken output if jtreg fails completely
ihse
parents: 47253
diff changeset
   408
	      for (i=1; i<=NF; i++) { if ($$$$i == "error:") \
0b347d8efb40 8187672: RunTest displays broken output if jtreg fails completely
ihse
parents: 47253
diff changeset
   409
	      print $$$$(i+1) } }' $$($1_RESULT_FILE))) \
0b347d8efb40 8187672: RunTest displays broken output if jtreg fails completely
ihse
parents: 47253
diff changeset
   410
	  $$(if $$($1_ERROR), , $$(eval $1_ERROR := 0)) \
0b347d8efb40 8187672: RunTest displays broken output if jtreg fails completely
ihse
parents: 47253
diff changeset
   411
	  $$(eval $1_TOTAL := $$(shell \
0b347d8efb40 8187672: RunTest displays broken output if jtreg fails completely
ihse
parents: 47253
diff changeset
   412
	      $$(EXPR) $$($1_PASSED) + $$($1_FAILED) + $$($1_ERROR))) \
0b347d8efb40 8187672: RunTest displays broken output if jtreg fails completely
ihse
parents: 47253
diff changeset
   413
	, \
0b347d8efb40 8187672: RunTest displays broken output if jtreg fails completely
ihse
parents: 47253
diff changeset
   414
	  $$(eval $1_PASSED := 0) \
0b347d8efb40 8187672: RunTest displays broken output if jtreg fails completely
ihse
parents: 47253
diff changeset
   415
	  $$(eval $1_FAILED := 0) \
0b347d8efb40 8187672: RunTest displays broken output if jtreg fails completely
ihse
parents: 47253
diff changeset
   416
	  $$(eval $1_ERROR := 1) \
0b347d8efb40 8187672: RunTest displays broken output if jtreg fails completely
ihse
parents: 47253
diff changeset
   417
	  $$(eval $1_TOTAL := 1) \
0b347d8efb40 8187672: RunTest displays broken output if jtreg fails completely
ihse
parents: 47253
diff changeset
   418
	)
44027
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   419
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   420
  $1: run-test-$1 parse-test-$1
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   421
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   422
  TARGETS += $1
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   423
endef
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   424
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   425
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   426
################################################################################
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   427
# Setup and execute make rules for all selected tests
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   428
################################################################################
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   429
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   430
# Helper function to determine which handler to use for the given test
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   431
UseGtestTestHandler = \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   432
  $(if $(filter gtest:%, $1), true)
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   433
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   434
UseJtregTestHandler = \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   435
  $(if $(filter jtreg:%, $1), true)
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   436
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   437
# Now process each test to run and setup a proper make rule
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   438
$(foreach test, $(TESTS_TO_RUN), \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   439
  $(eval TEST_ID := $(shell $(ECHO) $(strip $(test)) | \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   440
      $(TR) -cs '[a-z][A-Z][0-9]\n' '_')) \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   441
  $(eval ALL_TEST_IDS += $(TEST_ID)) \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   442
  $(if $(call UseCustomTestHandler, $(test)), \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   443
    $(eval $(call SetupRunCustomTest, $(TEST_ID), \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   444
        TEST := $(test), \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   445
    )) \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   446
  ) \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   447
  $(if $(call UseGtestTestHandler, $(test)), \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   448
    $(eval $(call SetupRunGtestTest, $(TEST_ID), \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   449
        TEST := $(test), \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   450
    )) \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   451
  ) \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   452
  $(if $(call UseJtregTestHandler, $(test)), \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   453
    $(eval $(call SetupRunJtregTest, $(TEST_ID), \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   454
        TEST := $(test), \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   455
    )) \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   456
  ) \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   457
)
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   458
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   459
# Sort also removes duplicates, so if there is any we'll get fewer words.
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   460
ifneq ($(words $(ALL_TEST_IDS)), $(words $(sort $(ALL_TEST_IDS))))
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   461
  $(error Duplicate test specification)
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   462
endif
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   463
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   464
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   465
################################################################################
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   466
# The main target for RunTests.gmk
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   467
################################################################################
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   468
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   469
# The SetupRun*Test functions have populated TARGETS.
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   470
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   471
TEST_FAILURE := false
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   472
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   473
run-test: $(TARGETS)
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   474
        # Print a table of the result of all tests run and their result
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   475
	$(ECHO)
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   476
	$(ECHO) ==============================
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   477
	$(ECHO) Test summary
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   478
	$(ECHO) ==============================
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   479
	$(PRINTF) "%2s %-49s %5s %5s %5s %5s %2s\n" "  " TEST \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   480
	    TOTAL PASS FAIL ERROR " "
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   481
	$(foreach test, $(TESTS_TO_RUN), \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   482
	  $(eval TEST_ID := $(shell $(ECHO) $(strip $(test)) | \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   483
	      $(TR) -cs '[a-z][A-Z][0-9]\n' '_')) \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   484
	  $(if $(filter $($(TEST_ID)_PASSED), $($(TEST_ID)_TOTAL)), \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   485
	    $(PRINTF) "%2s %-49s %5d %5d %5d %5d %2s\n" "  " "$(test)" \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   486
	        $($(TEST_ID)_TOTAL) $($(TEST_ID)_PASSED) $($(TEST_ID)_FAILED) \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   487
	        $($(TEST_ID)_ERROR) "  " $(NEWLINE) \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   488
	  , \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   489
	    $(PRINTF) "%2s %-49s %5d %5d %5d %5d %2s\n" ">>" "$(test)" \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   490
	        $($(TEST_ID)_TOTAL) $($(TEST_ID)_PASSED) $($(TEST_ID)_FAILED) \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   491
	        $($(TEST_ID)_ERROR) "<<" $(NEWLINE) \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   492
	    $(eval TEST_FAILURE := true) \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   493
	  ) \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   494
	)
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   495
	$(ECHO) ==============================
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   496
	$(if $(filter true, $(TEST_FAILURE)), \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   497
	  $(ECHO) TEST FAILURE $(NEWLINE) \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   498
	  $(TOUCH) $(MAKESUPPORT_OUTPUTDIR)/exit-with-error \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   499
	, \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   500
	  $(ECHO) TEST SUCCESS \
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   501
	)
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   502
	$(ECHO)
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   503
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   504
################################################################################
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   505
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   506
all: run-test
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   507
3a3050924db2 8176084: Developer-friendly run-test facility
ihse
parents:
diff changeset
   508
.PHONY: default all run-test $(TARGETS)