@@ -1247,21 +1247,26 @@ mod tests {
12471247 } else {
12481248 vec ! [ ]
12491249 } ;
1250- let status = std:: process:: Command :: new ( "cargo" )
1250+ let output = std:: process:: Command :: new ( "cargo" )
12511251 . args ( [ "test" , "-p" , "hyperlight-host" ] )
12521252 . args ( target_args)
12531253 . args ( [ "--" , "--ignored" , test] )
12541254 . stdin ( std:: process:: Stdio :: null ( ) )
1255- . stdout ( std:: process:: Stdio :: null ( ) )
1256- . stderr ( std:: process:: Stdio :: null ( ) )
1257- . status ( )
1255+ . output ( )
12581256 . expect ( "Unable to launch tests" ) ;
1259- assert_eq ! (
1260- status. code( ) ,
1261- Some ( TEST_EXIT_CODE . into( ) ) ,
1262- "Guard Page test failed: {}" ,
1263- test
1264- ) ;
1257+ let exit_code = output. status . code ( ) ;
1258+ if exit_code != Some ( TEST_EXIT_CODE . into ( ) ) {
1259+ eprintln ! ( "=== Guard Page test '{}' failed ===" , test) ;
1260+ eprintln ! ( "Exit code: {:?} (expected {})" , exit_code, TEST_EXIT_CODE ) ;
1261+ eprintln ! ( "=== STDOUT ===" ) ;
1262+ eprintln ! ( "{}" , String :: from_utf8_lossy( & output. stdout) ) ;
1263+ eprintln ! ( "=== STDERR ===" ) ;
1264+ eprintln ! ( "{}" , String :: from_utf8_lossy( & output. stderr) ) ;
1265+ panic ! (
1266+ "Guard Page test failed: {} (exit code {:?}, expected {})" ,
1267+ test, exit_code, TEST_EXIT_CODE
1268+ ) ;
1269+ }
12651270 }
12661271 }
12671272 }
0 commit comments