Handle RUST_TEST_NOCAPTURE in compiletest and set add if to run env

closes  #17829
This commit is contained in:
Florian Hahn 2015-02-15 15:30:09 +01:00
parent 5be210c418
commit ef1308c407
2 changed files with 13 additions and 1 deletions

View file

@ -267,7 +267,7 @@ pub fn test_opts(config: &Config) -> test::TestOpts {
logfile: config.logfile.clone(),
run_tests: true,
run_benchmarks: true,
nocapture: false,
nocapture: env::var("RUST_TEST_NOCAPTURE").is_ok(),
color: test::AutoColor,
}
}

View file

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use std::env;
use common::Config;
use common;
use util;
@ -125,6 +127,16 @@ pub fn load_props(testfile: &Path) -> TestProps {
true
});
for key in vec!["RUST_TEST_NOCAPTURE", "RUST_TEST_TASKS"] {
match env::var(key) {
Ok(val) =>
if exec_env.iter().find(|&&(ref x, _)| *x == key.to_string()).is_none() {
exec_env.push((key.to_string(), val))
},
Err(..) => {}
}
}
TestProps {
error_patterns: error_patterns,
compile_flags: compile_flags,