@@ -7,28 +7,6 @@ use hamcrest::{assert_that};
7
7
fn setup ( ) {
8
8
}
9
9
10
- test ! ( custom_build_compiled {
11
- let p = project( "foo" )
12
- . file( "Cargo.toml" , r#"
13
- [project]
14
-
15
- name = "foo"
16
- version = "0.5.0"
17
-
18
- build = "build.rs"
19
- "# )
20
- . file( "src/main.rs" , r#"
21
- fn main() {}
22
- "# )
23
- . file( "build.rs" , r#"
24
- invalid rust file, should trigger a build error
25
- "# ) ;
26
-
27
- assert_that( p. cargo_process( "build" ) ,
28
- execs( ) . with_status( 101 ) ) ;
29
- } )
30
-
31
- /*
32
10
test ! ( custom_build_script_failed {
33
11
let p = project( "foo" )
34
12
. file( "Cargo.toml" , r#"
@@ -47,14 +25,18 @@ test!(custom_build_script_failed {
47
25
std::os::set_exit_status(101);
48
26
}
49
27
"# ) ;
50
- assert_that(p.cargo_process("build"),
28
+ assert_that( p. cargo_process( "build" ) . arg ( "-v" ) ,
51
29
execs( ) . with_status( 101 )
30
+ . with_stdout( format!( "\
31
+ {compiling} foo v0.5.0 ({url})
32
+ {running} `rustc build.rs --crate-name build-script-build --crate-type bin [..]`
33
+ " ,
34
+ url = p. url( ) , compiling = COMPILING , running = RUNNING ) )
52
35
. with_stderr( format!( "\
53
- Failed to run custom build command for `foo v0.5.0 (file:// {})`
54
- Process didn't exit successfully: `{} ` (status=101)", // TODO: TEST FAILS BECAUSE OF WRONG PATH
55
- p.root().display(), p.bin("build-script-build").display ())));
36
+ Failed to run custom build command for `foo v0.5.0 ({})`
37
+ Process didn't exit successfully: `[..]build[..]build-script-build ` (status=101)" ,
38
+ p. url ( ) ) ) ) ;
56
39
} )
57
- */
58
40
59
41
test ! ( custom_build_env_vars {
60
42
let p = project( "foo" )
@@ -149,10 +131,10 @@ test!(custom_build_script_wrong_rustc_flags {
149
131
assert_that( p. cargo_process( "build" ) ,
150
132
execs( ) . with_status( 101 )
151
133
. with_stderr( format!( "\
152
- Only `-l` and `-L` flags are allowed in build script of `foo v0.5.0 (file:// {})`:
134
+ Only `-l` and `-L` flags are allowed in build script of `foo v0.5.0 ({})`:
153
135
`-aaa -bbb
154
136
`" ,
155
- p. root ( ) . display ( ) ) ) ) ;
137
+ p. url ( ) ) ) ) ;
156
138
} )
157
139
158
140
/*
0 commit comments