Skip to content

use a single test task when valgrinding #1921 #10250

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 14 additions & 9 deletions src/libextra/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ use std::task;
use std::to_str::ToStr;
use std::f64;
use std::os;
use std::unstable::running_on_valgrind;


// The name of a test. By convention this follows the rules for rust
Expand Down Expand Up @@ -775,16 +776,20 @@ fn run_tests(opts: &TestOpts,

fn get_concurrency() -> uint {
use std::rt;
match os::getenv("RUST_TEST_TASKS") {
Some(s) => {
let opt_n: Option<uint> = FromStr::from_str(s);
match opt_n {
Some(n) if n > 0 => n,
_ => fail!("RUST_TEST_TASKS is `{}`, should be a positive integer.", s)
if running_on_valgrind() {
1
} else {
match os::getenv("RUST_TEST_TASKS") {
Some(s) => {
let opt_n: Option<uint> = FromStr::from_str(s);
match opt_n {
Some(n) if n > 0 => n,
_ => fail!("RUST_TEST_TASKS is `{}`, should be a positive integer.", s)
}
}
None => {
rt::default_sched_threads()
}
}
None => {
rt::default_sched_threads()
}
}
}
Expand Down