Skip to content

Commit

Permalink
8211977: move testlibrary tests into one place
Browse files Browse the repository at this point in the history
Reviewed-by: erikj, dholmes, ihse
  • Loading branch information
iignatev committed Jun 16, 2020
1 parent 5073b8c commit e7f8e1f
Show file tree
Hide file tree
Showing 35 changed files with 243 additions and 605 deletions.
15 changes: 14 additions & 1 deletion make/Main.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,18 @@ $(eval $(call SetupTarget, test-image-jdk-jtreg-native, \
DEPS := build-test-jdk-jtreg-native, \
))

$(eval $(call SetupTarget, build-test-libtest-jtreg-native, \
MAKEFILE := test/JtregNativeLibTest, \
TARGET := build-test-libtest-jtreg-native, \
DEPS := buildtools-jdk, \
))

$(eval $(call SetupTarget, test-image-libtest-jtreg-native, \
MAKEFILE := test/JtregNativeLibTest, \
TARGET := test-image-libtest-jtreg-native, \
DEPS := build-test-libtest-jtreg-native, \
))

$(eval $(call SetupTarget, build-test-hotspot-jtreg-graal, \
MAKEFILE := test/JtregGraalUnit, \
TARGET := build-test-hotspot-jtreg-graal, \
Expand Down Expand Up @@ -982,6 +994,7 @@ else
interim-image: $(INTERIM_JMOD_TARGETS)

build-test-hotspot-jtreg-native: hotspot-$(JVM_VARIANT_MAIN)-libs
build-test-libtest-jtreg-native: hotspot-$(JVM_VARIANT_MAIN)-libs

endif

Expand Down Expand Up @@ -1105,7 +1118,7 @@ endif
docs-image: docs-jdk

# This target builds the test image
test-image: prepare-test-image test-image-jdk-jtreg-native test-image-demos-jdk
test-image: prepare-test-image test-image-jdk-jtreg-native test-image-demos-jdk test-image-libtest-jtreg-native

ifneq ($(JVM_TEST_IMAGE_TARGETS), )
# If JVM_TEST_IMAGE_TARGETS is externally defined, use it instead of the
Expand Down
2 changes: 2 additions & 0 deletions make/RunTests.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -342,11 +342,13 @@ hotspot_JTREG_MAX_MEM := 0
hotspot_JTREG_ASSERT := false
hotspot_JTREG_NATIVEPATH := $(TEST_IMAGE_DIR)/hotspot/jtreg/native
jdk_JTREG_NATIVEPATH := $(TEST_IMAGE_DIR)/jdk/jtreg/native
lib-test_JTREG_NATIVEPATH := $(TEST_IMAGE_DIR)/lib-test/jtreg/native

jdk_JTREG_PROBLEM_LIST += $(TOPDIR)/test/jdk/ProblemList.txt
jaxp_JTREG_PROBLEM_LIST += $(TOPDIR)/test/jaxp/ProblemList.txt
langtools_JTREG_PROBLEM_LIST += $(TOPDIR)/test/langtools/ProblemList.txt
hotspot_JTREG_PROBLEM_LIST += $(TOPDIR)/test/hotspot/jtreg/ProblemList.txt
lib-test_JTREG_PROBLEM_LIST += $(TOPDIR)/test/lib-test/ProblemList.txt

langtools_JTREG_MAX_MEM := 768m

Expand Down
2 changes: 1 addition & 1 deletion make/common/FindTests.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ $(eval $(call IncludeCustomExtension, common/FindTests.gmk))
TEST_BASEDIRS += $(TOPDIR)/test $(TOPDIR)

# JTREG_TESTROOTS might have been set by a custom extension
JTREG_TESTROOTS += $(addprefix $(TOPDIR)/test/, hotspot/jtreg jdk langtools jaxp)
JTREG_TESTROOTS += $(addprefix $(TOPDIR)/test/, hotspot/jtreg jdk langtools jaxp lib-test)

# Extract the names of the Jtreg group files from the TEST.ROOT files. The
# TEST.ROOT files being properties files can be interpreted as makefiles so
Expand Down
2 changes: 0 additions & 2 deletions make/test/JtregNativeHotspot.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -872,10 +872,8 @@ BUILD_HOTSPOT_JTREG_EXECUTABLES_LIBS_exesigtest := -ljvm
ifeq ($(call isTargetOs, windows), true)
BUILD_HOTSPOT_JTREG_EXECUTABLES_CFLAGS_exeFPRegs := -MT
BUILD_HOTSPOT_JTREG_EXCLUDE += exesigtest.c libterminatedThread.c
BUILD_HOTSPOT_JTREG_EXECUTABLES_LIBS_exejvm-test-launcher := jvm.lib
BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libatExit := jvm.lib
else
BUILD_HOTSPOT_JTREG_EXECUTABLES_LIBS_exejvm-test-launcher := -ljvm
BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libbootclssearch_agent += -lpthread
BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libsystemclssearch_agent += -lpthread
BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libgetsysprop001 += -lpthread
Expand Down
94 changes: 94 additions & 0 deletions make/test/JtregNativeLibTest.gmk
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
#
# Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
# 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. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# 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 file builds the native component of the JTReg tests for testlibrary.
# It also covers the test-image part, where the built files are copied to the
# test image.
################################################################################

default: all

include $(SPEC)
include MakeBase.gmk
include TestFilesCompilation.gmk

$(eval $(call IncludeCustomExtension, test/JtregNativeLibTest.gmk))

################################################################################
# Targets for building the native tests themselves.
################################################################################

# This might have been added to by a custom extension.
BUILD_LIBTEST_JTREG_NATIVE_SRC += $(TOPDIR)/test/lib-test

BUILD_LIBTEST_JTREG_OUTPUT_DIR := $(OUTPUTDIR)/support/test/lib-test/jtreg/native

BUILD_LIBTEST_JTREG_IMAGE_DIR := $(TEST_IMAGE_DIR)/lib-test/jtreg

ifeq ($(call isTargetOs, windows), true)
BUILD_LIBTEST_JTREG_EXECUTABLES_LIBS_exejvm-test-launcher := jvm.lib
else
BUILD_LIBTEST_JTREG_EXECUTABLES_LIBS_exejvm-test-launcher := -ljvm
endif

# This evaluation is expensive and should only be done if this target was
# explicitly called.
ifneq ($(filter build-test-libtest-jtreg-native, $(MAKECMDGOALS)), )
$(eval $(call SetupTestFilesCompilation, BUILD_LIBTEST_JTREG_LIBRARIES, \
TYPE := LIBRARY, \
SOURCE_DIRS := $(BUILD_LIBTEST_JTREG_NATIVE_SRC), \
OUTPUT_DIR := $(BUILD_LIBTEST_JTREG_OUTPUT_DIR), \
EXCLUDE := $(BUILD_LIBTEST_JTREG_EXCLUDE), \
))

$(eval $(call SetupTestFilesCompilation, BUILD_LIBTEST_JTREG_EXECUTABLES, \
TYPE := PROGRAM, \
SOURCE_DIRS := $(BUILD_LIBTEST_JTREG_NATIVE_SRC), \
OUTPUT_DIR := $(BUILD_LIBTEST_JTREG_OUTPUT_DIR), \
EXCLUDE := $(BUILD_LIBTEST_JTREG_EXCLUDE), \
))
endif

build-test-libtest-jtreg-native: $(BUILD_LIBTEST_JTREG_LIBRARIES) $(BUILD_LIBTEST_JTREG_EXECUTABLES)

################################################################################
# Targets for building test-image.
################################################################################

# Copy to lib-test jtreg test image
$(eval $(call SetupCopyFiles, COPY_LIBTEST_JTREG_NATIVE, \
SRC := $(BUILD_LIBTEST_JTREG_OUTPUT_DIR), \
DEST := $(TEST_IMAGE_DIR)/lib-test/jtreg/native, \
FILES := $(wildcard $(addprefix $(BUILD_LIBTEST_JTREG_OUTPUT_DIR), /bin/* /lib/*)), \
FLATTEN := true, \
))

test-image-libtest-jtreg-native: $(COPY_LIBTEST_JTREG_NATIVE)

all: build-test-libtest-jtreg-native
test-image: test-image-libtest-jtreg-native

.PHONY: default all build-test-libtest-jtreg-native test-image-libtest-jtreg-native test-image
1 change: 0 additions & 1 deletion test/hotspot/jtreg/TEST.groups
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,6 @@ tier1_runtime = \
-runtime/Thread/TestThreadDumpMonitorContention.java \
-runtime/Unsafe/RangeCheck.java \
sanity/ \
testlibrary_tests/TestMutuallyExclusivePlatformPredicates.java \
-:tier1_runtime_appcds_exclude \
-runtime/signal

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
*/

/*
* A simple way to test JVMTI ClassFileLoadHook. See ../testlibrary_tests/SimpleClassFileLoadHookTest.java
* A simple way to test JVMTI ClassFileLoadHook. See ../testlibrary_tests/jvmti/SimpleClassFileLoadHookTest.java
* for an example.
*/
#include <stdio.h>
Expand Down
Loading

0 comments on commit e7f8e1f

Please sign in to comment.