Skip to content

rustbuild: Touch up some test suites #33625

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 21, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions src/bootstrap/build/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,18 @@ pub fn compiletest(build: &Build,
cmd.arg("--host").arg(compiler.host);
cmd.arg("--llvm-filecheck").arg(build.llvm_filecheck(&build.config.build));

let mut flags = format!("-Crpath");
if build.config.rust_optimize_tests {
flags.push_str(" -O");
}
if build.config.rust_debuginfo_tests {
flags.push_str(" -g");
}

cmd.arg("--host-rustcflags").arg(&flags);

let linkflag = format!("-Lnative={}", build.test_helpers_out(target).display());
cmd.arg("--host-rustcflags").arg("-Crpath");
cmd.arg("--target-rustcflags").arg(format!("-Crpath {}", linkflag));
cmd.arg("--target-rustcflags").arg(format!("{} {}", flags, linkflag));

// FIXME: needs android support
cmd.arg("--android-cross-path").arg("");
Expand Down
9 changes: 9 additions & 0 deletions src/bootstrap/build/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ pub struct Config {
pub rust_rpath: bool,
pub rustc_default_linker: Option<String>,
pub rustc_default_ar: Option<String>,
pub rust_optimize_tests: bool,
pub rust_debuginfo_tests: bool,

pub build: String,
pub host: Vec<String>,
Expand Down Expand Up @@ -136,6 +138,8 @@ struct Rust {
channel: Option<String>,
musl_root: Option<String>,
rpath: Option<bool>,
optimize_tests: Option<bool>,
debuginfo_tests: Option<bool>,
}

/// TOML representation of how each build target is configured.
Expand All @@ -154,6 +158,7 @@ impl Config {
config.llvm_optimize = true;
config.use_jemalloc = true;
config.rust_optimize = true;
config.rust_optimize_tests = true;
config.submodules = true;
config.docs = true;
config.rust_rpath = true;
Expand Down Expand Up @@ -219,6 +224,8 @@ impl Config {
set(&mut config.rust_debug_assertions, rust.debug_assertions);
set(&mut config.rust_debuginfo, rust.debuginfo);
set(&mut config.rust_optimize, rust.optimize);
set(&mut config.rust_optimize_tests, rust.optimize_tests);
set(&mut config.rust_debuginfo_tests, rust.debuginfo_tests);
set(&mut config.rust_rpath, rust.rpath);
set(&mut config.debug_jemalloc, rust.debug_jemalloc);
set(&mut config.use_jemalloc, rust.use_jemalloc);
Expand Down Expand Up @@ -306,6 +313,8 @@ impl Config {
("JEMALLOC", self.use_jemalloc),
("DEBUG_JEMALLOC", self.debug_jemalloc),
("RPATH", self.rust_rpath),
("OPTIMIZE_TESTS", self.rust_optimize_tests),
("DEBUGINFO_TESTS", self.rust_debuginfo_tests),
}

match key {
Expand Down
40 changes: 32 additions & 8 deletions src/bootstrap/build/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -318,10 +318,18 @@ impl Build {
check::compiletest(self, &compiler, target.target,
"run-pass", "run-pass");
}
CheckRPassFull { compiler } => {
check::compiletest(self, &compiler, target.target,
"run-pass", "run-pass-fulldeps");
}
CheckCFail { compiler } => {
check::compiletest(self, &compiler, target.target,
"compile-fail", "compile-fail");
}
CheckCFailFull { compiler } => {
check::compiletest(self, &compiler, target.target,
"compile-fail", "compile-fail-fulldeps")
}
CheckPFail { compiler } => {
check::compiletest(self, &compiler, target.target,
"parse-fail", "parse-fail");
Expand All @@ -330,10 +338,34 @@ impl Build {
check::compiletest(self, &compiler, target.target,
"run-fail", "run-fail");
}
CheckRFailFull { compiler } => {
check::compiletest(self, &compiler, target.target,
"run-fail", "run-fail-fulldeps");
}
CheckPretty { compiler } => {
check::compiletest(self, &compiler, target.target,
"pretty", "pretty");
}
CheckPrettyRPass { compiler } => {
check::compiletest(self, &compiler, target.target,
"pretty", "run-pass");
}
CheckPrettyRPassFull { compiler } => {
check::compiletest(self, &compiler, target.target,
"pretty", "run-pass-fulldeps");
}
CheckPrettyRFail { compiler } => {
check::compiletest(self, &compiler, target.target,
"pretty", "run-fail");
}
CheckPrettyRFailFull { compiler } => {
check::compiletest(self, &compiler, target.target,
"pretty", "run-fail-fulldeps");
}
CheckPrettyRPassValgrind { compiler } => {
check::compiletest(self, &compiler, target.target,
"pretty", "run-pass-valgrind");
}
CheckCodegen { compiler } => {
check::compiletest(self, &compiler, target.target,
"codegen", "codegen");
Expand Down Expand Up @@ -370,14 +402,6 @@ impl Build {
check::compiletest(self, &compiler, target.target,
"run-pass-valgrind", "run-pass-valgrind");
}
CheckRPassFull { compiler } => {
check::compiletest(self, &compiler, target.target,
"run-pass", "run-pass-fulldeps");
}
CheckCFailFull { compiler } => {
check::compiletest(self, &compiler, target.target,
"compile-fail", "compile-fail-fulldeps")
}
CheckDocs { compiler } => {
check::docs(self, &compiler);
}
Expand Down
32 changes: 25 additions & 7 deletions src/bootstrap/build/step.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,19 +106,25 @@ macro_rules! targets {
(check_cargotest, CheckCargoTest { stage: u32 }),
(check_tidy, CheckTidy { stage: u32 }),
(check_rpass, CheckRPass { compiler: Compiler<'a> }),
(check_rpass_full, CheckRPassFull { compiler: Compiler<'a> }),
(check_rpass_valgrind, CheckRPassValgrind { compiler: Compiler<'a> }),
(check_rfail, CheckRFail { compiler: Compiler<'a> }),
(check_rfail_full, CheckRFailFull { compiler: Compiler<'a> }),
(check_cfail, CheckCFail { compiler: Compiler<'a> }),
(check_cfail_full, CheckCFailFull { compiler: Compiler<'a> }),
(check_pfail, CheckPFail { compiler: Compiler<'a> }),
(check_pretty, CheckPretty { compiler: Compiler<'a> }),
(check_pretty_rpass, CheckPrettyRPass { compiler: Compiler<'a> }),
(check_pretty_rpass_full, CheckPrettyRPassFull { compiler: Compiler<'a> }),
(check_pretty_rfail, CheckPrettyRFail { compiler: Compiler<'a> }),
(check_pretty_rfail_full, CheckPrettyRFailFull { compiler: Compiler<'a> }),
(check_pretty_rpass_valgrind, CheckPrettyRPassValgrind { compiler: Compiler<'a> }),
(check_codegen, CheckCodegen { compiler: Compiler<'a> }),
(check_codegen_units, CheckCodegenUnits { compiler: Compiler<'a> }),
(check_incremental, CheckIncremental { compiler: Compiler<'a> }),
(check_ui, CheckUi { compiler: Compiler<'a> }),
(check_debuginfo, CheckDebuginfo { compiler: Compiler<'a> }),
(check_rustdoc, CheckRustdoc { compiler: Compiler<'a> }),
(check_pretty, CheckPretty { compiler: Compiler<'a> }),
(check_rpass_valgrind, CheckRPassValgrind { compiler: Compiler<'a> }),
(check_rpass_full, CheckRPassFull { compiler: Compiler<'a> }),
(check_cfail_full, CheckCFailFull { compiler: Compiler<'a> }),
(check_docs, CheckDocs { compiler: Compiler<'a> }),
(check_error_index, CheckErrorIndex { compiler: Compiler<'a> }),
(check_rmake, CheckRMake { compiler: Compiler<'a> }),
Expand Down Expand Up @@ -378,8 +384,11 @@ impl<'a> Step<'a> {
Source::Check { stage, compiler } => {
vec![
self.check_rpass(compiler),
self.check_cfail(compiler),
self.check_rpass_full(compiler),
self.check_rfail(compiler),
self.check_rfail_full(compiler),
self.check_cfail(compiler),
self.check_cfail_full(compiler),
self.check_pfail(compiler),
self.check_incremental(compiler),
self.check_ui(compiler),
Expand All @@ -391,9 +400,12 @@ impl<'a> Step<'a> {
self.check_debuginfo(compiler),
self.check_rustdoc(compiler),
self.check_pretty(compiler),
self.check_pretty_rpass(compiler),
self.check_pretty_rpass_full(compiler),
self.check_pretty_rfail(compiler),
self.check_pretty_rfail_full(compiler),
self.check_pretty_rpass_valgrind(compiler),
self.check_rpass_valgrind(compiler),
self.check_rpass_full(compiler),
self.check_cfail_full(compiler),
self.check_error_index(compiler),
self.check_docs(compiler),
self.check_rmake(compiler),
Expand All @@ -412,6 +424,8 @@ impl<'a> Step<'a> {
Source::CheckTidy { stage } => {
vec![self.tool_tidy(stage)]
}
Source::CheckPrettyRPass { compiler } |
Source::CheckPrettyRFail { compiler } |
Source::CheckRFail { compiler } |
Source::CheckPFail { compiler } |
Source::CheckCodegen { compiler } |
Expand All @@ -438,7 +452,11 @@ impl<'a> Step<'a> {
]
}
Source::CheckRPassFull { compiler } |
Source::CheckRFailFull { compiler } |
Source::CheckCFailFull { compiler } |
Source::CheckPrettyRPassFull { compiler } |
Source::CheckPrettyRFailFull { compiler } |
Source::CheckPrettyRPassValgrind { compiler } |
Source::CheckRMake { compiler } => {
vec![self.librustc(compiler),
self.tool_compiletest(compiler.stage)]
Expand Down
5 changes: 5 additions & 0 deletions src/bootstrap/config.toml.example
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@
# desired in distributions, for example.
#rpath = true

# Flag indicating whether tests are compiled with optimizations (the -O flag) or
# with debuginfo (the -g flag)
#optimize-tests = true
#debuginfo-tests = true

# =============================================================================
# Options for specific targets
#
Expand Down
1 change: 0 additions & 1 deletion src/librustc_bitflags/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ version = "0.0.0"
[lib]
name = "rustc_bitflags"
path = "lib.rs"
test = false
doctest = false
Loading