Skip to content

Commit b042eb6

Browse files
committed
---
yaml --- r: 12173 b: refs/heads/master c: 3955b3a h: refs/heads/master i: 12171: 4ae73c0 v: v3
1 parent a7f4f37 commit b042eb6

File tree

2 files changed

+28
-15
lines changed

2 files changed

+28
-15
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 18a97d71f95ad5b155537fff7b3a24758b08429e
2+
refs/heads/master: 3955b3a41aa4df8da4c5f0b22d0b72f5586b9851
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
55
refs/heads/try: 2898dcc5d97da9427ac367542382b6239d9c0bbf

trunk/src/compiletest/runtest.rs

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ fn run_pretty_test(config: config, props: test_props, testfile: str) {
130130
compare_source(expected, actual);
131131

132132
// Finally, let's make sure it actually appears to remain valid code
133-
let procres = typecheck_source(config, testfile, actual);
133+
let procres = typecheck_source(config, props, testfile, actual);
134134

135135
if procres.status != 0 {
136136
fatal_procres("pretty-printed source does not typecheck", procres);
@@ -169,9 +169,10 @@ actual:\n\
169169
}
170170
}
171171

172-
fn typecheck_source(config: config, testfile: str, src: str) -> procres {
173-
compose_and_run(config, testfile, make_typecheck_args,
174-
config.compile_lib_path, option::some(src))
172+
fn typecheck_source(config: config, props: test_props,
173+
testfile: str, src: str) -> procres {
174+
compose_and_run_compiler(
175+
config, props, testfile, make_typecheck_args, option::some(src))
175176
}
176177

177178
fn make_typecheck_args(config: config, _testfile: str) -> procargs {
@@ -285,6 +286,25 @@ type procres = {status: int, stdout: str, stderr: str, cmdline: str};
285286

286287
fn compile_test(config: config, props: test_props,
287288
testfile: str) -> procres {
289+
compose_and_run_compiler(config, props, testfile,
290+
make_compile_args(_, props, [], make_exe_name, _),
291+
none)
292+
}
293+
294+
fn exec_compiled_test(config: config, props: test_props,
295+
testfile: str) -> procres {
296+
compose_and_run(config, testfile,
297+
bind make_run_args(_, props, _),
298+
config.run_lib_path, option::none)
299+
}
300+
301+
fn compose_and_run_compiler(
302+
config: config,
303+
props: test_props,
304+
testfile: str,
305+
mk_args: fn(config: config, _testfile: str) -> procargs,
306+
input: option<str>) -> procres {
307+
288308
vec::iter(props.aux_builds) {|rel_ab|
289309
let abs_ab = path::connect(config.aux_base, rel_ab);
290310
let auxres = compose_and_run(config, abs_ab,
@@ -298,19 +318,12 @@ fn compile_test(config: config, props: test_props,
298318
}
299319
}
300320

301-
compose_and_run(config, testfile,
302-
make_compile_args(_, props, [], make_exe_name, _),
303-
config.compile_lib_path, option::none)
304-
}
305-
306-
fn exec_compiled_test(config: config, props: test_props,
307-
testfile: str) -> procres {
308-
compose_and_run(config, testfile, bind make_run_args(_, props, _),
309-
config.run_lib_path, option::none)
321+
compose_and_run(config, testfile, mk_args,
322+
config.compile_lib_path, input)
310323
}
311324

312325
fn compose_and_run(config: config, testfile: str,
313-
make_args: fn@(config, str) -> procargs, lib_path: str,
326+
make_args: fn(config, str) -> procargs, lib_path: str,
314327
input: option<str>) -> procres {
315328
let procargs = make_args(config, testfile);
316329
ret program_output(config, testfile, lib_path,

0 commit comments

Comments
 (0)