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
@@ -622,7 +626,7 @@ TEST_SREQ$(1)_T_$(2)_H_$(3) = \
622
626
# remove directive, if present, from CFG_RUSTC_FLAGS (issue #7898).
623
627
CTEST_RUSTC_FLAGS := $$(subst --cfg ndebug,,$$(CFG_RUSTC_FLAGS ) )
624
628
625
- # 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
626
630
# filter out the optimization (if any) from rustc and then figure out if we need
627
631
# to be optimized
628
632
CTEST_RUSTC_FLAGS := $$(subst -O,,$$(CTEST_RUSTC_FLAGS ) )
@@ -634,6 +638,7 @@ endif
634
638
# slow things down.
635
639
CTEST_RUSTC_FLAGS += -C codegen-units=1
636
640
641
+
637
642
CTEST_COMMON_ARGS$(1 ) -T-$(2 ) -H-$(3 ) := \
638
643
--compile-lib-path $$(HLIB$(1 ) _H_$(3 ) ) \
639
644
--run-lib-path $$(TLIB$(1 ) _T_$(2 ) _H_$(3 ) ) \
@@ -654,7 +659,21 @@ CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) := \
654
659
--target-rustcflags "$(RUSTC_FLAGS_$(2 ) ) $$(CTEST_RUSTC_FLAGS ) -L $$(RT_OUTPUT_DIR_$(2 ) ) " \
655
660
$$(CTEST_TESTARGS )
656
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
+
657
675
CTEST_DEPS_rpass_$(1 ) -T-$(2 ) -H-$(3 ) = $$(RPASS_TESTS )
676
+ CTEST_DEPS_rpass-valgrind_$(1 ) -T-$(2 ) -H-$(3 ) = $$(RPASS_VALGRIND_TESTS )
658
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 ) )
659
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 ) )
660
679
CTEST_DEPS_rfail_$(1 ) -T-$(2 ) -H-$(3 ) = $$(RFAIL_TESTS )
@@ -726,16 +745,17 @@ endif
726
745
727
746
endef
728
747
729
- 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
730
749
731
750
$(foreach host,$(CFG_HOST), \
732
751
$(eval $(foreach target,$(CFG_TARGET), \
733
752
$(eval $(foreach stage,$(STAGES), \
734
753
$(eval $(foreach name,$(CTEST_NAMES), \
735
754
$(eval $(call DEF_RUN_COMPILETEST,$(stage),$(target),$(host),$(name))))))))))
736
755
737
- 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
738
757
PRETTY_DEPS_pretty-rpass = $(RPASS_TESTS )
758
+ PRETTY_DEPS_pretty-rpass-valgrind = $(RPASS_VALGRIND_TESTS )
739
759
PRETTY_DEPS_pretty-rpass-full = $(RPASS_FULL_TESTS )
740
760
PRETTY_DEPS_pretty-rfail = $(RFAIL_TESTS )
741
761
PRETTY_DEPS_pretty-bench = $(BENCH_TESTS )
@@ -748,6 +768,7 @@ PRETTY_DEPS$(1)_H_$(3)_pretty-rfail =
748
768
PRETTY_DEPS$(1)_H_$(3)_pretty-bench =
749
769
PRETTY_DEPS$(1)_H_$(3)_pretty-pretty =
750
770
PRETTY_DIRNAME_pretty-rpass = run-pass
771
+ PRETTY_DIRNAME_pretty-rpass-valgrind = run-pass-valgrind
751
772
PRETTY_DIRNAME_pretty-rpass-full = run-pass-fulldeps
752
773
PRETTY_DIRNAME_pretty-rfail = run-fail
753
774
PRETTY_DIRNAME_pretty-bench = bench
@@ -895,6 +916,7 @@ TEST_GROUPS = \
895
916
$(foreach crate,$(TEST_CRATES ) ,$(crate ) ) \
896
917
$(foreach crate,$(TEST_DOC_CRATES ) ,doc-crate-$(crate ) ) \
897
918
rpass \
919
+ rpass-valgrind \
898
920
rpass-full \
899
921
cfail-full \
900
922
rfail \
@@ -909,6 +931,7 @@ TEST_GROUPS = \
909
931
$(foreach docname,$(DOCS ) ,doc-$(docname ) ) \
910
932
pretty \
911
933
pretty-rpass \
934
+ pretty-rpass-valgrind \
912
935
pretty-rpass-full \
913
936
pretty-rfail \
914
937
pretty-bench \
0 commit comments