7
7
//! to reimplement all the rendering logic in this module because of that.
8
8
9
9
use crate :: builder:: Builder ;
10
- use std:: io:: { BufRead , BufReader , Write } ;
10
+ use std:: io:: { BufRead , BufReader , Cursor , Write } ;
11
11
use std:: process:: { ChildStdout , Command , Stdio } ;
12
12
use std:: time:: Duration ;
13
13
use yansi_term:: Color ;
@@ -43,6 +43,7 @@ pub(crate) fn try_run_tests(builder: &Builder<'_>, cmd: &mut Command) -> bool {
43
43
44
44
fn run_tests ( builder : & Builder < ' _ > , cmd : & mut Command ) -> bool {
45
45
cmd. stdout ( Stdio :: piped ( ) ) ;
46
+ cmd. stderr ( Stdio :: piped ( ) ) ;
46
47
47
48
builder. verbose ( & format ! ( "running: {cmd:?}" ) ) ;
48
49
@@ -52,15 +53,20 @@ fn run_tests(builder: &Builder<'_>, cmd: &mut Command) -> bool {
52
53
// run this on another thread since the builder is not Sync.
53
54
Renderer :: new ( process. stdout . take ( ) . unwrap ( ) , builder) . render_all ( ) ;
54
55
55
- let result = process. wait ( ) . unwrap ( ) ;
56
- if !result. success ( ) && builder. is_verbose ( ) {
56
+ let result = process. wait_with_output ( ) . unwrap ( ) ;
57
+ if !result. status . success ( ) && builder. is_verbose ( ) {
57
58
println ! (
58
59
"\n \n command did not execute successfully: {cmd:?}\n \
59
- expected success, got: {result}"
60
+ expected success, got: {}",
61
+ result. status
60
62
) ;
61
63
}
62
64
63
- result. success ( )
65
+ // Show the stderr emitted by the test runner at the end. As of 2023-03-02 this is only the
66
+ // message at the end of a failed compiletest run.
67
+ std:: io:: copy ( & mut Cursor :: new ( & result. stderr ) , & mut std:: io:: stderr ( ) . lock ( ) ) . unwrap ( ) ;
68
+
69
+ result. status . success ( )
64
70
}
65
71
66
72
struct Renderer < ' a > {
0 commit comments