@@ -29,17 +29,11 @@ fn simple() {
2929 let rustc_output = raw_rustc_output ( & p, "src/lib.rs" , & [ ] ) ;
3030
3131 // -q so the output is the same as rustc (no "Compiling" or "Finished").
32- let cargo_output1 = p
33- . cargo ( "check -q --color=never" )
34- . exec_with_output ( )
35- . expect ( "cargo to run" ) ;
32+ let cargo_output1 = p. cargo ( "check -q --color=never" ) . run ( ) ;
3633 assert_eq ! ( rustc_output, as_str( & cargo_output1. stderr) ) ;
3734 assert ! ( cargo_output1. stdout. is_empty( ) ) ;
3835 // Check that the cached version is exactly the same.
39- let cargo_output2 = p
40- . cargo ( "check -q" )
41- . exec_with_output ( )
42- . expect ( "cargo to run" ) ;
36+ let cargo_output2 = p. cargo ( "check -q" ) . run ( ) ;
4337 assert_eq ! ( rustc_output, as_str( & cargo_output2. stderr) ) ;
4438 assert ! ( cargo_output2. stdout. is_empty( ) ) ;
4539}
@@ -61,14 +55,10 @@ fn simple_short() {
6155
6256 let cargo_output1 = p
6357 . cargo ( "check -q --color=never --message-format=short" )
64- . exec_with_output ( )
65- . expect ( "cargo to run" ) ;
58+ . run ( ) ;
6659 assert_eq ! ( rustc_output, as_str( & cargo_output1. stderr) ) ;
6760 // assert!(cargo_output1.stdout.is_empty());
68- let cargo_output2 = p
69- . cargo ( "check -q --message-format=short" )
70- . exec_with_output ( )
71- . expect ( "cargo to run" ) ;
61+ let cargo_output2 = p. cargo ( "check -q --message-format=short" ) . run ( ) ;
7262 println ! ( "{}" , String :: from_utf8_lossy( & cargo_output2. stdout) ) ;
7363 assert_eq ! ( rustc_output, as_str( & cargo_output2. stderr) ) ;
7464 assert ! ( cargo_output2. stdout. is_empty( ) ) ;
@@ -102,24 +92,15 @@ fn color() {
10292 assert ! ( !rustc_nocolor. contains( "\x1b [" ) ) ;
10393
10494 // First pass, non-cached, with color, should be the same.
105- let cargo_output1 = p
106- . cargo ( "check -q --color=always" )
107- . exec_with_output ( )
108- . expect ( "cargo to run" ) ;
95+ let cargo_output1 = p. cargo ( "check -q --color=always" ) . run ( ) ;
10996 compare ( & rustc_color, as_str ( & cargo_output1. stderr ) ) ;
11097
11198 // Replay cached, with color.
112- let cargo_output2 = p
113- . cargo ( "check -q --color=always" )
114- . exec_with_output ( )
115- . expect ( "cargo to run" ) ;
99+ let cargo_output2 = p. cargo ( "check -q --color=always" ) . run ( ) ;
116100 compare ( & rustc_color, as_str ( & cargo_output2. stderr ) ) ;
117101
118102 // Replay cached, no color.
119- let cargo_output_nocolor = p
120- . cargo ( "check -q --color=never" )
121- . exec_with_output ( )
122- . expect ( "cargo to run" ) ;
103+ let cargo_output_nocolor = p. cargo ( "check -q --color=never" ) . run ( ) ;
123104 compare ( & rustc_nocolor, as_str ( & cargo_output_nocolor. stderr ) ) ;
124105}
125106
@@ -130,27 +111,17 @@ fn cached_as_json() {
130111
131112 // Grab the non-cached output, feature disabled.
132113 // NOTE: When stabilizing, this will need to be redone.
133- let cargo_output = p
134- . cargo ( "check --message-format=json" )
135- . exec_with_output ( )
136- . expect ( "cargo to run" ) ;
137- assert ! ( cargo_output. status. success( ) ) ;
114+ let cargo_output = p. cargo ( "check --message-format=json" ) . run ( ) ;
138115 let orig_cargo_out = as_str ( & cargo_output. stdout ) ;
139116 assert ! ( orig_cargo_out. contains( "compiler-message" ) ) ;
140117 p. cargo ( "clean" ) . run ( ) ;
141118
142119 // Check JSON output, not fresh.
143- let cargo_output1 = p
144- . cargo ( "check --message-format=json" )
145- . exec_with_output ( )
146- . expect ( "cargo to run" ) ;
120+ let cargo_output1 = p. cargo ( "check --message-format=json" ) . run ( ) ;
147121 assert_eq ! ( as_str( & cargo_output1. stdout) , orig_cargo_out) ;
148122
149123 // Check JSON output, fresh.
150- let cargo_output2 = p
151- . cargo ( "check --message-format=json" )
152- . exec_with_output ( )
153- . expect ( "cargo to run" ) ;
124+ let cargo_output2 = p. cargo ( "check --message-format=json" ) . run ( ) ;
154125 // The only difference should be this field.
155126 let fix_fresh = as_str ( & cargo_output2. stdout ) . replace ( "\" fresh\" :true" , "\" fresh\" :false" ) ;
156127 assert_eq ! ( fix_fresh, orig_cargo_out) ;
@@ -220,11 +191,7 @@ fn rustdoc() {
220191 )
221192 . build ( ) ;
222193
223- let rustdoc_output = p
224- . cargo ( "doc -q --color=always" )
225- . exec_with_output ( )
226- . expect ( "rustdoc to run" ) ;
227- assert ! ( rustdoc_output. status. success( ) ) ;
194+ let rustdoc_output = p. cargo ( "doc -q --color=always" ) . run ( ) ;
228195 let rustdoc_stderr = as_str ( & rustdoc_output. stderr ) ;
229196 assert ! ( rustdoc_stderr. contains( "missing" ) ) ;
230197 assert ! ( rustdoc_stderr. contains( "\x1b [" ) ) ;
@@ -234,10 +201,7 @@ fn rustdoc() {
234201 ) ;
235202
236203 // Check the cached output.
237- let rustdoc_output = p
238- . cargo ( "doc -q --color=always" )
239- . exec_with_output ( )
240- . expect ( "rustdoc to run" ) ;
204+ let rustdoc_output = p. cargo ( "doc -q --color=always" ) . run ( ) ;
241205 assert_eq ! ( as_str( & rustdoc_output. stderr) , rustdoc_stderr) ;
242206}
243207
0 commit comments