Skip to content

Commit 7ea3a8b

Browse files
committed
---
yaml --- r: 157430 b: refs/heads/snap-stage3 c: f466e1a h: refs/heads/master v: v3
1 parent 424d79e commit 7ea3a8b

File tree

9 files changed

+57
-43
lines changed

9 files changed

+57
-43
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 065caf34f5ff29e04605f95d9c5d511af219439a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 96991e9335e260d2684785ee97dc1af9cbed5aad
4+
refs/heads/snap-stage3: f466e1a59fa79c36538ea0fe733a1ab98bc6e197
55
refs/heads/try: 0ee4d8b0b112c608646fa75463ab4dc59132efd9
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/configure

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -906,6 +906,7 @@ do
906906
done
907907

908908
make_dir $h/test/run-pass
909+
make_dir $h/test/run-pass-valgrind
909910
make_dir $h/test/run-pass-fulldeps
910911
make_dir $h/test/run-fail
911912
make_dir $h/test/compile-fail

branches/snap-stage3/mk/main.mk

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,8 @@ else
174174
CFG_VALGRIND_COMPILE :=
175175
endif
176176

177+
VALGRIND_PATH :=$(CFG_VALGRIND)
178+
177179
ifdef CFG_ENABLE_VALGRIND
178180
$(info cfg: enabling valgrind (CFG_ENABLE_VALGRIND))
179181
else
@@ -182,6 +184,7 @@ endif
182184
ifdef CFG_BAD_VALGRIND
183185
$(info cfg: disabling valgrind due to its unreliability on this platform)
184186
CFG_VALGRIND :=
187+
VALGRIND_PATH :=
185188
endif
186189

187190

