@@ -64,6 +64,8 @@ pub fn run_cts(
6464 let skip_checkout = args. contains ( "--skip-checkout" ) ;
6565 let llvm_cov = args. contains ( "--llvm-cov" ) ;
6666 let release = args. contains ( "--release" ) ;
67+ let mut quiet = args. contains ( "--quiet" ) ;
68+ let verbose = args. contains ( "--verbose" ) ;
6769 let running_on_backend = args. opt_value_from_str :: < _ , String > ( "--backend" ) ?;
6870 let mut filter_pattern = args. opt_value_from_str :: < _ , String > ( "--filter" ) ?;
6971 let mut filter_invert = false ;
@@ -109,6 +111,9 @@ pub fn run_cts(
109111 if passthrough_args. is_none ( ) {
110112 log:: info!( "Reading default test list from {CTS_DEFAULT_TEST_LIST}" ) ;
111113 list_files. push ( OsString :: from ( CTS_DEFAULT_TEST_LIST ) ) ;
114+
115+ // Reduce output, unless `--verbose` was specified.
116+ quiet = !verbose;
112117 }
113118 } else if passthrough_args. is_some ( ) {
114119 bail ! ( "Test(s) and test list(s) are incompatible with passthrough arguments." ) ;
@@ -304,7 +309,10 @@ pub fn run_cts(
304309 }
305310 }
306311
307- log:: info!( "Running {}" , test. selector. to_string_lossy( ) ) ;
312+ if !quiet {
313+ log:: info!( "Running {}" , test. selector. to_string_lossy( ) ) ;
314+ }
315+
308316 let mut cmd = shell
309317 . cmd ( "cargo" )
310318 . args ( run_flags)
@@ -316,10 +324,31 @@ pub fn run_cts(
316324 cmd = cmd. arg ( "--release" )
317325 }
318326
319- cmd. args ( [ "--" , "./tools/run_deno" , "--verbose" ] )
320- . args ( [ & test. selector ] )
321- . run ( )
322- . context ( "CTS failed" ) ?;
327+ cmd = cmd
328+ . args ( [ "--" , "./tools/run_deno" , "--verbose" ] )
329+ . args ( [ & test. selector ] ) ;
330+
331+ if quiet {
332+ let output = cmd. ignore_status ( ) . output ( ) . context ( "Failed to run CTS" ) ?;
333+ let stdout = String :: from_utf8_lossy ( & output. stdout ) ;
334+ let stderr = String :: from_utf8_lossy ( & output. stderr ) ;
335+
336+ if output. status . success ( ) {
337+ if let Some ( ( _, summary) ) = stdout. split_once ( "** Summary **" ) {
338+ println ! ( "\n == Summary for {} ==" , test. selector. to_string_lossy( ) ) ;
339+ println ! ( "{}" , summary. trim( ) ) ;
340+ } else {
341+ print ! ( "{}" , stdout) ;
342+ eprint ! ( "{}" , stderr) ;
343+ }
344+ } else {
345+ print ! ( "{}" , stdout) ;
346+ eprint ! ( "{}" , stderr) ;
347+ bail ! ( "CTS failed" ) ;
348+ }
349+ } else {
350+ cmd. run ( ) . context ( "CTS failed" ) ?;
351+ }
323352 }
324353
325354 if tests. len ( ) > 1 {
0 commit comments