diff options
| author | Florian Hahn <flo@fhahn.com> | 2015-02-15 15:30:09 +0100 |
|---|---|---|
| committer | Florian Hahn <flo@fhahn.com> | 2015-02-16 17:11:42 +0100 |
| commit | ef1308c407c34d91d176f1de6c0f86ecbea615f4 (patch) | |
| tree | 8ea32b5476d404ac20da8a72cf9840af9caef555 /src | |
| parent | 5be210c4188fb2f1a4fabc6baee5397ac6e6741e (diff) | |
| download | rust-ef1308c407c34d91d176f1de6c0f86ecbea615f4.tar.gz rust-ef1308c407c34d91d176f1de6c0f86ecbea615f4.zip | |
Handle RUST_TEST_NOCAPTURE in compiletest and set add if to run env
closes #17829
Diffstat (limited to 'src')
| -rw-r--r-- | src/compiletest/compiletest.rs | 2 | ||||
| -rw-r--r-- | src/compiletest/header.rs | 12 |
2 files changed, 13 insertions, 1 deletions
diff --git a/src/compiletest/compiletest.rs b/src/compiletest/compiletest.rs index 385f1b9e791..d43fe242c65 100644 --- a/src/compiletest/compiletest.rs +++ b/src/compiletest/compiletest.rs @@ -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, } } diff --git a/src/compiletest/header.rs b/src/compiletest/header.rs index c2539679643..fceac9716b1 100644 --- a/src/compiletest/header.rs +++ b/src/compiletest/header.rs @@ -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, |
