8177957: run-test summary lines look bad/misleading with long test names
Reviewed-by: erikj
This commit is contained in:
parent
18f70cfdd2
commit
2add809f21
@ -38,6 +38,11 @@ $(eval $(call IncludeCustomExtension, RunTests.gmk))
|
|||||||
TEST_RESULTS_DIR := $(OUTPUTDIR)/test-results
|
TEST_RESULTS_DIR := $(OUTPUTDIR)/test-results
|
||||||
TEST_SUPPORT_DIR := $(OUTPUTDIR)/test-support
|
TEST_SUPPORT_DIR := $(OUTPUTDIR)/test-support
|
||||||
|
|
||||||
|
ifeq ($(CUSTOM_ROOT), )
|
||||||
|
JTREG_TOPDIR := $(TOPDIR)
|
||||||
|
else
|
||||||
|
JTREG_TOPDIR := $(CUSTOM_ROOT)
|
||||||
|
endif
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# Parse control variables
|
# Parse control variables
|
||||||
@ -116,17 +121,23 @@ define ParseGtestTestSelection
|
|||||||
)
|
)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
# Helper function that removes the TOPDIR part
|
||||||
|
CleanupJtregPath = \
|
||||||
|
$(strip $(patsubst %/, %, $(subst $(JTREG_TOPDIR)/,, $1)))
|
||||||
|
|
||||||
# Take a partial Jtreg root path and return a full, absolute path to that Jtreg
|
# Take a partial Jtreg root path and return a full, absolute path to that Jtreg
|
||||||
# root. Also support having "hotspot" as an alias for "hotspot/jtreg".
|
# root. Also support having "hotspot" as an alias for "hotspot/jtreg".
|
||||||
ExpandJtregRoot = \
|
ExpandJtregRoot = \
|
||||||
$(strip $(wildcard $(patsubst %/, %, \
|
$(call CleanupJtregPath, $(wildcard \
|
||||||
$(if $(filter /%, $1), \
|
$(if $(filter /%, $1), \
|
||||||
|
$(if $(wildcard $(strip $1)/TEST.ROOT), \
|
||||||
$1 \
|
$1 \
|
||||||
|
) \
|
||||||
, \
|
, \
|
||||||
$(filter $(addprefix %, $1), $(JTREG_TESTROOTS) $(addsuffix /, $(JTREG_TESTROOTS))) \
|
$(filter $(addprefix %, $1), $(JTREG_TESTROOTS) $(addsuffix /, $(JTREG_TESTROOTS))) \
|
||||||
$(filter $(addprefix %, $(strip $1)/jtreg), $(JTREG_TESTROOTS) $(addsuffix /, $(JTREG_TESTROOTS))) \
|
$(filter $(addprefix %, $(strip $1)/jtreg), $(JTREG_TESTROOTS) $(addsuffix /, $(JTREG_TESTROOTS))) \
|
||||||
) \
|
) \
|
||||||
)))
|
))
|
||||||
|
|
||||||
# Take a partial Jtreg test path and return a full, absolute path to that Jtreg
|
# Take a partial Jtreg test path and return a full, absolute path to that Jtreg
|
||||||
# test. Also support having "hotspot" as an alias for "hotspot/jtreg".
|
# test. Also support having "hotspot" as an alias for "hotspot/jtreg".
|
||||||
@ -134,14 +145,14 @@ ExpandJtregPath = \
|
|||||||
$(if $(call ExpandJtregRoot, $1), \
|
$(if $(call ExpandJtregRoot, $1), \
|
||||||
$(call ExpandJtregRoot, $1) \
|
$(call ExpandJtregRoot, $1) \
|
||||||
, \
|
, \
|
||||||
$(strip $(wildcard $(patsubst %/, %, \
|
$(call CleanupJtregPath, $(wildcard \
|
||||||
$(if $(filter /%, $1), \
|
$(if $(filter /%, $1), \
|
||||||
$1 \
|
$1 \
|
||||||
, \
|
, \
|
||||||
$(addsuffix /$(strip $1), $(JTREG_TESTROOTS) $(TEST_BASEDIRS)) \
|
$(addsuffix /$(strip $1), $(JTREG_TESTROOTS) $(TEST_BASEDIRS)) \
|
||||||
$(addsuffix $(strip $(patsubst hotspot/%, /hotspot/jtreg/%, $1)), $(JTREG_TESTROOTS) $(TEST_BASEDIRS)) \
|
$(addsuffix $(strip $(patsubst hotspot/%, /hotspot/jtreg/%, $1)), $(JTREG_TESTROOTS) $(TEST_BASEDIRS)) \
|
||||||
) \
|
) \
|
||||||
))) \
|
)) \
|
||||||
)
|
)
|
||||||
|
|
||||||
# Helper function to determine if a test specification is a Jtreg test
|
# Helper function to determine if a test specification is a Jtreg test
|
||||||
@ -165,21 +176,19 @@ define ParseJtregTestSelection
|
|||||||
$(eval TEST_ROOTS := $(call ExpandJtregRoot, $(TEST_PATH))) \
|
$(eval TEST_ROOTS := $(call ExpandJtregRoot, $(TEST_PATH))) \
|
||||||
) \
|
) \
|
||||||
$(foreach test_root, $(TEST_ROOTS), \
|
$(foreach test_root, $(TEST_ROOTS), \
|
||||||
$(if $(filter $(TEST_GROUP), $($(test_root)_JTREG_TEST_GROUPS)), \
|
$(if $(filter /%, $(test_root)), \
|
||||||
|
jtreg:$(test_root):$(TEST_GROUP) \
|
||||||
|
, \
|
||||||
|
$(if $(filter $(TEST_GROUP), $($(JTREG_TOPDIR)/$(test_root)_JTREG_TEST_GROUPS)), \
|
||||||
jtreg:$(test_root):$(TEST_GROUP) \
|
jtreg:$(test_root):$(TEST_GROUP) \
|
||||||
) \
|
) \
|
||||||
) \
|
) \
|
||||||
, \
|
|
||||||
$(if $(filter /%, $(TEST_NAME)), \
|
|
||||||
$(if $(wildcard $(TEST_NAME)), \
|
|
||||||
jtreg:$(TEST_NAME) \
|
|
||||||
) \
|
) \
|
||||||
, \
|
, \
|
||||||
$(eval TEST_PATHS := $(call ExpandJtregPath, $(TEST_NAME))) \
|
$(eval TEST_PATHS := $(call ExpandJtregPath, $(TEST_NAME))) \
|
||||||
$(foreach test_path, $(TEST_PATHS), \
|
$(foreach test_path, $(TEST_PATHS), \
|
||||||
jtreg:$(test_path) \
|
jtreg:$(test_path) \
|
||||||
) \
|
) \
|
||||||
) \
|
|
||||||
)
|
)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
@ -326,7 +335,7 @@ define SetupRunJtregTestBody
|
|||||||
|
|
||||||
$1_COMPONENT := \
|
$1_COMPONENT := \
|
||||||
$$(strip $$(foreach root, $$(JTREG_TESTROOTS), \
|
$$(strip $$(foreach root, $$(JTREG_TESTROOTS), \
|
||||||
$$(if $$(filter $$(root)%, $$($1_TEST_NAME)), \
|
$$(if $$(filter $$(root)%, $$(JTREG_TOPDIR)/$$($1_TEST_NAME)), \
|
||||||
$$(lastword $$(subst /, $$(SPACE), $$(root))) \
|
$$(lastword $$(subst /, $$(SPACE), $$(root))) \
|
||||||
) \
|
) \
|
||||||
))
|
))
|
||||||
@ -416,7 +425,7 @@ define SetupRunJtregTestBody
|
|||||||
-Dprogram=jtreg -jar $$(JT_HOME)/lib/jtreg.jar \
|
-Dprogram=jtreg -jar $$(JT_HOME)/lib/jtreg.jar \
|
||||||
$$($1_JTREG_BASIC_OPTIONS) \
|
$$($1_JTREG_BASIC_OPTIONS) \
|
||||||
-testjdk:$$(JDK_IMAGE_DIR) \
|
-testjdk:$$(JDK_IMAGE_DIR) \
|
||||||
-dir:$$(TOPDIR) \
|
-dir:$$(JTREG_TOPDIR) \
|
||||||
-reportDir:$$($1_TEST_RESULTS_DIR) \
|
-reportDir:$$($1_TEST_RESULTS_DIR) \
|
||||||
-workDir:$$($1_TEST_SUPPORT_DIR) \
|
-workDir:$$($1_TEST_SUPPORT_DIR) \
|
||||||
$$(JTREG_OPTIONS) \
|
$$(JTREG_OPTIONS) \
|
||||||
@ -514,12 +523,19 @@ run-test: $(TARGETS)
|
|||||||
$(foreach test, $(TESTS_TO_RUN), \
|
$(foreach test, $(TESTS_TO_RUN), \
|
||||||
$(eval TEST_ID := $(shell $(ECHO) $(strip $(test)) | \
|
$(eval TEST_ID := $(shell $(ECHO) $(strip $(test)) | \
|
||||||
$(TR) -cs '[a-z][A-Z][0-9]\n' '_')) \
|
$(TR) -cs '[a-z][A-Z][0-9]\n' '_')) \
|
||||||
|
$(eval NAME_PATTERN := $(shell $(ECHO) $(test) | $(TR) -c \\n _)) \
|
||||||
|
$(if $(filter __________________________________________________%, $(NAME_PATTERN)), \
|
||||||
|
$(eval TEST_NAME := ) \
|
||||||
|
$(PRINTF) "%2s %-49s\n" " " "$(test)" $(NEWLINE) \
|
||||||
|
, \
|
||||||
|
$(eval TEST_NAME := $(test)) \
|
||||||
|
) \
|
||||||
$(if $(filter $($(TEST_ID)_PASSED), $($(TEST_ID)_TOTAL)), \
|
$(if $(filter $($(TEST_ID)_PASSED), $($(TEST_ID)_TOTAL)), \
|
||||||
$(PRINTF) "%2s %-49s %5d %5d %5d %5d %2s\n" " " "$(test)" \
|
$(PRINTF) "%2s %-49s %5d %5d %5d %5d %2s\n" " " "$(TEST_NAME)" \
|
||||||
$($(TEST_ID)_TOTAL) $($(TEST_ID)_PASSED) $($(TEST_ID)_FAILED) \
|
$($(TEST_ID)_TOTAL) $($(TEST_ID)_PASSED) $($(TEST_ID)_FAILED) \
|
||||||
$($(TEST_ID)_ERROR) " " $(NEWLINE) \
|
$($(TEST_ID)_ERROR) " " $(NEWLINE) \
|
||||||
, \
|
, \
|
||||||
$(PRINTF) "%2s %-49s %5d %5d %5d %5d %2s\n" ">>" "$(test)" \
|
$(PRINTF) "%2s %-49s %5d %5d %5d %5d %2s\n" ">>" "$(TEST_NAME)" \
|
||||||
$($(TEST_ID)_TOTAL) $($(TEST_ID)_PASSED) $($(TEST_ID)_FAILED) \
|
$($(TEST_ID)_TOTAL) $($(TEST_ID)_PASSED) $($(TEST_ID)_FAILED) \
|
||||||
$($(TEST_ID)_ERROR) "<<" $(NEWLINE) \
|
$($(TEST_ID)_ERROR) "<<" $(NEWLINE) \
|
||||||
$(eval TEST_FAILURE := true) \
|
$(eval TEST_FAILURE := true) \
|
||||||
|
Loading…
Reference in New Issue
Block a user