@@ -12,6 +12,7 @@ use errors::{Error, ErrorKind};
1212use rustc_serialize:: json;
1313use std:: str:: FromStr ;
1414use std:: path:: Path ;
15+ use runtest:: { fatal_proc_rec, ProcRes } ;
1516
1617// These structs are a subset of the ones found in
1718// `syntax::errors::json`.
@@ -55,13 +56,13 @@ struct DiagnosticCode {
5556 explanation : Option < String > ,
5657}
5758
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 > {
5960 output. lines ( )
60- . flat_map ( |line| parse_line ( file_name, line, output) )
61+ . flat_map ( |line| parse_line ( file_name, line, output, proc_res ) )
6162 . collect ( )
6263}
6364
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 > {
6566 // The compiler sometimes intermingles non-JSON stuff into the
6667 // output. This hack just skips over such lines. Yuck.
6768 if line. chars ( ) . next ( ) == Some ( '{' ) {
@@ -72,8 +73,9 @@ fn parse_line(file_name: &str, line: &str, output: &str) -> Vec<Error> {
7273 expected_errors
7374 }
7475 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) ;
7779 }
7880 }
7981 } else {
0 commit comments