Skip to content

Commit 0651d27

Browse files
committed
auto merge of #13260 : pnkfelix/rust/fsk-fix-13247, r=alexcrichton
Fix #13247. r? @alexcrichton (or anyone else, really).
2 parents b2b2bbb + 4edf7b8 commit 0651d27

File tree

2 files changed

+39
-8
lines changed

2 files changed

+39
-8
lines changed

mk/tests.mk

+36-8
Original file line numberDiff line numberDiff line change
@@ -370,8 +370,6 @@ $(foreach host,$(CFG_HOST), \
370370
define DEF_TEST_CRATE_RULES
371371
check-stage$(1)-T-$(2)-H-$(3)-$(4)-exec: $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4))
372372

373-
check-stage$(1)-T-$(2)-H-$(3)-$(4)-exec: $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4))
374-
375373
$$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
376374
$(3)/stage$(1)/test/$(4)test-$(2)$$(X_$(2))
377375
@$$(call E, run: $$<)
@@ -503,6 +501,10 @@ CTEST_BUILD_BASE_codegen = codegen
503501
CTEST_MODE_codegen = codegen
504502
CTEST_RUNTOOL_codegen = $(CTEST_RUNTOOL)
505503

504+
# CTEST_DISABLE_$(TEST_GROUP), if set, will cause the test group to be
505+
# disabled and the associated message to be printed as a warning
506+
# during attempts to run those tests.
507+
506508
ifeq ($(CFG_GDB),)
507509
CTEST_DISABLE_debuginfo = "no gdb found"
508510
endif
@@ -515,6 +517,14 @@ ifeq ($(CFG_OSTYPE),apple-darwin)
515517
CTEST_DISABLE_debuginfo = "gdb on darwing needs root"
516518
endif
517519

520+
# CTEST_DISABLE_NONSELFHOST_$(TEST_GROUP), if set, will cause that
521+
# test group to be disabled *unless* the target is able to build a
522+
# compiler (i.e. when the target triple is in the set of of host
523+
# triples). The associated message will be printed as a warning
524+
# during attempts to run those tests.
525+
526+
CTEST_DISABLE_NONSELFHOST_rpass-full = "run-pass-full suite is unavailable when cross-compiling."
527+
518528
define DEF_CTEST_VARS
519529

520530
# All the per-stage build rules you might want to call from the
@@ -560,7 +570,7 @@ CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) := \
560570
$$(CTEST_TESTARGS)
561571

562572
CTEST_DEPS_rpass_$(1)-T-$(2)-H-$(3) = $$(RPASS_TESTS)
563-
CTEST_DEPS_rpass_full_$(1)-T-$(2)-H-$(3) = $$(RPASS_FULL_TESTS) $$(TLIBRUSTC_DEFAULT$(1)_T_$(2)_H_$(3))
573+
CTEST_DEPS_rpass-full_$(1)-T-$(2)-H-$(3) = $$(RPASS_FULL_TESTS) $$(CSREQ$(1)_T_$(2)_H_$(3))
564574
CTEST_DEPS_rfail_$(1)-T-$(2)-H-$(3) = $$(RFAIL_TESTS)
565575
CTEST_DEPS_cfail_$(1)-T-$(2)-H-$(3) = $$(CFAIL_TESTS)
566576
CTEST_DEPS_bench_$(1)-T-$(2)-H-$(3) = $$(BENCH_TESTS)
@@ -587,8 +597,28 @@ CTEST_ARGS$(1)-T-$(2)-H-$(3)-$(4) := \
587597

588598
check-stage$(1)-T-$(2)-H-$(3)-$(4)-exec: $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4))
589599

590-
ifeq ($$(CTEST_DISABLE_$(4)),)
600+
# CTEST_DONT_RUN_$(1)-T-$(2)-H-$(3)-$(4)
601+
# Goal: leave this variable as empty string if we should run the test.
602+
# Otherwise, set it to the reason we are not running the test.
603+
# (Encoded as a separate variable because GNU make does not have a
604+
# good way to express OR on ifeq commands)
591605

606+
ifneq ($$(CTEST_DISABLE_$(4)),)
607+
# Test suite is disabled for all configured targets.
608+
CTEST_DONT_RUN_$(1)-T-$(2)-H-$(3)-$(4) := $$(CTEST_DISABLE_$(4))
609+
else
610+
# else, check if non-self-hosted target (i.e. target not-in hosts) ...
611+
ifeq ($$(findstring $(2),$$(CFG_HOST)),)
612+
# ... if so, then check if this test suite is disabled for non-selfhosts.
613+
ifneq ($$(CTEST_DISABLE_NONSELFHOST_$(4)),)
614+
# Test suite is disabled for this target.
615+
CTEST_DONT_RUN_$(1)-T-$(2)-H-$(3)-$(4) := $$(CTEST_DISABLE_NONSELFHOST_$(4))
616+
endif
617+
endif
618+
# Neither DISABLE nor DISABLE_NONSELFHOST is set ==> okay, run the test.
619+
endif
620+
621+
ifeq ($$(CTEST_DONT_RUN_$(1)-T-$(2)-H-$(3)-$(4)),)
592622
$$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
593623
$$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
594624
$$(CTEST_DEPS_$(4)_$(1)-T-$(2)-H-$(3))
@@ -600,11 +630,9 @@ $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
600630

601631
else
602632

603-
$$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
604-
$$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
605-
$$(CTEST_DEPS_$(4)_$(1)-T-$(2)-H-$(3))
633+
$$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)):
606634
@$$(call E, run $(4) [$(2)]: $$<)
607-
@$$(call E, warning: tests disabled: $$(CTEST_DISABLE_$(4)))
635+
@$$(call E, warning: tests disabled: $$(CTEST_DONT_RUN_$(1)-T-$(2)-H-$(3)-$(4)))
608636
touch $$@
609637

610638
endif

src/compiletest/compiletest.rs

+3
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
#![crate_type = "bin"]
1212
#![feature(phase)]
1313

14+
// we use our own (green) start below; do not link in libnative; issue #13247.
15+
#![no_start]
16+
1417
#![allow(non_camel_case_types)]
1518
#![deny(warnings)]
1619

0 commit comments

Comments
 (0)