@@ -3325,26 +3325,31 @@ fn build_script_outside_pkg_root() {
3325
3325
let mut expect_msg = String :: from ( "\
3326
3326
warning: manifest has no documentation, homepage or repository.
3327
3327
See https://doc.rust-lang.org/cargo/reference/manifest.html#package-metadata for more info.
3328
- error: the source file of \" custom-build \" target `build- script-custom_build ` doesn't appear to exist.
3328
+ error: the source file of `build script` doesn't appear to exist.
3329
3329
This may cause issue during packaging, as modules resolution and resources included via macros are often relative to the path of source files.
3330
3330
Please update the `build` setting in the manifest at `[CWD]/Cargo.toml` and point to a path inside the root of the package.
3331
3331
" ) ;
3332
3332
// custom_build.rs does not exist
3333
- p. cargo ( "package -l" ) . with_stderr ( & expect_msg) . run ( ) ;
3333
+ p. cargo ( "package -l" )
3334
+ . with_status ( 101 )
3335
+ . with_stderr ( & expect_msg)
3336
+ . run ( ) ;
3334
3337
3335
3338
// custom_build.rs outside the package root
3336
- let custom_build_root = p . root ( ) . parent ( ) . unwrap ( ) . join ( "t_custom_build" ) ;
3339
+ let custom_build_root = paths :: root ( ) . join ( "t_custom_build" ) ;
3337
3340
_ = fs:: create_dir ( & custom_build_root) . unwrap ( ) ;
3338
3341
_ = fs:: write ( & custom_build_root. join ( "custom_build.rs" ) , "fn main() {}" ) ;
3339
3342
expect_msg = format ! (
3340
3343
"\
3341
3344
warning: manifest has no documentation, homepage or repository.
3342
3345
See https://doc.rust-lang.org/cargo/reference/manifest.html#package-metadata for more info.
3343
- error: the source file of \" custom-build \" target `build- script-custom_build ` doesn't appear to be a path inside of the package.
3346
+ error: the source file of `build script` doesn't appear to be a path inside of the package.
3344
3347
It is at `{}/t_custom_build/custom_build.rs`, whereas the root the package is `[CWD]`.
3345
3348
This may cause issue during packaging, as modules resolution and resources included via macros are often relative to the path of source files.
3346
3349
Please update the `build` setting in the manifest at `[CWD]/Cargo.toml` and point to a path inside the root of the package.
3347
- " , p. root( ) . parent( ) . unwrap( ) . display( ) ) ;
3348
- p. cargo ( "package -l" ) . with_stderr ( & expect_msg) . run ( ) ;
3349
- _ = fs:: remove_dir_all ( & custom_build_root) . unwrap ( ) ;
3350
+ " , paths:: root( ) . display( ) ) ;
3351
+ p. cargo ( "package -l" )
3352
+ . with_status ( 101 )
3353
+ . with_stderr ( & expect_msg)
3354
+ . run ( ) ;
3350
3355
}
0 commit comments