diff options
| author | Brian Anderson <banderson@mozilla.com> | 2013-06-18 19:52:05 -0700 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2013-06-18 19:52:05 -0700 |
| commit | 7f55fc33f08a7ec5df0d06b4b0543bc864e60640 (patch) | |
| tree | d8b84b09faa330265850b263701d57e8dc775f9e /src/libstd | |
| parent | 04b1dbabf567f530c20e44d5e97967dae3aabd17 (diff) | |
| download | rust-7f55fc33f08a7ec5df0d06b4b0543bc864e60640.tar.gz rust-7f55fc33f08a7ec5df0d06b4b0543bc864e60640.zip | |
std: Work around some failing 'run' tests when valgrinding. #7224
Under valgrind on 64->32 cross compiles the dynamic linker is emitting some error messages on stderr, which interferes with the tests that are checking stderr.
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/run.rs | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/src/libstd/run.rs b/src/libstd/run.rs index b204cf6cfb0..7a96bf35218 100644 --- a/src/libstd/run.rs +++ b/src/libstd/run.rs @@ -915,7 +915,7 @@ priv fn waitpid(pid: pid_t) -> int { #[cfg(test)] mod tests { use io; - use libc::{c_int}; + use libc::{c_int, uintptr_t}; use option::{Option, None, Some}; use os; use path::Path; @@ -958,7 +958,10 @@ mod tests { assert_eq!(status, 0); assert_eq!(output_str.trim().to_owned(), ~"hello"); - assert_eq!(error, ~[]); + // FIXME #7224 + if !running_on_valgrind() { + assert_eq!(error, ~[]); + } } #[test] @@ -1043,7 +1046,10 @@ mod tests { assert_eq!(status, 0); assert_eq!(output_str.trim().to_owned(), ~"hello"); - assert_eq!(error, ~[]); + // FIXME #7224 + if !running_on_valgrind() { + assert_eq!(error, ~[]); + } } #[test] @@ -1057,14 +1063,20 @@ mod tests { assert_eq!(status, 0); assert_eq!(output_str.trim().to_owned(), ~"hello"); - assert_eq!(error, ~[]); + // FIXME #7224 + if !running_on_valgrind() { + assert_eq!(error, ~[]); + } let run::ProcessOutput {status, output, error} = prog.finish_with_output(); assert_eq!(status, 0); assert_eq!(output, ~[]); - assert_eq!(error, ~[]); + // FIXME #7224 + if !running_on_valgrind() { + assert_eq!(error, ~[]); + } } #[test] @@ -1169,4 +1181,12 @@ mod tests { assert!(output.contains("RUN_TEST_NEW_ENV=123")); } + + fn running_on_valgrind() -> bool { + unsafe { rust_running_on_valgrind() != 0 } + } + + extern { + fn rust_running_on_valgrind() -> uintptr_t; + } } |
