2015-11-24 18:32:46 +00:00
|
|
|
#
|
2021-06-10 17:45:53 +00:00
|
|
|
# Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved.
|
2015-11-24 18:32:46 +00:00
|
|
|
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
|
|
#
|
|
|
|
# This code is free software; you can redistribute it and/or modify it
|
|
|
|
# under the terms of the GNU General Public License version 2 only, as
|
|
|
|
# published by the Free Software Foundation.
|
|
|
|
#
|
|
|
|
# This code is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
|
|
# version 2 for more details (a copy is included in the LICENSE file that
|
|
|
|
# accompanied this code).
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License version
|
|
|
|
# 2 along with this work; if not, write to the Free Software Foundation,
|
|
|
|
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
#
|
|
|
|
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
|
|
# or visit www.oracle.com if you need additional information or have any
|
|
|
|
# questions.
|
|
|
|
#
|
|
|
|
|
|
|
|
#
|
|
|
|
# This is a temporary standalone makefile
|
|
|
|
#
|
|
|
|
|
|
|
|
BUILD_DIR := $(shell pwd)/build
|
|
|
|
CLASSES_DIR := ${BUILD_DIR}/classes
|
|
|
|
IMAGE_DIR := ${BUILD_DIR}/image
|
|
|
|
RUN_DIR := $(shell pwd)/run
|
2016-02-16 12:25:45 +00:00
|
|
|
CLASSPATH := ${JTREG_HOME}/lib/jtreg.jar:${JAVA_HOME}/lib/tools.jar
|
2015-11-24 18:32:46 +00:00
|
|
|
SRC_DIR := src/share/classes/
|
|
|
|
SOURCES := ${SRC_DIR}/jdk/test/failurehandler/*.java \
|
|
|
|
${SRC_DIR}/jdk/test/failurehandler/action/*.java \
|
|
|
|
${SRC_DIR}/jdk/test/failurehandler/jtreg/*.java \
|
|
|
|
${SRC_DIR}/jdk/test/failurehandler/value/*.java
|
|
|
|
|
|
|
|
CONF_DIR = src/share/conf
|
|
|
|
|
2021-06-10 17:45:53 +00:00
|
|
|
JAVA_RELEASE = 15
|
2015-11-24 18:32:46 +00:00
|
|
|
|
|
|
|
TARGET_JAR = ${IMAGE_DIR}/lib/jtregFailureHandler.jar
|
|
|
|
|
|
|
|
OS_NAME := $(shell uname -o 2>&1)
|
|
|
|
|
|
|
|
ifeq ("${OS_NAME}", "Cygwin")
|
|
|
|
BUILD_DIR := $(shell cygpath -m "${BUILD_DIR}")
|
|
|
|
CLASSES_DIR := $(shell cygpath -m "${CLASSES_DIR}")
|
2016-02-16 12:25:45 +00:00
|
|
|
IMAGE_DIR := $(shell cygpath -m "${IMAGE_DIR}")
|
|
|
|
RUN_DIR := $(shell cygpath -m "${RUN_DIR}")
|
2015-11-24 18:32:46 +00:00
|
|
|
SRC_DIR := $(shell cygpath -m "${SRC_DIR}")
|
2016-02-16 12:25:45 +00:00
|
|
|
JAVA_HOME := $(shell cygpath -m "${JAVA_HOME}")
|
2015-11-24 18:32:46 +00:00
|
|
|
JTREG_HOME := $(shell cygpath -m "${JTREG_HOME}")
|
2016-02-16 12:25:45 +00:00
|
|
|
CLASSPATH := $(shell cygpath -pm "${CLASSPATH}")
|
2015-11-24 18:32:46 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
all: clean test
|
|
|
|
|
|
|
|
check_defined = $(foreach 1,$1,$(__check_defined))
|
|
|
|
__check_defined = $(if $(value $1),, $(error $1 is not set))
|
|
|
|
|
|
|
|
classes: require_env
|
2016-02-16 12:25:45 +00:00
|
|
|
mkdir -p ${IMAGE_DIR}/bin ${IMAGE_DIR}/lib ${CLASSES_DIR}
|
|
|
|
"${JAVA_HOME}"/bin/javac -target ${JAVA_RELEASE} -source ${JAVA_RELEASE} \
|
|
|
|
-sourcepath "$(shell pwd)" \
|
|
|
|
-cp "${CLASSPATH}" \
|
|
|
|
-d ${CLASSES_DIR} \
|
2015-11-24 18:32:46 +00:00
|
|
|
${SOURCES}
|
2016-02-16 12:25:45 +00:00
|
|
|
"${JAVA_HOME}"/bin/jar cf "${TARGET_JAR}" -C "${CLASSES_DIR}" .
|
|
|
|
"${JAVA_HOME}"/bin/jar uf "${TARGET_JAR}" -C "${CONF_DIR}" .
|
2015-11-24 18:32:46 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Use JTREG_TEST_OPTS for test VM options
|
|
|
|
# Use JTREG_TESTS for jtreg tests parameter
|
|
|
|
#
|
|
|
|
test: require_env build
|
2016-02-16 12:25:45 +00:00
|
|
|
rm -rf "${RUN_DIR}"
|
|
|
|
mkdir -p "${RUN_DIR}"
|
2016-10-24 07:12:40 +00:00
|
|
|
"${JTREG_HOME}"/bin/jtreg \
|
2015-11-24 18:32:46 +00:00
|
|
|
-jdk:"${JAVA_HOME}" \
|
|
|
|
${JTREG_TEST_OPTS} \
|
|
|
|
-timeout:0.1 -va -retain:all \
|
|
|
|
-noreport \
|
|
|
|
-agentvm \
|
|
|
|
-thd:"${TARGET_JAR}" \
|
|
|
|
-th:jdk.test.failurehandler.jtreg.GatherProcessInfoTimeoutHandler \
|
2016-10-24 07:12:40 +00:00
|
|
|
-thtimeout:0 \
|
2015-11-24 18:32:46 +00:00
|
|
|
-od:"${TARGET_JAR}" \
|
|
|
|
-o:jdk.test.failurehandler.jtreg.GatherDiagnosticInfoObserver \
|
2016-02-16 12:25:45 +00:00
|
|
|
-w:"${RUN_DIR}/JTwork" \
|
|
|
|
-r:"${RUN_DIR}/JTreport" \
|
2015-11-24 18:32:46 +00:00
|
|
|
$(if ${JTREG_TESTS}, ${JTREG_TESTS}, test) \
|
|
|
|
&& false || true
|
|
|
|
|
|
|
|
debug: JTREG_TEST_OPTS += "-J-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005'"
|
|
|
|
debug: test
|
|
|
|
|
|
|
|
require_env:
|
2016-02-16 12:25:45 +00:00
|
|
|
$(call check_defined, JAVA_HOME)
|
|
|
|
$(call check_defined, JTREG_HOME)
|
2015-11-24 18:32:46 +00:00
|
|
|
|
|
|
|
clean:
|
2016-02-16 12:25:45 +00:00
|
|
|
rm -rf "${BUILD_DIR}" "${RUN_DIR}"
|
2015-11-24 18:32:46 +00:00
|
|
|
|
2021-06-14 19:35:24 +00:00
|
|
|
build: classes
|
2015-11-24 18:32:46 +00:00
|
|
|
|
2021-06-14 19:35:24 +00:00
|
|
|
.PHONY: all build classes test require_env clean
|
2015-11-24 18:32:46 +00:00
|
|
|
.DEFAULT: all
|