@@ -370,8 +370,6 @@ $(foreach host,$(CFG_HOST), \
370
370
define DEF_TEST_CRATE_RULES
371
371
check-stage$(1 ) -T-$(2 ) -H-$(3 ) -$(4 ) -exec: $$(call TEST_OK_FILE,$(1 ) ,$(2 ) ,$(3 ) ,$(4 ) )
372
372
373
- check-stage$(1 ) -T-$(2 ) -H-$(3 ) -$(4 ) -exec: $$(call TEST_OK_FILE,$(1 ) ,$(2 ) ,$(3 ) ,$(4 ) )
374
-
375
373
$$(call TEST_OK_FILE,$(1 ) ,$(2 ) ,$(3 ) ,$(4 ) ) : \
376
374
$(3 ) /stage$(1 ) /test/$(4 ) test-$(2 )$$(X_$(2 ) )
377
375
@$$(call E, run: $$< )
@@ -503,6 +501,10 @@ CTEST_BUILD_BASE_codegen = codegen
503
501
CTEST_MODE_codegen = codegen
504
502
CTEST_RUNTOOL_codegen = $(CTEST_RUNTOOL )
505
503
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
+
506
508
ifeq ($(CFG_GDB ) ,)
507
509
CTEST_DISABLE_debuginfo = "no gdb found"
508
510
endif
@@ -515,6 +517,14 @@ ifeq ($(CFG_OSTYPE),apple-darwin)
515
517
CTEST_DISABLE_debuginfo = "gdb on darwing needs root"
516
518
endif
517
519
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
+
518
528
define DEF_CTEST_VARS
519
529
520
530
# 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) := \
560
570
$$(CTEST_TESTARGS )
561
571
562
572
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 ) )
564
574
CTEST_DEPS_rfail_$(1 ) -T-$(2 ) -H-$(3 ) = $$(RFAIL_TESTS )
565
575
CTEST_DEPS_cfail_$(1 ) -T-$(2 ) -H-$(3 ) = $$(CFAIL_TESTS )
566
576
CTEST_DEPS_bench_$(1 ) -T-$(2 ) -H-$(3 ) = $$(BENCH_TESTS )
@@ -587,8 +597,28 @@ CTEST_ARGS$(1)-T-$(2)-H-$(3)-$(4) := \
587
597
588
598
check-stage$(1 ) -T-$(2 ) -H-$(3 ) -$(4 ) -exec: $$(call TEST_OK_FILE,$(1 ) ,$(2 ) ,$(3 ) ,$(4 ) )
589
599
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)
591
605
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 ) ) ,)
592
622
$$(call TEST_OK_FILE,$(1 ) ,$(2 ) ,$(3 ) ,$(4 ) ) : \
593
623
$$(TEST_SREQ$(1 ) _T_$(2 ) _H_$(3 ) ) \
594
624
$$(CTEST_DEPS_$(4)_$(1)-T-$(2)-H-$(3))
@@ -600,11 +630,9 @@ $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
600
630
601
631
else
602
632
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 ) ) :
606
634
@$$(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 ) ) )
608
636
touch $$@
609
637
610
638
endif
0 commit comments