Skip to content

Commit 53505e3

Browse files
committed
---
yaml --- r: 125407 b: refs/heads/auto c: 3ab170f h: refs/heads/master i: 125405: 57c88c4 125403: 697c168 125399: 6eb1e8e 125391: 7950ca7 125375: a0d6ce1 v: v3
1 parent d3675b0 commit 53505e3

File tree

36 files changed

+1066
-229
lines changed

36 files changed

+1066
-229
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1313
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1414
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1515
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16-
refs/heads/auto: e841a88b9298b0d1fef93192d8e163b44645fc73
16+
refs/heads/auto: 3ab170ffc5e45d31eef85db8fd7a3b68764f77c2
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/compiletest/header.rs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ pub struct TestProps {
3636
pub no_prefer_dynamic: bool,
3737
// Don't run --pretty expanded when running pretty printing tests
3838
pub no_pretty_expanded: bool,
39+
// Which pretty mode are we testing with, default to 'normal'
40+
pub pretty_mode: String,
41+
// Only compare pretty output and don't try compiling
42+
pub pretty_compare_only: bool,
3943
}
4044

4145
// Load any test directives embedded in the file
@@ -51,6 +55,8 @@ pub fn load_props(testfile: &Path) -> TestProps {
5155
let mut check_stdout = false;
5256
let mut no_prefer_dynamic = false;
5357
let mut no_pretty_expanded = false;
58+
let mut pretty_mode = None;
59+
let mut pretty_compare_only = false;
5460
iter_header(testfile, |ln| {
5561
match parse_error_pattern(ln) {
5662
Some(ep) => error_patterns.push(ep),
@@ -85,6 +91,14 @@ pub fn load_props(testfile: &Path) -> TestProps {
8591
no_pretty_expanded = parse_no_pretty_expanded(ln);
8692
}
8793

94+
if pretty_mode.is_none() {
95+
pretty_mode = parse_pretty_mode(ln);
96+
}
97+
98+
if !pretty_compare_only {
99+
pretty_compare_only = parse_pretty_compare_only(ln);
100+
}
101+
88102
match parse_aux_build(ln) {
89103
Some(ab) => { aux_builds.push(ab); }
90104
None => {}
@@ -115,6 +129,8 @@ pub fn load_props(testfile: &Path) -> TestProps {
115129
check_stdout: check_stdout,
116130
no_prefer_dynamic: no_prefer_dynamic,
117131
no_pretty_expanded: no_pretty_expanded,
132+
pretty_mode: pretty_mode.unwrap_or("normal".to_string()),
133+
pretty_compare_only: pretty_compare_only
118134
}
119135
}
120136

@@ -205,6 +221,14 @@ fn parse_no_pretty_expanded(line: &str) -> bool {
205221
parse_name_directive(line, "no-pretty-expanded")
206222
}
207223

224+
fn parse_pretty_mode(line: &str) -> Option<String> {
225+
parse_name_value_directive(line, "pretty-mode")
226+
}
227+
228+
fn parse_pretty_compare_only(line: &str) -> bool {
229+
parse_name_directive(line, "pretty-compare-only")
230+
}
231+
208232
fn parse_exec_env(line: &str) -> Option<(String, String)> {
209233
parse_name_value_directive(line, "exec-env").map(|nv| {
210234
// nv is either FOO or FOO=BAR

branches/auto/src/compiletest/runtest.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ fn run_pretty_test(config: &Config, props: &TestProps, testfile: &Path) {
168168
props,
169169
testfile,
170170
srcs[round].to_string(),
171-
"normal");
171+
props.pretty_mode.as_slice());
172172

173173
if !proc_res.status.success() {
174174
fatal_proc_rec(format!("pretty-printing failed in round {}",
@@ -200,6 +200,9 @@ fn run_pretty_test(config: &Config, props: &TestProps, testfile: &Path) {
200200

201201
compare_source(expected.as_slice(), actual.as_slice());
202202

203+
// If we're only making sure that the output matches then just stop here
204+
if props.pretty_compare_only { return; }
205+
203206
// Finally, let's make sure it actually appears to remain valid code
204207
let proc_res = typecheck_source(config, props, testfile, actual);
205208

0 commit comments

Comments
 (0)