Skip to content

Commit 8f61fd0

Browse files
committed
---
yaml --- r: 133887 b: refs/heads/snap-stage3 c: 0a83d02 h: refs/heads/master i: 133885: c87956a 133883: 8ad3d27 133879: c0ebdf3 133871: b9947e4 133855: 9b91a75 133823: 749373e 133759: 5abdc24 133631: 27967a1 v: v3
1 parent e1e45d5 commit 8f61fd0

File tree

156 files changed

+1808
-2759
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

156 files changed

+1808
-2759
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 0e784e16840e8a0c623cc6166de26da9334db3d6
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 5d335c94bd9017f16ce7538a5f4063e1178f15a1
4+
refs/heads/snap-stage3: 0a83d02efc0a403886a13eb8ffbc1b442c4d22d7
55
refs/heads/try: 777654cfccbfa39bc7f671d8e9629018ed8ca12d
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/configure

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ case $CFG_OSTYPE in
306306
# instead, msys defines $MSYSTEM which is MINGW32 on i686 and
307307
# MINGW64 on x86_64.
308308
CFG_CPUTYPE=i686
309-
CFG_OSTYPE=w64-mingw32
309+
CFG_OSTYPE=pc-mingw32
310310
if [ "$MSYSTEM" = MINGW64 ]
311311
then
312312
CFG_CPUTYPE=x86_64

branches/snap-stage3/src/compiletest/header.rs

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ pub struct TestProps {
4242
pub pretty_mode: String,
4343
// Only compare pretty output and don't try compiling
4444
pub pretty_compare_only: bool,
45-
// Patterns which must not appear in the output of a cfail test.
46-
pub forbid_output: Vec<String>,
4745
}
4846

4947
// Load any test directives embedded in the file
@@ -61,7 +59,6 @@ pub fn load_props(testfile: &Path) -> TestProps {
6159
let mut no_pretty_expanded = false;
6260
let mut pretty_mode = None;
6361
let mut pretty_compare_only = false;
64-
let mut forbid_output = Vec::new();
6562
iter_header(testfile, |ln| {
6663
match parse_error_pattern(ln) {
6764
Some(ep) => error_patterns.push(ep),
@@ -119,11 +116,6 @@ pub fn load_props(testfile: &Path) -> TestProps {
119116
None => ()
120117
};
121118

122-
match parse_forbid_output(ln) {
123-
Some(of) => forbid_output.push(of),
124-
None => (),
125-
}
126-
127119
true
128120
});
129121

@@ -140,8 +132,7 @@ pub fn load_props(testfile: &Path) -> TestProps {
140132
no_prefer_dynamic: no_prefer_dynamic,
141133
no_pretty_expanded: no_pretty_expanded,
142134
pretty_mode: pretty_mode.unwrap_or("normal".to_string()),
143-
pretty_compare_only: pretty_compare_only,
144-
forbid_output: forbid_output,
135+
pretty_compare_only: pretty_compare_only
145136
}
146137
}
147138

@@ -219,10 +210,6 @@ fn parse_error_pattern(line: &str) -> Option<String> {
219210
parse_name_value_directive(line, "error-pattern")
220211
}
221212

222-
fn parse_forbid_output(line: &str) -> Option<String> {
223-
parse_name_value_directive(line, "forbid-output")
224-
}
225-
226213
fn parse_aux_build(line: &str) -> Option<String> {
227214
parse_name_value_directive(line, "aux-build")
228215
}

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

Lines changed: 12 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,6 @@ pub fn run_metrics(config: Config, testfile: String, mm: &mut MetricMap) {
7171
}
7272
}
7373

