make/RunTestsPrebuilt.gmk
author ihse
Mon, 27 Nov 2017 12:29:28 +0100
branchihse-testmakefiles-branch
changeset 55882 79c94bfb654e
parent 55881 dbf68259f80e
child 55884 9ee155c19c6a
permissions -rw-r--r--
Use OUTPUTDIR instead of OUTPUT_ROOT.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
55881
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
     1
#
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
     2
# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
     4
#
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
     7
# published by the Free Software Foundation.  Oracle designates this
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
     8
# particular file as subject to the "Classpath" exception as provided
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
     9
# by Oracle in the LICENSE file that accompanied this code.
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    10
#
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    11
# This code is distributed in the hope that it will be useful, but WITHOUT
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    14
# version 2 for more details (a copy is included in the LICENSE file that
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    15
# accompanied this code).
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    16
#
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    17
# You should have received a copy of the GNU General Public License version
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    18
# 2 along with this work; if not, write to the Free Software Foundation,
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    20
#
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    22
# or visit www.oracle.com if you need additional information or have any
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    23
# questions.
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    24
#
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    25
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    26
# FIXME
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    27
export BASH := bash
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    28
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    29
# FIXME: hardcoded!
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    30
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    31
PRODUCT_HOME=/var/tmp/jib-magnusi/install/jdk/10/22/linux-x64.jdk/jdk-10
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    32
JT_JAVA=/var/tmp/jib-magnusi/install/java/re/jdk/8/promoted/latest/bundles/linux-x64/jdk-8-linux-x64.tar.gz/jdk1.8.0
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    33
TEST_IMAGE_DIR=/var/tmp/jib-magnusi/install/jdk/10/22/linux-x64.test
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    34
JT_HOME=/var/tmp/jib-magnusi/install/java/re/jtreg/4.2/promoted/all/b08/bundles/jtreg_bin-4.2.zip/jtreg
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    35
TONGA_HOME=/var/tmp/jib-magnusi/install/jpg/infra/builddeps/tonga/4.0.0_May_12_2014+1.0/tonga-4.0.0_May_12_2014+1.0.zip
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    36
TEST_OUTPUT_DIR=/tmp/ihse/test-out
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    37
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    38
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    39
# In Cygwin, the MAKE variable gets prepended with the current directory if the
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    40
# make executable is called using a Windows mixed path (c:/cygwin/bin/make.exe).
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    41
ifneq ($(findstring :, $(MAKE)), )
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    42
  export MAKE := $(patsubst $(CURDIR)%, %, $(patsubst $(CURDIR)/%, %, $(MAKE)))
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    43
endif
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    44
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    45
# Locate this Makefile
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    46
ifeq ($(filter /%, $(lastword $(MAKEFILE_LIST))),)
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    47
  makefile_path := $(CURDIR)/$(strip $(lastword $(MAKEFILE_LIST)))
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    48
else
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    49
  makefile_path := $(lastword $(MAKEFILE_LIST))
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    50
endif
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    51
topdir := $(strip $(patsubst %/make/, %, $(dir $(makefile_path))))
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    52
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    53
################################################################################
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    54
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    55
export JDK_IMAGE_DIR := $(PRODUCT_HOME)
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    56
export BOOT_JDK := $(JT_JAVA)
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    57
export BUILD_OUTPUT := $(TEST_OUTPUT_DIR)
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    58
export TONGA_JAR := $(TONGA_HOME)/tonga.jar
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    59
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    60
# keep names, but verify
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    61
export TEST_IMAGE_DIR
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    62
export JT_HOME
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    63
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    64
export TOPDIR := $(topdir)
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    65
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    66
LOG_LEVEL:=debug
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    67
SPEC := $(topdir)/make/RunTestsPrebuiltSpec.gmk
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    68
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    69
# Now transform ourself to somewhat resembling sanity, but still just using the
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    70
# hard-coded spec
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    71
include $(SPEC)
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    72
$(info spec is $(SPEC))
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    73
include $(topdir)/make/common/MakeBase.gmk
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    74
$(info inluced)
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    75
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    76
NEW_SPEC := $(TEST_OUTPUT_DIR)/spec.gmk
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    77
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    78
define CreateNewSpec
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    79
  $(if $(strip $(13)), \
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    80
    $(error Internal makefile error: \
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    81
      Too many arguments to macro, please update CreateNewSpec in RunTestsPrebuilt.gmk) \
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    82
  ) \
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    83
  $(shell rm -f $(NEW_SPEC)) \
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    84
  $(foreach i, 1 2 3 4 5 6 7 8 9 10 11 12, \
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    85
    $(if $(strip $($i)), \
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    86
      $(call AppendFile, $(strip $($i)), $(NEW_SPEC)) \
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    87
    ) \
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    88
  )
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    89
endef
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    90
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    91
define VerifyVariable
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    92
  ifeq ($$($1), )
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    93
    $$(info Error: Variable $1 is missing, needed for run-tests-prebuilt)
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    94
    $$(error Cannot continue.)
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    95
  else
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    96
    ifneq ($$(findstring $$(LOG_LEVEL), debug trace), )
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    97
      $$(info Prebuilt variable $1=$$($1))
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    98
    endif
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    99
  endif
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   100
endef
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   101
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   102
$(eval $(call VerifyVariable,TOPDIR))
55882
79c94bfb654e Use OUTPUTDIR instead of OUTPUT_ROOT.
ihse
parents: 55881
diff changeset
   103
$(eval $(call VerifyVariable,OUTPUTDIR))
55881
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   104
$(eval $(call VerifyVariable,BOOT_JDK))
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   105
$(eval $(call VerifyVariable,JDK_IMAGE_DIR))
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   106
$(eval $(call VerifyVariable,TEST_IMAGE_DIR))
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   107
$(eval $(call VerifyVariable,JT_HOME))
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   108
$(eval $(call VerifyVariable,TONGA_JAR))
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   109
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   110
$(call CreateNewSpec, \
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   111
    # Generated file -- do not edit!, \
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   112
    SPEC := $(NEW_SPEC), \
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   113
    TOPDIR := $(topdir), \
55882
79c94bfb654e Use OUTPUTDIR instead of OUTPUT_ROOT.
ihse
parents: 55881
diff changeset
   114
    OUTPUTDIR := $(OUTPUTDIR), \
55881
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   115
    BOOT_JDK := $(BOOT_JDK), \
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   116
    JDK_IMAGE_DIR := $(JDK_IMAGE_DIR), \
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   117
    TEST_IMAGE_DIR := $(TEST_IMAGE_DIR), \
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   118
    JT_HOME := $(JT_HOME), \
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   119
    TONGA_JAR := $(TONGA_JAR), \
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   120
    include $(topdir)/make/RunTestsPrebuiltSpec.gmk, \
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   121
)
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   122
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   123
################################################################################
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   124
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   125
default: all
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   126
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   127
run-test:
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   128
	@$(RM) -f $(MAKESUPPORT_OUTPUTDIR)/exit-with-error
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   129
	@cd $(topdir) && $(MAKE) -r -R -j 1 -s -I make/common/ \
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   130
	    SPEC=$(NEW_SPEC) \
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   131
	    -f make/RunTests.gmk run-test TEST="$(TEST)"
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   132
	@if test -f $(MAKESUPPORT_OUTPUTDIR)/exit-with-error ; then \
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   133
	  exit 1 ; \
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   134
	fi
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   135
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   136
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   137
all: run-test
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   138
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   139
.PHONY: default all