1
- # Copyright 2012 The Rust Project Developers. See the COPYRIGHT
1
+ # Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
2
2
# file at the top-level directory of this distribution and at
3
3
# http://rust-lang.org/COPYRIGHT.
4
4
#
@@ -184,12 +184,12 @@ check-notidy: cleantmptestlogs cleantestlibs all check-stage2
184
184
# A slightly smaller set of tests for smoke testing.
185
185
check-lite : cleantestlibs cleantmptestlogs \
186
186
$(foreach crate,$(TEST_TARGET_CRATES ) ,check-stage2-$(crate ) ) \
187
- check-stage2-rpass \
187
+ check-stage2-rpass check-stage2-rpass-valgrind \
188
188
check-stage2-rfail check-stage2-cfail check-stage2-rmake
189
189
$(Q )$(CFG_PYTHON ) $(S ) src/etc/check-summary.py tmp/* .log
190
190
191
191
# Only check the 'reference' tests: rpass/cfail/rfail/rmake.
192
- check-ref : cleantestlibs cleantmptestlogs check-stage2-rpass \
192
+ check-ref : cleantestlibs cleantmptestlogs check-stage2-rpass check-stage2-rpass-valgrind \
193
193
check-stage2-rfail check-stage2-cfail check-stage2-rmake
194
194
$(Q )$(CFG_PYTHON ) $(S ) src/etc/check-summary.py tmp/* .log
195
195
@@ -326,7 +326,8 @@ check-stage$(1)-T-$(2)-H-$(3)-exec: \
326
326
check-stage$(1 ) -T-$(2 ) -H-$(3 ) -rpass-exec \
327
327
check-stage$(1 ) -T-$(2 ) -H-$(3 ) -rfail-exec \
328
328
check-stage$(1 ) -T-$(2 ) -H-$(3 ) -cfail-exec \
329
- check-stage$(1 ) -T-$(2 ) -H-$(3 ) -rpass-full-exec \
329
+ check-stage$(1 ) -T-$(2 ) -H-$(3 ) -rpass-valgrind-exec \
330
+ check-stage$(1 ) -T-$(2 ) -H-$(3 ) -rpass-full-exec \
330
331
check-stage$(1 ) -T-$(2 ) -H-$(3 ) -cfail-full-exec \
331
332
check-stage$(1 ) -T-$(2 ) -H-$(3 ) -rmake-exec \
332
333
check-stage$(1 ) -T-$(2 ) -H-$(3 ) -crates-exec \
@@ -364,6 +365,7 @@ check-stage$(1)-T-$(2)-H-$(3)-doc-exec: \
364
365
365
366
check-stage$(1 ) -T-$(2 ) -H-$(3 ) -pretty-exec: \
366
367
check-stage$(1 ) -T-$(2 ) -H-$(3 ) -pretty-rpass-exec \
368
+ check-stage$(1 ) -T-$(2 ) -H-$(3 ) -pretty-rpass-valgrind-exec \
367
369
check-stage$(1 ) -T-$(2 ) -H-$(3 ) -pretty-rpass-full-exec \
368
370
check-stage$(1 ) -T-$(2 ) -H-$(3 ) -pretty-rfail-exec \
369
371
check-stage$(1 ) -T-$(2 ) -H-$(3 ) -pretty-bench-exec \
@@ -489,15 +491,11 @@ $(foreach host,$(CFG_HOST), \
489
491
# Rules for the compiletest tests (rpass, rfail, etc.)
490
492
# #####################################################################
491
493
492
- RPASS_RC := $(wildcard $(S ) src/test/run-pass/* .rc)
493
494
RPASS_RS := $(wildcard $(S ) src/test/run-pass/* .rs)
494
- RPASS_FULL_RC := $(wildcard $(S ) src/test/run-pass-fulldeps /* .rc )
495
+ RPASS_VALGRIND_RS := $(wildcard $(S ) src/test/run-pass-valgrind /* .rs )
495
496
RPASS_FULL_RS := $(wildcard $(S ) src/test/run-pass-fulldeps/* .rs)
496
- CFAIL_FULL_RC := $(wildcard $(S ) src/test/compile-fail-fulldeps/* .rc)
497
497
CFAIL_FULL_RS := $(wildcard $(S ) src/test/compile-fail-fulldeps/* .rs)
498
- RFAIL_RC := $(wildcard $(S ) src/test/run-fail/* .rc)
499
498
RFAIL_RS := $(wildcard $(S ) src/test/run-fail/* .rs)
500
- CFAIL_RC := $(wildcard $(S ) src/test/compile-fail/* .rc)
501
499
CFAIL_RS := $(wildcard $(S ) src/test/compile-fail/* .rs)
502
500
BENCH_RS := $(wildcard $(S ) src/test/bench/* .rs)
503
501
PRETTY_RS := $(wildcard $(S ) src/test/pretty/* .rs)
@@ -510,11 +508,12 @@ CODEGEN_CC := $(wildcard $(S)src/test/codegen/*.cc)
510
508
# a performance monitor.
511
509
PERF_RS := $(wildcard $(S ) src/test/bench/* .rs)
512
510
513
- RPASS_TESTS := $(RPASS_RC ) $(RPASS_RS )
514
- RPASS_FULL_TESTS := $(RPASS_FULL_RC ) $(RPASS_FULL_RS )
515
- CFAIL_FULL_TESTS := $(CFAIL_FULL_RC ) $(CFAIL_FULL_RS )
516
- RFAIL_TESTS := $(RFAIL_RC ) $(RFAIL_RS )
517
- CFAIL_TESTS := $(CFAIL_RC ) $(CFAIL_RS )
511
+ RPASS_TESTS := $(RPASS_RS )
512
+ RPASS_VALGRIND_TESTS := $(RPASS_VALGRIND_RS )
513
+ RPASS_FULL_TESTS := $(RPASS_FULL_RS )
514
+ CFAIL_FULL_TESTS := $(CFAIL_FULL_RS )
515
+ RFAIL_TESTS := $(RFAIL_RS )
516
+ CFAIL_TESTS := $(CFAIL_RS )
518
517
BENCH_TESTS := $(BENCH_RS )
519
518
PERF_TESTS := $(PERF_RS )
520
519
PRETTY_TESTS := $(PRETTY_RS )
@@ -527,6 +526,11 @@ CTEST_BUILD_BASE_rpass = run-pass
527
526
CTEST_MODE_rpass = run-pass
528
527
CTEST_RUNTOOL_rpass = $(CTEST_RUNTOOL )
529
528
529
+ CTEST_SRC_BASE_rpass-valgrind = run-pass-valgrind
530
+ CTEST_BUILD_BASE_rpass-valgrind = run-pass-valgrind
531
+ CTEST_MODE_rpass-valgrind = run-pass-valgrind
532
+ CTEST_RUNTOOL_rpass-valgrind = $(CTEST_RUNTOOL )
533
+
530
534
CTEST_SRC_BASE_rpass-full = run-pass-fulldeps
531
535
CTEST_BUILD_BASE_rpass-full = run-pass-fulldeps
532
536
CTEST_MODE_rpass-full = run-pass
@@ -584,13 +588,14 @@ ifeq ($(CFG_LLDB),)
584
588
CTEST_DISABLE_debuginfo-lldb = "no lldb found"
585
589
endif
586
590
587
- # Completely disable LLDB tests for now
588
- CTEST_DISABLE_debuginfo-lldb = "LLDB tests are not enabled yet"
589
-
590
591
ifeq ($(CFG_CLANG ) ,)
591
592
CTEST_DISABLE_codegen = "no clang found"
592
593
endif
593
594
595
+ ifneq ($(CFG_OSTYPE ) ,apple-darwin)
596
+ CTEST_DISABLE_debuginfo-lldb = "lldb tests are only run on darwin"
597
+ endif
598
+
594
599
ifeq ($(CFG_OSTYPE ) ,apple-darwin)
595
600
CTEST_DISABLE_debuginfo-gdb = "gdb on darwing needs root"
596
601
endif
@@ -621,13 +626,18 @@ TEST_SREQ$(1)_T_$(2)_H_$(3) = \
621
626
# remove directive, if present, from CFG_RUSTC_FLAGS (issue #7898).
622
627
CTEST_RUSTC_FLAGS := $$(subst --cfg ndebug,,$$(CFG_RUSTC_FLAGS ) )
623
628
624
- # The tests can not be optimized while the rest of the compiler is optimized, so
629
+ # The tests cannot be optimized while the rest of the compiler is optimized, so
625
630
# filter out the optimization (if any) from rustc and then figure out if we need
626
631
# to be optimized
627
632
CTEST_RUSTC_FLAGS := $$(subst -O,,$$(CTEST_RUSTC_FLAGS ) )
628
633
ifndef CFG_DISABLE_OPTIMIZE_TESTS
629
634
CTEST_RUSTC_FLAGS += -O
630
635
endif
636
+ # Force codegen-units=1 for compiletest tests. compiletest does its own
637
+ # parallelization internally, so rustc's default codegen-units=2 will actually
638
+ # slow things down.
639
+ CTEST_RUSTC_FLAGS += -C codegen-units=1
640
+
631
641
632
642
CTEST_COMMON_ARGS$(1 ) -T-$(2 ) -H-$(3 ) := \
633
643
--compile-lib-path $$(HLIB$(1 ) _H_$(3 ) ) \
@@ -649,7 +659,21 @@ CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) := \
649
659
--target-rustcflags "$(RUSTC_FLAGS_$(2 ) ) $$(CTEST_RUSTC_FLAGS ) -L $$(RT_OUTPUT_DIR_$(2 ) ) " \
650
660
$$(CTEST_TESTARGS )
651
661
662
+ ifdef CFG_VALGRIND_RPASS
663
+ ifdef GOOD_VALGRIND_$(2)
664
+ $(info cfg : valgrind-path set to $(CFG_VALGRIND_RPASS ) )
665
+ CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) += --valgrind-path "$(CFG_VALGRIND_RPASS ) "
666
+ endif
667
+ endif
668
+
669
+ ifndef CFG_DISABLE_VALGRIND_RPASS
670
+ ifdef GOOD_VALGRIND_$(2)
671
+ CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) += --force-valgrind
672
+ endif
673
+ endif
674
+
652
675
CTEST_DEPS_rpass_$(1 ) -T-$(2 ) -H-$(3 ) = $$(RPASS_TESTS )
676
+ CTEST_DEPS_rpass-valgrind_$(1 ) -T-$(2 ) -H-$(3 ) = $$(RPASS_VALGRIND_TESTS )
653
677
CTEST_DEPS_rpass-full_$(1 ) -T-$(2 ) -H-$(3 ) = $$(RPASS_FULL_TESTS ) $$(CSREQ$(1 ) _T_$(3 ) _H_$(3 ) ) $$(SREQ$(1 ) _T_$(2 ) _H_$(3 ) )
654
678
CTEST_DEPS_cfail-full_$(1 ) -T-$(2 ) -H-$(3 ) = $$(CFAIL_FULL_TESTS ) $$(CSREQ$(1 ) _T_$(3 ) _H_$(3 ) ) $$(SREQ$(1 ) _T_$(2 ) _H_$(3 ) )
655
679
CTEST_DEPS_rfail_$(1 ) -T-$(2 ) -H-$(3 ) = $$(RFAIL_TESTS )
@@ -721,16 +745,17 @@ endif
721
745
722
746
endef
723
747
724
- CTEST_NAMES = rpass rpass-full cfail-full rfail cfail bench perf debuginfo-gdb debuginfo-lldb codegen
748
+ CTEST_NAMES = rpass rpass-valgrind rpass- full cfail-full rfail cfail bench perf debuginfo-gdb debuginfo-lldb codegen
725
749
726
750
$(foreach host,$(CFG_HOST), \
727
751
$(eval $(foreach target,$(CFG_TARGET), \
728
752
$(eval $(foreach stage,$(STAGES), \
729
753
$(eval $(foreach name,$(CTEST_NAMES), \
730
754
$(eval $(call DEF_RUN_COMPILETEST,$(stage),$(target),$(host),$(name))))))))))
731
755
732
- PRETTY_NAMES = pretty-rpass pretty-rpass-full pretty-rfail pretty-bench pretty-pretty
756
+ PRETTY_NAMES = pretty-rpass pretty-rpass-valgrind pretty-rpass- full pretty-rfail pretty-bench pretty-pretty
733
757
PRETTY_DEPS_pretty-rpass = $(RPASS_TESTS )
758
+ PRETTY_DEPS_pretty-rpass-valgrind = $(RPASS_VALGRIND_TESTS )
734
759
PRETTY_DEPS_pretty-rpass-full = $(RPASS_FULL_TESTS )
735
760
PRETTY_DEPS_pretty-rfail = $(RFAIL_TESTS )
736
761
PRETTY_DEPS_pretty-bench = $(BENCH_TESTS )
@@ -743,6 +768,7 @@ PRETTY_DEPS$(1)_H_$(3)_pretty-rfail =
743
768
PRETTY_DEPS$(1)_H_$(3)_pretty-bench =
744
769
PRETTY_DEPS$(1)_H_$(3)_pretty-pretty =
745
770
PRETTY_DIRNAME_pretty-rpass = run-pass
771
+ PRETTY_DIRNAME_pretty-rpass-valgrind = run-pass-valgrind
746
772
PRETTY_DIRNAME_pretty-rpass-full = run-pass-fulldeps
747
773
PRETTY_DIRNAME_pretty-rfail = run-fail
748
774
PRETTY_DIRNAME_pretty-bench = bench
@@ -890,6 +916,7 @@ TEST_GROUPS = \
890
916
$(foreach crate,$(TEST_CRATES ) ,$(crate ) ) \
891
917
$(foreach crate,$(TEST_DOC_CRATES ) ,doc-crate-$(crate ) ) \
892
918
rpass \
919
+ rpass-valgrind \
893
920
rpass-full \
894
921
cfail-full \
895
922
rfail \
@@ -904,6 +931,7 @@ TEST_GROUPS = \
904
931
$(foreach docname,$(DOCS ) ,doc-$(docname ) ) \
905
932
pretty \
906
933
pretty-rpass \
934
+ pretty-rpass-valgrind \
907
935
pretty-rpass-full \
908
936
pretty-rfail \
909
937
pretty-bench \
0 commit comments