branches/snap-stage3/mk/tests.mk

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2012 The Rust Project Developers. See the COPYRIGHT
1+
# Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
22
# file at the top-level directory of this distribution and at
33
# http://rust-lang.org/COPYRIGHT.
44
#
@@ -184,12 +184,12 @@ check-notidy: cleantmptestlogs cleantestlibs all check-stage2
184184
# A slightly smaller set of tests for smoke testing.
185185
check-lite: cleantestlibs cleantmptestlogs \
186186
$(foreach crate,$(TEST_TARGET_CRATES),check-stage2-$(crate)) \
187-
check-stage2-rpass \
187+
check-stage2-rpass check-stage2-rpass-valgrind \
188188
check-stage2-rfail check-stage2-cfail check-stage2-rmake
189189
$(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log
190190

191191
# 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 \
193193
check-stage2-rfail check-stage2-cfail check-stage2-rmake
194194
$(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log
195195

@@ -491,6 +491,8 @@ $(foreach host,$(CFG_HOST), \
491491

492492
RPASS_RC := $(wildcard $(S)src/test/run-pass/*.rc)
493493
RPASS_RS := $(wildcard $(S)src/test/run-pass/*.rs)
494+
RPASS_VALGRIND_RC := $(wildcard $(S)src/test/run-pass-valgrind/*.rc)
495+
RPASS_VALGRIND_RS := $(wildcard $(S)src/test/run-pass-valgrind/*.rs)
494496
RPASS_FULL_RC := $(wildcard $(S)src/test/run-pass-fulldeps/*.rc)
495497
RPASS_FULL_RS := $(wildcard $(S)src/test/run-pass-fulldeps/*.rs)
496498
CFAIL_FULL_RC := $(wildcard $(S)src/test/compile-fail-fulldeps/*.rc)
@@ -511,6 +513,7 @@ CODEGEN_CC := $(wildcard $(S)src/test/codegen/*.cc)
511513
PERF_RS := $(wildcard $(S)src/test/bench/*.rs)
512514

513515
RPASS_TESTS := $(RPASS_RC) $(RPASS_RS)
516+
RPASS_VALGRIND_TESTS := $(RPASS_VALGRIND_RC) $(RPASS_VALGRIND_RS)
514517
RPASS_FULL_TESTS := $(RPASS_FULL_RC) $(RPASS_FULL_RS)
515518
CFAIL_FULL_TESTS := $(CFAIL_FULL_RC) $(CFAIL_FULL_RS)
516519
RFAIL_TESTS := $(RFAIL_RC) $(RFAIL_RS)
@@ -527,6 +530,14 @@ CTEST_BUILD_BASE_rpass = run-pass
527530
CTEST_MODE_rpass = run-pass
528531
CTEST_RUNTOOL_rpass = $(CTEST_RUNTOOL)
529532

533+
CTEST_SRC_BASE_rpass-valgrind = run-pass-valgrind
534+
CTEST_BUILD_BASE_rpass-valgrind = run-pass-valgrind
535+
CTEST_MODE_rpass-valgrind = run-pass-valgrind
536+
CTEST_RUNTOOL_rpass-valgrind = $(CTEST_RUNTOOL)
537+
ifdef VALGRIND_PATH
538+
CTEST_TESTARGS += --valgrind-path "$(VALGRIND_PATH)"
539+
endif
540+
530541
CTEST_SRC_BASE_rpass-full = run-pass-fulldeps
531542
CTEST_BUILD_BASE_rpass-full = run-pass-fulldeps
532543
CTEST_MODE_rpass-full = run-pass
@@ -622,7 +633,7 @@ TEST_SREQ$(1)_T_$(2)_H_$(3) = \
622633
# remove directive, if present, from CFG_RUSTC_FLAGS (issue #7898).
623634
CTEST_RUSTC_FLAGS := $$(subst --cfg ndebug,,$$(CFG_RUSTC_FLAGS))
624635

625-
# The tests can not be optimized while the rest of the compiler is optimized, so
636+
# The tests cannot be optimized while the rest of the compiler is optimized, so
626637
# filter out the optimization (if any) from rustc and then figure out if we need
627638
# to be optimized
628639
CTEST_RUSTC_FLAGS := $$(subst -O,,$$(CTEST_RUSTC_FLAGS))
@@ -634,6 +645,7 @@ endif
634645
# slow things down.
635646
CTEST_RUSTC_FLAGS += -C codegen-units=1
636647

648+
637649
CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) := \
638650
--compile-lib-path $$(HLIB$(1)_H_$(3)) \
639651
--run-lib-path $$(TLIB$(1)_T_$(2)_H_$(3)) \
@@ -655,6 +667,7 @@ CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) := \
655667
$$(CTEST_TESTARGS)
656668

657669
CTEST_DEPS_rpass_$(1)-T-$(2)-H-$(3) = $$(RPASS_TESTS)
670+
CTEST_DEPS_rpass-valgrind_$(1)-T-$(2)-H-$(3) = $$(RPASS_VALGRIND_TESTS)
658671
CTEST_DEPS_rpass-full_$(1)-T-$(2)-H-$(3) = $$(RPASS_FULL_TESTS) $$(CSREQ$(1)_T_$(3)_H_$(3)) $$(SREQ$(1)_T_$(2)_H_$(3))
659672
CTEST_DEPS_cfail-full_$(1)-T-$(2)-H-$(3) = $$(CFAIL_FULL_TESTS) $$(CSREQ$(1)_T_$(3)_H_$(3)) $$(SREQ$(1)_T_$(2)_H_$(3))
660673
CTEST_DEPS_rfail_$(1)-T-$(2)-H-$(3) = $$(RFAIL_TESTS)
@@ -726,7 +739,7 @@ endif
726739

727740
endef
728741

729-
CTEST_NAMES = rpass rpass-full cfail-full rfail cfail bench perf debuginfo-gdb debuginfo-lldb codegen
742+
CTEST_NAMES = rpass rpass-valgrind rpass-full cfail-full rfail cfail bench perf debuginfo-gdb debuginfo-lldb codegen
730743

731744
$(foreach host,$(CFG_HOST), \
732745
$(eval $(foreach target,$(CFG_TARGET), \
@@ -895,6 +908,7 @@ TEST_GROUPS = \
895908
$(foreach crate,$(TEST_CRATES),$(crate)) \
896909
$(foreach crate,$(TEST_DOC_CRATES),doc-crate-$(crate)) \
897910
rpass \
911+
rpass-valgrind \
898912
rpass-full \
899913
cfail-full \
900914
rfail \

branches/snap-stage3/src/compiletest/common.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ pub enum Mode {
1717
CompileFail,
1818
RunFail,
1919
RunPass,
20+
RunPassValgrind,
2021
Pretty,
2122
DebugInfoGdb,
2223
DebugInfoLldb,
@@ -29,6 +30,7 @@ impl FromStr for Mode {
2930
"compile-fail" => Some(CompileFail),
3031
"run-fail" => Some(RunFail),
3132
"run-pass" => Some(RunPass),
33+
"run-pass-valgrind" => Some(RunPassValgrind),
3234
"pretty" => Some(Pretty),
3335
"debuginfo-lldb" => Some(DebugInfoLldb),
3436
"debuginfo-gdb" => Some(DebugInfoGdb),
@@ -44,6 +46,7 @@ impl fmt::Show for Mode {
4446
CompileFail => "compile-fail",
4547
RunFail => "run-fail",
4648
RunPass => "run-pass",
49+
RunPassValgrind => "run-pass-valgrind",
4750
Pretty => "pretty",
4851
DebugInfoGdb => "debuginfo-gdb",
4952
DebugInfoLldb => "debuginfo-lldb",
@@ -70,6 +73,9 @@ pub struct Config {
7073
// The llvm binaries path
7174
pub llvm_bin_path: Option<Path>,
7275

76+
// The valgrind path
77+
pub valgrind_path: Option<String>,
78+
7379
// The directory containing the tests to run
7480
pub src_base: Path,
7581

branches/snap-stage3/src/compiletest/compiletest.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,14 @@ pub fn parse_config(args: Vec<String> ) -> Config {
5050
reqopt("", "run-lib-path", "path to target shared libraries", "PATH"),
5151
reqopt("", "rustc-path", "path to rustc to use for compiling", "PATH"),
5252
optopt("", "clang-path", "path to executable for codegen tests", "PATH"),
53+
optopt("", "valgrind-path", "path to valgrind executable for valgrind tests", "PROGRAM"),
5354
optopt("", "llvm-bin-path", "path to directory holding llvm binaries", "DIR"),
5455
reqopt("", "src-base", "directory to scan for test files", "PATH"),
5556
reqopt("", "build-base", "directory to deposit test outputs", "PATH"),
5657
reqopt("", "aux-base", "directory to find auxiliary test files", "PATH"),
5758
reqopt("", "stage-id", "the target-stage identifier", "stageN-TARGET"),
5859
reqopt("", "mode", "which sort of compile tests to run",
59-
"(compile-fail|run-fail|run-pass|pretty|debug-info)"),
60+
"(compile-fail|run-fail|run-pass|run-pass-valgrind|pretty|debug-info)"),
6061
optflag("", "ignored", "run tests marked as ignored"),
6162
optopt("", "runtool", "supervisor program to run tests under \
6263
(eg. emulator, valgrind)", "PROGRAM"),
@@ -125,6 +126,7 @@ pub fn parse_config(args: Vec<String> ) -> Config {
125126
run_lib_path: matches.opt_str("run-lib-path").unwrap(),
126127
rustc_path: opt_path(matches, "rustc-path"),
127128
clang_path: matches.opt_str("clang-path").map(|s| Path::new(s)),
129+
valgrind_path: matches.opt_str("valgrind-path"),
128130
llvm_bin_path: matches.opt_str("llvm-bin-path").map(|s| Path::new(s)),
129131
src_base: opt_path(matches, "src-base"),
130132
build_base: opt_path(matches, "build-base"),

branches/snap-stage3/src/compiletest/runtest.rs

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// except according to those terms.
1010

1111
use common::Config;
12-
use common::{CompileFail, Pretty, RunFail, RunPass, DebugInfoGdb};
12+
use common::{CompileFail, Pretty, RunFail, RunPass, RunPassValgrind, DebugInfoGdb};
1313
use common::{Codegen, DebugInfoLldb};
1414
use errors;
1515
use header::TestProps;
@@ -35,7 +35,6 @@ use std::time::Duration;
3535
use test::MetricMap;
3636

3737
pub fn run(config: Config, testfile: String) {
38-
3938
match config.target.as_slice() {
4039

4140
"arm-linux-androideabi" => {
@@ -64,6 +63,7 @@ pub fn run_metrics(config: Config, testfile: String, mm: &mut MetricMap) {
6463
CompileFail => run_cfail_test(&config, &props, &testfile),
6564
RunFail => run_rfail_test(&config, &props, &testfile),
6665
RunPass => run_rpass_test(&config, &props, &testfile),
66+
RunPassValgrind => run_valgrind_test(&config, &props, &testfile),
6767
Pretty => run_pretty_test(&config, &props, &testfile),
6868
DebugInfoGdb => run_debuginfo_gdb_test(&config, &props, &testfile),
6969
DebugInfoLldb => run_debuginfo_lldb_test(&config, &props, &testfile),
@@ -164,6 +164,27 @@ fn run_rpass_test(config: &Config, props: &TestProps, testfile: &Path) {
164164
}
165165
}
166166

167+
fn run_valgrind_test(config: &Config, props: &TestProps, testfile: &Path) {
168+
if config.valgrind_path.is_none() {
169+
return run_rpass_test(config, props, testfile);
170+
}
171+
172+
let mut proc_res = compile_test(config, props, testfile);
173+
174+
if !proc_res.status.success() {
175+
fatal_proc_rec("compilation failed!", &proc_res);
176+
}
177+
178+
println!("running valgrind");
179+
let mut new_config = config.clone();
180+
new_config.runtool = new_config.valgrind_path.clone();
181+
proc_res = exec_compiled_test(&new_config, props, testfile);
182+
183+
if !proc_res.status.success() {
184+
fatal_proc_rec("test run failed!", &proc_res);
185+
}
186+
}
187+
167188
fn run_pretty_test(config: &Config, props: &TestProps, testfile: &Path) {
168189
if props.pp_exact.is_some() {
169190
logv(config, "testing for exact pretty-printing".to_string());

branches/snap-stage3/src/libgetopts/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -804,7 +804,7 @@ pub fn short_usage(program_name: &str, opts: &[OptGroup]) -> String {
804804
/// whitespace removed, and are only cut at whitespace boundaries.
805805
///
806806
/// Note: Function was moved here from `std::str` because this module is the only place that
807-
/// uses it, and because it was to specific for a general string function.
807+
/// uses it, and because it was too specific for a general string function.
808808
///
809809
/// #Failure:
810810
///

branches/snap-stage3/src/test/run-pass/multidispatch-conditional-impl-not-considered.rs

Lines changed: 0 additions & 33 deletions
This file was deleted.

0 commit comments

Comments
 (0)