74-
fn get_output(props: &TestProps, proc_res: &ProcRes) -> String {
75-
if props.check_stdout {
76-
format!("{}{}", proc_res.stdout, proc_res.stderr)
77-
} else {
78-
proc_res.stderr.clone()
79-
}
80-
}
81-
8274
fn run_cfail_test(config: &Config, props: &TestProps, testfile: &Path) {
8375
let proc_res = compile_test(config, props, testfile);
8476

@@ -89,22 +81,16 @@ fn run_cfail_test(config: &Config, props: &TestProps, testfile: &Path) {
8981

9082
check_correct_failure_status(&proc_res);
9183

92-
if proc_res.status.success() {
93-
fatal("process did not return an error status");
94-
}
95-
96-
let output_to_check = get_output(props, &proc_res);
9784
let expected_errors = errors::load_errors(&config.cfail_regex, testfile);
9885
if !expected_errors.is_empty() {
9986
if !props.error_patterns.is_empty() {
10087
fatal("both error pattern and expected errors specified");
10188
}
10289
check_expected_errors(expected_errors, testfile, &proc_res);
10390
} else {
104-
check_error_patterns(props, testfile, output_to_check.as_slice(), &proc_res);
91+
check_error_patterns(props, testfile, &proc_res);
10592
}
10693
check_no_compiler_crash(&proc_res);
107-
check_forbid_output(props, output_to_check.as_slice(), &proc_res);
10894
}
10995

11096
fn run_rfail_test(config: &Config, props: &TestProps, testfile: &Path) {
@@ -126,9 +112,8 @@ fn run_rfail_test(config: &Config, props: &TestProps, testfile: &Path) {
126112
fatal_proc_rec("run-fail test isn't valgrind-clean!", &proc_res);
127113
}
128114

129-
let output_to_check = get_output(props, &proc_res);
130115
check_correct_failure_status(&proc_res);
131-
check_error_patterns(props, testfile, output_to_check.as_slice(), &proc_res);
116+
check_error_patterns(props, testfile, &proc_res);
132117
}
133118

134119
fn check_correct_failure_status(proc_res: &ProcRes) {
@@ -849,15 +834,24 @@ fn check_debugger_output(debugger_run_result: &ProcRes, check_lines: &[String])
849834

850835
fn check_error_patterns(props: &TestProps,
851836
testfile: &Path,
852-
output_to_check: &str,
853837
proc_res: &ProcRes) {
854838
if props.error_patterns.is_empty() {
855839
fatal(format!("no error pattern specified in {}",
856840
testfile.display()).as_slice());
857841
}
842+
843+
if proc_res.status.success() {
844+
fatal("process did not return an error status");
845+
}
846+
858847
let mut next_err_idx = 0u;
859848
let mut next_err_pat = &props.error_patterns[next_err_idx];
860849
let mut done = false;
850+
let output_to_check = if props.check_stdout {
851+
format!("{}{}", proc_res.stdout, proc_res.stderr)
852+
} else {
853+
proc_res.stderr.clone()
854+
};
861855
for line in output_to_check.as_slice().lines() {
862856
if line.contains(next_err_pat.as_slice()) {
863857
debug!("found error pattern {}", next_err_pat);
@@ -896,16 +890,6 @@ fn check_no_compiler_crash(proc_res: &ProcRes) {
896890
}
897891
}
898892

899-
fn check_forbid_output(props: &TestProps,
900-
output_to_check: &str,
901-
proc_res: &ProcRes) {
902-
for pat in props.forbid_output.iter() {
903-
if output_to_check.contains(pat.as_slice()) {
904-
fatal_proc_rec("forbidden pattern found in compiler output", proc_res);
905-
}
906-
}
907-
}
908-
909893
fn check_expected_errors(expected_errors: Vec<errors::ExpectedError> ,
910894
testfile: &Path,
911895
proc_res: &ProcRes) {

branches/snap-stage3/src/doc/guide.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1575,6 +1575,8 @@ we haven't seen before. Here's a simple program that reads some input,
15751575
and then prints it back out:
15761576

15771577
```{rust,ignore}
1578+
use std::io;
1579+
15781580
fn main() {
15791581
println!("Type something!");
15801582

0 commit comments

Comments
 (0)