@@ -12,6 +12,7 @@ use errors::{Error, ErrorKind};
12
12
use rustc_serialize:: json;
13
13
use std:: str:: FromStr ;
14
14
use std:: path:: Path ;
15
+ use runtest:: { fatal_proc_rec, ProcRes } ;
15
16
16
17
// These structs are a subset of the ones found in
17
18
// `syntax::errors::json`.
@@ -55,13 +56,13 @@ struct DiagnosticCode {
55
56
explanation : Option < String > ,
56
57
}
57
58
58
- pub fn parse_output ( file_name : & str , output : & str ) -> Vec < Error > {
59
+ pub fn parse_output ( file_name : & str , output : & str , proc_res : & ProcRes ) -> Vec < Error > {
59
60
output. lines ( )
60
- . flat_map ( |line| parse_line ( file_name, line, output) )
61
+ . flat_map ( |line| parse_line ( file_name, line, output, proc_res ) )
61
62
. collect ( )
62
63
}
63
64
64
- fn parse_line ( file_name : & str , line : & str , output : & str ) -> Vec < Error > {
65
+ fn parse_line ( file_name : & str , line : & str , output : & str , proc_res : & ProcRes ) -> Vec < Error > {
65
66
// The compiler sometimes intermingles non-JSON stuff into the
66
67
// output. This hack just skips over such lines. Yuck.
67
68
if line. chars ( ) . next ( ) == Some ( '{' ) {
@@ -72,8 +73,9 @@ fn parse_line(file_name: &str, line: &str, output: &str) -> Vec<Error> {
72
73
expected_errors
73
74
}
74
75
Err ( error) => {
75
- panic ! ( "failed to decode compiler output as json: `{}`\n output: {}\n line: {}" ,
76
- error, line, output) ;
76
+ fatal_proc_rec ( None , & format ! (
77
+ "failed to decode compiler output as json: `{}`\n output: {}\n line: {}" ,
78
+ error, line, output) , proc_res) ;
77
79
}
78
80
}
79
81
} else {
0 commit comments