Don't stop at first test failure
Since compiletest is setting up its own test tasks it needs to configure them the correct way, which means allowing them to leak.
This commit is contained in:
parent
51ef7a3676
commit
e81d6d28e7
|
@ -22,6 +22,7 @@ export filter_tests;
|
||||||
export parse_opts;
|
export parse_opts;
|
||||||
export test_to_task;
|
export test_to_task;
|
||||||
export default_test_to_task;
|
export default_test_to_task;
|
||||||
|
export configure_test_task;
|
||||||
|
|
||||||
// The name of a test. By convention this follows the rules for rust
|
// The name of a test. By convention this follows the rules for rust
|
||||||
// paths, i.e it should be a series of identifiers seperated by double
|
// paths, i.e it should be a series of identifiers seperated by double
|
||||||
|
@ -300,6 +301,16 @@ native "rust" mod rustrt {
|
||||||
// only works with functions that don't contain closures.
|
// only works with functions that don't contain closures.
|
||||||
fn default_test_to_task(f: &fn()) -> task {
|
fn default_test_to_task(f: &fn()) -> task {
|
||||||
fn run_task(fptr: *mutable fn() ) {
|
fn run_task(fptr: *mutable fn() ) {
|
||||||
|
configure_test_task();
|
||||||
|
// Run the test
|
||||||
|
(*fptr)()
|
||||||
|
}
|
||||||
|
let fptr = ptr::addr_of(f);
|
||||||
|
ret spawn run_task(fptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Call from within a test task to make sure it's set up correctly
|
||||||
|
fn configure_test_task() {
|
||||||
// If this task fails we don't want that failure to propagate to the
|
// If this task fails we don't want that failure to propagate to the
|
||||||
// test runner or else we couldn't keep running tests
|
// test runner or else we couldn't keep running tests
|
||||||
task::unsupervise();
|
task::unsupervise();
|
||||||
|
@ -309,16 +320,8 @@ fn default_test_to_task(f: &fn()) -> task {
|
||||||
// sanity checks in the runtime's memory region for the task, so that
|
// sanity checks in the runtime's memory region for the task, so that
|
||||||
// the test runner can continue.
|
// the test runner can continue.
|
||||||
rustrt::hack_allow_leaks();
|
rustrt::hack_allow_leaks();
|
||||||
|
|
||||||
|
|
||||||
// Run the test
|
|
||||||
(*fptr)()
|
|
||||||
}
|
|
||||||
let fptr = ptr::addr_of(f);
|
|
||||||
ret spawn run_task(fptr);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Local Variables:
|
// Local Variables:
|
||||||
// mode: rust;
|
// mode: rust;
|
||||||
// fill-column: 78;
|
// fill-column: 78;
|
||||||
|
|
|
@ -388,12 +388,12 @@ mod runtest {
|
||||||
export run;
|
export run;
|
||||||
|
|
||||||
fn run(cx: &cx, testfile: &str) {
|
fn run(cx: &cx, testfile: &str) {
|
||||||
|
test::configure_test_task();
|
||||||
if (cx.config.verbose) {
|
if (cx.config.verbose) {
|
||||||
// We're going to be dumping a lot of info. Start on a new line.
|
// We're going to be dumping a lot of info. Start on a new line.
|
||||||
io::stdout().write_str("\n\n");
|
io::stdout().write_str("\n\n");
|
||||||
}
|
}
|
||||||
log #fmt("running %s", testfile);
|
log #fmt("running %s", testfile);
|
||||||
task::unsupervise();
|
|
||||||
let props = load_props(testfile);
|
let props = load_props(testfile);
|
||||||
alt cx.config.mode {
|
alt cx.config.mode {
|
||||||
mode_compile_fail. { run_cfail_test(cx, props, testfile); }
|
mode_compile_fail. { run_cfail_test(cx, props, testfile); }
|
||||||
|
|
Loading…
Reference in New Issue