@@ -23,6 +23,7 @@ use crate::common::{
2323} ;
2424use crate :: directives:: TestProps ;
2525use crate :: errors:: { Error , ErrorKind , load_errors} ;
26+ use crate :: output_capture:: ConsoleOut ;
2627use crate :: read2:: { Truncated , read2_abbreviated} ;
2728use crate :: runtest:: compute_diff:: { DiffLine , make_diff, write_diff, write_filtered_diff} ;
2829use crate :: util:: { Utf8PathBufExt , add_dylib_path, static_regex} ;
@@ -108,7 +109,13 @@ fn dylib_name(name: &str) -> String {
108109 format ! ( "{}{name}.{}" , std:: env:: consts:: DLL_PREFIX , std:: env:: consts:: DLL_EXTENSION )
109110}
110111
111- pub fn run ( config : Arc < Config > , testpaths : & TestPaths , revision : Option < & str > ) {
112+ pub fn run (
113+ config : Arc < Config > ,
114+ stdout : & dyn ConsoleOut ,
115+ stderr : & dyn ConsoleOut ,
116+ testpaths : & TestPaths ,
117+ revision : Option < & str > ,
118+ ) {
112119 match & * config. target {
113120 "arm-linux-androideabi"
114121 | "armv7-linux-androideabi"
@@ -143,7 +150,7 @@ pub fn run(config: Arc<Config>, testpaths: &TestPaths, revision: Option<&str>) {
143150 props. incremental_dir = Some ( incremental_dir ( & config, testpaths, revision) ) ;
144151 }
145152
146- let cx = TestCx { config : & config, props : & props, testpaths, revision } ;
153+ let cx = TestCx { config : & config, stdout , stderr , props : & props, testpaths, revision } ;
147154
148155 if let Err ( e) = create_dir_all ( & cx. output_base_dir ( ) ) {
149156 panic ! ( "failed to create output base directory {}: {e}" , cx. output_base_dir( ) ) ;
@@ -162,6 +169,8 @@ pub fn run(config: Arc<Config>, testpaths: &TestPaths, revision: Option<&str>) {
162169 revision_props. incremental_dir = props. incremental_dir . clone ( ) ;
163170 let rev_cx = TestCx {
164171 config : & config,
172+ stdout,
173+ stderr,
165174 props : & revision_props,
166175 testpaths,
167176 revision : Some ( revision) ,
@@ -212,6 +221,8 @@ pub fn compute_stamp_hash(config: &Config) -> String {
212221#[ derive( Copy , Clone , Debug ) ]
213222struct TestCx < ' test > {
214223 config : & ' test Config ,
224+ stdout : & ' test dyn ConsoleOut ,
225+ stderr : & ' test dyn ConsoleOut ,
215226 props : & ' test TestProps ,
216227 testpaths : & ' test TestPaths ,
217228 revision : Option < & ' test str > ,
@@ -978,6 +989,8 @@ impl<'test> TestCx<'test> {
978989 self . props . from_aux_file ( & aux_testpaths. file , self . revision , self . config ) ;
979990 let aux_cx = TestCx {
980991 config : self . config ,
992+ stdout : self . stdout ,
993+ stderr : self . stderr ,
981994 props : & props_for_aux,
982995 testpaths : & aux_testpaths,
983996 revision : self . revision ,
@@ -1343,6 +1356,8 @@ impl<'test> TestCx<'test> {
13431356 let aux_output = TargetLocation :: ThisDirectory ( aux_dir. clone ( ) ) ;
13441357 let aux_cx = TestCx {
13451358 config : self . config ,
1359+ stdout : self . stdout ,
1360+ stderr : self . stderr ,
13461361 props : & aux_props,
13471362 testpaths : & aux_testpaths,
13481363 revision : self . revision ,
0 commit comments