mirror of
https://github.com/darlinghq/darling-openjdk.git
synced 2024-11-23 12:29:56 +00:00
8217761: Enhance run-test-prebuilt jib profile to support running tests with JCov
Reviewed-by: erikj
This commit is contained in:
parent
6dcfd0f93a
commit
6026d7fcc3
@ -119,10 +119,8 @@ ifeq ($(TEST_OPTS_JCOV), true)
|
||||
JCOV_REPORT := $(JCOV_OUTPUT_DIR)/report
|
||||
JCOV_MEM_OPTIONS := -Xms64m -Xmx4g
|
||||
|
||||
ifneq ($(JCOV_IMAGE_DIR), )
|
||||
# Replace our normal test JDK with the JCov image, if present.
|
||||
JDK_UNDER_TEST := $(JCOV_IMAGE_DIR)
|
||||
endif
|
||||
# Replace our normal test JDK with the JCov image.
|
||||
JDK_UNDER_TEST := $(JCOV_IMAGE_DIR)
|
||||
|
||||
JCOV_ENVIRONMENT := JAVA_TOOL_OPTIONS="$(JCOV_MEM_OPTIONS)" \
|
||||
_JAVA_OPTIONS="$(JCOV_MEM_OPTIONS)"
|
||||
|
@ -95,12 +95,12 @@ endef
|
||||
# $1: The output file name
|
||||
# $2..$N: The lines to output to the file
|
||||
define CreateNewSpec
|
||||
$(if $(strip $(31)), \
|
||||
$(if $(strip $(33)), \
|
||||
$(error Internal makefile error: \
|
||||
Too many arguments to macro, please update CreateNewSpec in RunTestsPrebuilt.gmk) \
|
||||
) \
|
||||
$(shell $(RM) $1) \
|
||||
$(foreach i, $(call sequence, 2, 30), \
|
||||
$(foreach i, $(call sequence, 2, 32), \
|
||||
$(if $(strip $($i)), \
|
||||
$(call AppendFile, $(strip $($i)), $1) \
|
||||
) \
|
||||
@ -275,6 +275,14 @@ else
|
||||
LD := ld
|
||||
endif
|
||||
|
||||
ifneq ($(wildcard $(JDK_IMAGE_DIR)/template.xml), )
|
||||
TEST_OPTS_JCOV := true
|
||||
JCOV_IMAGE_DIR := $(JDK_IMAGE_DIR)
|
||||
else
|
||||
TEST_OPTS_JCOV := false
|
||||
JCOV_IMAGE_DIR :=
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
# Generate the ephemeral spec file
|
||||
################################################################################
|
||||
@ -295,6 +303,7 @@ $(call CreateNewSpec, $(NEW_SPEC), \
|
||||
BOOT_JDK := $(BOOT_JDK), \
|
||||
JT_HOME := $(JT_HOME), \
|
||||
JDK_IMAGE_DIR := $(JDK_IMAGE_DIR), \
|
||||
JCOV_IMAGE_DIR := $(JCOV_IMAGE_DIR), \
|
||||
TEST_IMAGE_DIR := $(TEST_IMAGE_DIR), \
|
||||
SYMBOLS_IMAGE_DIR := $(SYMBOLS_IMAGE_DIR), \
|
||||
MAKE := $(MAKE), \
|
||||
@ -315,6 +324,7 @@ $(call CreateNewSpec, $(NEW_SPEC), \
|
||||
LIBRARY_PREFIX := $(LIBRARY_PREFIX), \
|
||||
SHARED_LIBRARY_SUFFIX := $(SHARED_LIBRARY_SUFFIX), \
|
||||
include $(TOPDIR)/make/RunTestsPrebuiltSpec.gmk, \
|
||||
TEST_OPTS_JCOV := $(TEST_OPTS_JCOV), \
|
||||
$(CUSTOM_NEW_SPEC_LINE), \
|
||||
)
|
||||
|
||||
|
@ -760,20 +760,27 @@ var getJibProfilesProfiles = function (input, common, data) {
|
||||
if (testedProfile == null) {
|
||||
testedProfile = input.build_os + "-" + input.build_cpu;
|
||||
}
|
||||
var testedProfileJDK = testedProfile + ".jdk";
|
||||
var testedProfileTest = ""
|
||||
if (testedProfile.endsWith("-jcov")) {
|
||||
testedProfileTest = testedProfile.substring(0, testedProfile.length - "-jcov".length) + ".test";
|
||||
} else {
|
||||
testedProfileTest = testedProfile + ".test";
|
||||
}
|
||||
var testOnlyProfilesPrebuilt = {
|
||||
"run-test-prebuilt": {
|
||||
target_os: input.build_os,
|
||||
target_cpu: input.build_cpu,
|
||||
dependencies: [
|
||||
"jtreg", "gnumake", "boot_jdk", "devkit", "jib", testedProfile + ".jdk",
|
||||
testedProfile + ".test"
|
||||
"jtreg", "gnumake", "boot_jdk", "devkit", "jib", "jcov", testedProfileJDK,
|
||||
testedProfileTest
|
||||
],
|
||||
src: "src.conf",
|
||||
make_args: [ "run-test-prebuilt", "LOG_CMDLINES=true", "JTREG_VERBOSE=fail,error,time" ],
|
||||
environment: {
|
||||
"BOOT_JDK": common.boot_jdk_home,
|
||||
"JDK_IMAGE_DIR": input.get(testedProfile + ".jdk", "home_path"),
|
||||
"TEST_IMAGE_DIR": input.get(testedProfile + ".test", "home_path")
|
||||
"JDK_IMAGE_DIR": input.get(testedProfileJDK, "home_path"),
|
||||
"TEST_IMAGE_DIR": input.get(testedProfileTest, "home_path")
|
||||
},
|
||||
labels: "test"
|
||||
}
|
||||
@ -939,6 +946,7 @@ var getJibProfilesDependencies = function (input, common) {
|
||||
version: "3.0",
|
||||
build_number: "b07",
|
||||
file: "bundles/jcov-3_0.zip",
|
||||
environment_name: "JCOV_HOME",
|
||||
},
|
||||
|
||||
gnumake: {
|
||||
|
Loading…
Reference in New Issue
Block a user