Skip to content

Commit 207273a

Browse files
committed
---
yaml --- r: 32309 b: refs/heads/dist-snap c: e27b8f7 h: refs/heads/master i: 32307: 2a00086 v: v3
1 parent 0fb0bc3 commit 207273a

File tree

4 files changed

+38
-11
lines changed

4 files changed

+38
-11
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df
99
refs/heads/incoming: d9317a174e434d4c99fc1a37fd7dc0d2f5328d37
10-
refs/heads/dist-snap: b999973c0ffa86738daab277cd6e985248ef08aa
10+
refs/heads/dist-snap: e27b8f7f02a6d9f963aae5823bbe07a962c04e33
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/dist-snap/src/compiletest/common.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,10 @@ type config = {
4949
// Flags to pass to the compiler
5050
rustcflags: Option<~str>,
5151

52+
// Run tests using the JIT
53+
jit: bool,
54+
5255
// Explain what's going on
53-
verbose: bool};
56+
verbose: bool
57+
58+
};

branches/dist-snap/src/compiletest/compiletest.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ fn parse_config(args: ~[~str]) -> config {
3232
getopts::reqopt(~"mode"), getopts::optflag(~"ignored"),
3333
getopts::optopt(~"runtool"), getopts::optopt(~"rustcflags"),
3434
getopts::optflag(~"verbose"),
35-
getopts::optopt(~"logfile")];
35+
getopts::optopt(~"logfile"),
36+
getopts::optflag(~"jit")];
3637

3738
assert (vec::is_not_empty(args));
3839
let args_ = vec::tail(args);
@@ -64,6 +65,7 @@ fn parse_config(args: ~[~str]) -> config {
6465
|s| Path(s)),
6566
runtool: getopts::opt_maybe_str(matches, ~"runtool"),
6667
rustcflags: getopts::opt_maybe_str(matches, ~"rustcflags"),
68+
jit: getopts::opt_present(matches, ~"jit"),
6769
verbose: getopts::opt_present(matches, ~"verbose")};
6870
}
6971

@@ -81,6 +83,7 @@ fn log_config(config: config) {
8183
logv(c, fmt!("filter: %s", opt_str(config.filter)));
8284
logv(c, fmt!("runtool: %s", opt_str(config.runtool)));
8385
logv(c, fmt!("rustcflags: %s", opt_str(config.rustcflags)));
86+
logv(c, fmt!("jit: %b", config.jit));
8487
logv(c, fmt!("verbose: %b", config.verbose));
8588
logv(c, fmt!("\n"));
8689
}

branches/dist-snap/src/compiletest/runtest.rs

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,15 @@ fn run_cfail_test(config: config, props: test_props, testfile: &Path) {
4848
}
4949

5050
fn run_rfail_test(config: config, props: test_props, testfile: &Path) {
51-
let mut procres = compile_test(config, props, testfile);
51+
let procres = if !config.jit {
52+
let procres = compile_test(config, props, testfile);
5253

53-
if procres.status != 0 { fatal_procres(~"compilation failed!", procres); }
54+
if procres.status != 0 { fatal_procres(~"compilation failed!", procres); }
5455
55-
procres = exec_compiled_test(config, props, testfile);
56+
exec_compiled_test(config, props, testfile)
57+
} else {
58+
jit_test(config, props, testfile)
59+
};
5660
5761
// The value our Makefile configures valgrind to return on failure
5862
const valgrind_err: int = 100;
@@ -76,13 +80,19 @@ fn check_correct_failure_status(procres: procres) {
7680
}
7781

7882
fn run_rpass_test(config: config, props: test_props, testfile: &Path) {
79-
let mut procres = compile_test(config, props, testfile);
83+
if !config.jit {
84+
let mut procres = compile_test(config, props, testfile);
85+
86+
if procres.status != 0 { fatal_procres(~"compilation failed!", procres); }
8087
81-
if procres.status != 0 { fatal_procres(~"compilation failed!", procres); }
88+
procres = exec_compiled_test(config, props, testfile);
8289
83-
procres = exec_compiled_test(config, props, testfile);
90+
if procres.status != 0 { fatal_procres(~"test run failed!", procres); }
91+
} else {
92+
let mut procres = jit_test(config, props, testfile);
8493
85-
if procres.status != 0 { fatal_procres(~"test run failed!", procres); }
94+
if procres.status != 0 { fatal_procres(~"jit failed!", procres); }
95+
}
8696
}
8797
8898
fn run_pretty_test(config: config, props: test_props, testfile: &Path) {
@@ -295,10 +305,19 @@ type procres = {status: int, stdout: ~str, stderr: ~str, cmdline: ~str};
295305

296306
fn compile_test(config: config, props: test_props,
297307
testfile: &Path) -> procres {
308+
compile_test_(config, props, testfile, [])
309+
}
310+
311+
fn jit_test(config: config, props: test_props, testfile: &Path) -> procres {
312+
compile_test_(config, props, testfile, [~"--jit"])
313+
}
314+
315+
fn compile_test_(config: config, props: test_props,
316+
testfile: &Path, extra_args: &[~str]) -> procres {
298317
let link_args = ~[~"-L", aux_output_dir_name(config, testfile).to_str()];
299318
compose_and_run_compiler(
300319
config, props, testfile,
301-
make_compile_args(config, props, link_args,
320+
make_compile_args(config, props, link_args + extra_args,
302321
make_exe_name, testfile),
303322
None)
304323
}

0 commit comments

Comments
 (0)