File tree 4 files changed +44
-12
lines changed
tests/run-make/crate-data-smoke
4 files changed +44
-12
lines changed Original file line number Diff line number Diff line change @@ -205,7 +205,7 @@ impl Rustc {
205
205
206
206
/// Get the [`Output`][::std::process::Output] of the finished process.
207
207
#[ track_caller]
208
- pub fn command_output ( & mut self ) -> :: std :: process :: Output {
208
+ pub fn command_output ( & mut self ) -> Output {
209
209
// let's make sure we piped all the input and outputs
210
210
self . cmd . stdin ( Stdio :: piped ( ) ) ;
211
211
self . cmd . stdout ( Stdio :: piped ( ) ) ;
Original file line number Diff line number Diff line change @@ -24,7 +24,6 @@ run-make/compiler-rt-works-on-mingw/Makefile
24
24
run-make/compressed-debuginfo/Makefile
25
25
run-make/const-prop-lint/Makefile
26
26
run-make/const_fn_mir/Makefile
27
- run-make/crate-data-smoke/Makefile
28
27
run-make/crate-hash-rustc-version/Makefile
29
28
run-make/crate-name-priority/Makefile
30
29
run-make/cross-lang-lto-clang/Makefile
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ use std:: process:: Output ;
2
+
3
+ use run_make_support:: { bin_name, rust_lib, rustc} ;
4
+
5
+ fn compare_stdout < S : AsRef < str > > ( output : Output , expected : S ) {
6
+ assert_eq ! (
7
+ String :: from_utf8( output. stdout) . unwrap( ) . trim( ) ,
8
+ expected. as_ref( )
9
+ ) ;
10
+ }
11
+
12
+ fn main ( ) {
13
+ compare_stdout ( rustc ( ) . print ( "crate-name" ) . input ( "crate.rs" ) . run ( ) , "foo" ) ;
14
+ compare_stdout (
15
+ rustc ( ) . print ( "file-names" ) . input ( "crate.rs" ) . run ( ) ,
16
+ bin_name ( "foo" ) ,
17
+ ) ;
18
+ compare_stdout (
19
+ rustc ( )
20
+ . print ( "file-names" )
21
+ . crate_type ( "lib" )
22
+ . arg ( "--test" )
23
+ . input ( "crate.rs" )
24
+ . run ( ) ,
25
+ bin_name ( "foo" ) ,
26
+ ) ;
27
+ compare_stdout (
28
+ rustc ( )
29
+ . print ( "file-names" )
30
+ . arg ( "--test" )
31
+ . input ( "lib.rs" )
32
+ . run ( ) ,
33
+ bin_name ( "mylib" ) ,
34
+ ) ;
35
+ compare_stdout (
36
+ rustc ( ) . print ( "file-names" ) . input ( "lib.rs" ) . run ( ) ,
37
+ rust_lib ( "mylib" ) . file_name ( ) . unwrap ( ) . to_string_lossy ( ) ,
38
+ ) ;
39
+ compare_stdout (
40
+ rustc ( ) . print ( "file-names" ) . input ( "rlib.rs" ) . run ( ) ,
41
+ rust_lib ( "mylib" ) . file_name ( ) . unwrap ( ) . to_string_lossy ( ) ,
42
+ ) ;
43
+ }
You can’t perform that action at this time.
0 commit comments