Skip to content

Commit 33e6b33

Browse files
committed
test(build-std): shows that proc macro unittest fails
This starts failing since rust-lang/rust#131188
1 parent 88edf01 commit 33e6b33

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

tests/build-std/main.rs

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,3 +360,41 @@ fn remap_path_scope() {
360360
)
361361
.run();
362362
}
363+
364+
#[cargo_test(build_std_real)]
365+
fn test_proc_macro() {
366+
// See rust-lang/cargo#14735
367+
let p = project()
368+
.file(
369+
"Cargo.toml",
370+
r#"
371+
[package]
372+
name = "foo"
373+
edition = "2021"
374+
375+
[lib]
376+
proc-macro = true
377+
"#,
378+
)
379+
.file("src/lib.rs", "")
380+
.build();
381+
382+
p.cargo("test --lib")
383+
.env_remove(cargo_util::paths::dylib_path_envvar())
384+
.build_std()
385+
.with_stderr_data(str![[r#"
386+
[COMPILING] foo v0.0.0 ([ROOT]/foo)
387+
[FINISHED] `test` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
388+
[RUNNING] unittests src/lib.rs (target/debug/deps/foo-[HASH])
389+
dyld[[..]]: Library not loaded: @rpath/libstd-[HASH].dylib
390+
Referenced from: <[..]> [ROOT]/foo/target/debug/deps/foo-[HASH]
391+
Reason: tried: '[ROOT]/foo/target/debug/deps/libstd-[HASH].dylib' (no such file), '[ROOT]/foo/target/debug/libstd-[HASH].dylib' (no such file), '/usr/local/lib/libstd-[HASH].dylib' (no such file), '/usr/lib/libstd-[HASH].dylib' (no such file, not in dyld cache)
392+
[ERROR] test failed, to rerun pass `--lib`
393+
394+
Caused by:
395+
process didn't exit successfully: `[ROOT]/foo/target/debug/deps/foo-[HASH]` ([..])
396+
397+
"#]])
398+
.with_status(101)
399+
.run();
400+
}

0 commit comments

Comments
 (0)