libtest: Only colorize output if stdout is a tty

Fixes #14570.
This commit is contained in:
Ben Noordhuis 2014-05-31 21:55:18 +02:00
parent bcf3464827
commit 87ecd4f75b

View File

@ -868,7 +868,9 @@ fn should_sort_failures_before_printing_them() {
assert!(apos < bpos);
}
fn use_color() -> bool { return get_concurrency() == 1; }
fn use_color() -> bool {
get_concurrency() == 1 && io::stdout().get_ref().isatty()
}
#[deriving(Clone)]
enum TestEvent {