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.
This commit is contained in:
Brian Anderson 2013-06-18 19:52:05 -07:00
parent 04b1dbabf5
commit 7f55fc33f0
3 changed files with 32 additions and 5 deletions

View file

@ -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;
}
}