Skip to content

Commit b30a16c

Browse files
committed
auto merge of #8020 : pnkfelix/rust/fsk-issue7898-dont-propagate-cfg-debug-to-tests, r=huonw
Remove directive, if present, from CFG_RUSTC_FLAGS. r? @huonw Fix #7898. (One alternative tack is to build up distinct CFG_TEST_RUSTC_FLAGS alongside CFG_RUSTC_FLAGS; but currently debug is the only --cfg flag ever added to CFG_RUSTC_FLAGS; the other contents of CFG_RUSTC_FLAGS are a mix of -Z flags and a few other switches like O, which seem to make sense to propogate to the tests.)
2 parents ba9c3eb + 1f92557 commit b30a16c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

mk/tests.mk

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,6 +537,10 @@ TEST_SREQ$(1)_T_$(2)_H_$(3) = \
537537

538538
# Rules for the cfail/rfail/rpass/bench/perf test runner
539539

540+
# The tests select when to use debug configuration on their own;
541+
# remove directive, if present, from CFG_RUSTC_FLAGS (issue #7898).
542+
CTEST_RUSTC_FLAGS = $$(subst --cfg debug,,$$(CFG_RUSTC_FLAGS))
543+
540544
CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) := \
541545
--compile-lib-path $$(HLIB$(1)_H_$(3)) \
542546
--run-lib-path $$(TLIB$(1)_T_$(2)_H_$(3)) \
@@ -548,7 +552,7 @@ CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) := \
548552
--target $(2) \
549553
--adb-path=$(CFG_ADB) \
550554
--adb-test-dir=$(CFG_ADB_TEST_DIR) \
551-
--rustcflags "$(RUSTC_FLAGS_$(2)) $$(CFG_RUSTC_FLAGS) --target=$(2)" \
555+
--rustcflags "$(RUSTC_FLAGS_$(2)) $$(CTEST_RUSTC_FLAGS) --target=$(2)" \
552556
$$(CTEST_TESTARGS)
553557

554558
CTEST_DEPS_rpass_$(1)-T-$(2)-H-$(3) = $$(RPASS_TESTS)

0 commit comments

Comments
 (0)