Skip to content
Permalink
Browse files

compiletest: do not run tests in sub-threads if on valgrind.

  • Loading branch information
graydon committed Aug 19, 2013
1 parent 19f4ae1 commit 610b2b58ecfcce10dd448c11941de956206d1bd1
Showing with 12 additions and 1 deletion.
  1. +12 −1 src/compiletest/runtest.rs
@@ -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;

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

5 comments on commit 610b2b5

@bors

This comment has been minimized.

Copy link
Contributor

@bors bors replied Aug 20, 2013

saw approval from thestinger
at graydon@610b2b5

@bors

This comment has been minimized.

Copy link
Contributor

@bors bors replied Aug 20, 2013

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

@bors

This comment has been minimized.

Copy link
Contributor

@bors bors replied Aug 20, 2013

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

@bors

This comment has been minimized.

@bors

This comment has been minimized.

Copy link
Contributor

@bors bors replied Aug 20, 2013

fast-forwarding master to auto = 2ec9b8c

Please sign in to comment.
You can’t perform that action at this time.