From 1f9255751252b5d2b1f55af921896c43764fe52f Mon Sep 17 00:00:00 2001 From: "Felix S. Klock II" Date: Wed, 24 Jul 2013 11:26:52 +0200 Subject: [PATCH] Tests select when to use --cfg debug, regardless of configure settings. Remove directive, if present, from CFG_RUSTC_FLAGS. 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.) --- mk/tests.mk | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mk/tests.mk b/mk/tests.mk index 770e7280491..bcf8c53d8d0 100644 --- a/mk/tests.mk +++ b/mk/tests.mk @@ -537,6 +537,10 @@ TEST_SREQ$(1)_T_$(2)_H_$(3) = \ # Rules for the cfail/rfail/rpass/bench/perf test runner +# The tests select when to use debug configuration on their own; +# remove directive, if present, from CFG_RUSTC_FLAGS (issue #7898). +CTEST_RUSTC_FLAGS = $$(subst --cfg debug,,$$(CFG_RUSTC_FLAGS)) + CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) := \ --compile-lib-path $$(HLIB$(1)_H_$(3)) \ --run-lib-path $$(TLIB$(1)_T_$(2)_H_$(3)) \ @@ -548,7 +552,7 @@ CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) := \ --target $(2) \ --adb-path=$(CFG_ADB) \ --adb-test-dir=$(CFG_ADB_TEST_DIR) \ - --rustcflags "$(RUSTC_FLAGS_$(2)) $$(CFG_RUSTC_FLAGS) --target=$(2)" \ + --rustcflags "$(RUSTC_FLAGS_$(2)) $$(CTEST_RUSTC_FLAGS) --target=$(2)" \ $$(CTEST_TESTARGS) CTEST_DEPS_rpass_$(1)-T-$(2)-H-$(3) = $$(RPASS_TESTS)