Skip to content

Commit 0ea2dd1

Browse files
committed
8146132: Excessive output from make test-image
Reviewed-by: ihse
1 parent dcf1523 commit 0ea2dd1

File tree

2 files changed

+26
-4
lines changed

2 files changed

+26
-4
lines changed

make/common/NativeCompilation.gmk

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,7 @@ endef
547547
# STRIPFLAGS Optionally change the flags given to the strip command
548548
# PRECOMPILED_HEADER Header file to use as precompiled header
549549
# PRECOMPILED_HEADER_EXCLUDE List of source files that should not use PCH
550+
# BUILD_INFO_LOG_MACRO Overrides log level of the build info log message, default LogWarn
550551
#
551552
# After being called, some variables are exported from this macro, all prefixed
552553
# with parameter 1 followed by a '_':
@@ -931,12 +932,18 @@ define SetupNativeCompilationBody
931932

932933
# Setup rule for printing progress info when compiling source files.
933934
# This is a rough heuristic and may not always print accurate information.
934-
$$($1_BUILD_INFO): $$($1_SRCS) $$($1_COMPILE_VARDEPS_FILE)
935+
# The $1_BUILD_INFO and $1_BUILD_INFO_DEPS variables are used in
936+
# TestFilesCompilation.gmk.
937+
$$(call SetIfEmpty, $1_BUILD_INFO_LOG_MACRO, LogWarn)
938+
$1_BUILD_INFO_DEPS := $$($1_SRCS) $$($1_COMPILE_VARDEPS_FILE)
939+
$$($1_BUILD_INFO): $$($1_BUILD_INFO_DEPS)
935940
ifeq ($$(wildcard $$($1_TARGET)), )
936-
$$(call LogWarn, Creating $$(subst $$(OUTPUTDIR)/,,$$($1_TARGET)) from $$(words \
941+
$$(call $$($1_BUILD_INFO_LOG_MACRO), \
942+
Creating $$(subst $$(OUTPUTDIR)/,,$$($1_TARGET)) from $$(words \
937943
$$(filter-out %.vardeps, $$?)) file(s))
938944
else
939-
$$(call LogWarn, $$(strip Updating $$(subst $$(OUTPUTDIR)/,,$$($1_TARGET)) \
945+
$$(call $$($1_BUILD_INFO_LOG_MACRO), \
946+
$$(strip Updating $$(subst $$(OUTPUTDIR)/,,$$($1_TARGET)) \
940947
$$(if $$(filter-out %.vardeps, $$?), \
941948
due to $$(words $$(filter-out %.vardeps, $$?)) file(s), \
942949
$$(if $$(filter %.vardeps, $$?), due to makefile changes))))

make/common/TestFilesCompilation.gmk

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,15 @@ define SetupTestFilesCompilationBody
6464
$1_BASE_CXXFLAGS := $(CXXFLAGS_JDKLIB)
6565
$1_LDFLAGS := $(LDFLAGS_JDKLIB) $$(call SET_SHARED_LIBRARY_ORIGIN)
6666
$1_COMPILATION_TYPE := LIBRARY
67+
$1_LOG_TYPE := library
6768
else ifeq ($$($1_TYPE), PROGRAM)
6869
$1_PREFIX = exe
6970
$1_OUTPUT_SUBDIR := bin
7071
$1_BASE_CFLAGS := $(CFLAGS_JDKEXE)
7172
$1_BASE_CXXFLAGS := $(CXXFLAGS_JDKEXE)
7273
$1_LDFLAGS := $(LDFLAGS_JDKEXE) $(LDFLAGS_TESTEXE)
7374
$1_COMPILATION_TYPE := EXECUTABLE
75+
$1_LOG_TYPE := executable
7476
else
7577
$$(error Unknown type: $$($1_TYPE))
7678
endif
@@ -82,6 +84,8 @@ define SetupTestFilesCompilationBody
8284
$1_EXCLUDE_PATTERN := $$(addprefix %/, $$($1_EXCLUDE))
8385
$1_FILTERED_FILE_LIST := $$(filter-out $$($1_EXCLUDE_PATTERN), $$($1_FILE_LIST))
8486

87+
$1_BUILD_INFO := $$($1_OUTPUT_DIR)/_$1-build-info.marker
88+
8589
# Setup a compilation for each and every one of them
8690
$$(foreach file, $$($1_FILTERED_FILE_LIST),\
8791
$$(eval name := $$(strip $$(basename $$(notdir $$(file))))) \
@@ -103,10 +107,21 @@ define SetupTestFilesCompilationBody
103107
OPTIMIZATION := $$(if $$($1_OPTIMIZATION_$$(name)),$$($1_OPTIMIZATION_$$(name)),LOW), \
104108
COPY_DEBUG_SYMBOLS := false, \
105109
STRIP_SYMBOLS := $$(if $$($1_STRIP_SYMBOLS_$$(name)),$$($1_STRIP_SYMBOLS_$$(name)),false), \
110+
BUILD_INFO_LOG_MACRO := LogInfo, \
106111
)) \
107-
$$(eval $1 += $$(BUILD_TEST_$$(name)) ) \
112+
$$(eval $1 += $$(BUILD_TEST_$$(name)) ) \
113+
$$(eval $1_BUILD_INFO_DEPS += $$(BUILD_TEST_$$(name)_BUILD_INFO_DEPS)) \
114+
$$(eval $$(BUILD_TEST_$$(name)_BUILD_INFO): | $$($1_BUILD_INFO)) \
108115
)
109116

117+
# Setup rule for printing a summary of all the tests being compiled. On Warn
118+
# log level, this replaces the individual build info logging done by
119+
# SetupNativeCompilation.
120+
$$($1_BUILD_INFO): $$($1_BUILD_INFO_DEPS)
121+
$$(call LogWarn, $$(strip Creating $$(words $$(filter-out %.vardeps, $$?)) \
122+
test $$($1_LOG_TYPE) file(s) for $1))
123+
$(TOUCH) $$@
124+
110125
endef
111126

112127
endif # _TEST_FILES_COMPILATION_GMK

0 commit comments

Comments
 (0)