Skip to content

Commit

Permalink
compiletest: do not run tests in sub-threads if on valgrind.
Browse files Browse the repository at this point in the history
  • Loading branch information
graydon committed Aug 19, 2013
1 parent 19f4ae1 commit 610b2b5
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/compiletest/runtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ use std::os;
use std::str;
use std::task::{spawn_sched, SingleThreaded};
use std::vec;
use std::unstable::running_on_valgrind;

use extra::test::MetricMap;

Expand All @@ -38,11 +39,21 @@ pub fn run(config: config, testfile: ~str) {
// that destroys parallelism if we let normal schedulers block.
// It should be possible to remove this spawn once std::run is
// rewritten to be non-blocking.
do spawn_sched(SingleThreaded) {
//
// We do _not_ create another thread if we're running on V because
// it serializes all threads anyways.
if running_on_valgrind() {
let config = config.take();
let testfile = testfile.take();
let mut _mm = MetricMap::new();
run_metrics(config, testfile, &mut _mm);
} else {
do spawn_sched(SingleThreaded) {
let config = config.take();
let testfile = testfile.take();
let mut _mm = MetricMap::new();
run_metrics(config, testfile, &mut _mm);
}
}
}

Expand Down

5 comments on commit 610b2b5

@bors
Copy link
Contributor

@bors bors commented on 610b2b5 Aug 20, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from thestinger
at graydon@610b2b5

@bors
Copy link
Contributor

@bors bors commented on 610b2b5 Aug 20, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging graydon/rust/2013-08-13-self-rollup = 610b2b5 into auto

@bors
Copy link
Contributor

@bors bors commented on 610b2b5 Aug 20, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

graydon/rust/2013-08-13-self-rollup = 610b2b5 merged ok, testing candidate = 2ec9b8c

@bors
Copy link
Contributor

@bors bors commented on 610b2b5 Aug 20, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on 610b2b5 Aug 20, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = 2ec9b8c

Please sign in to comment.