Skip to content

Commit

Permalink
Add a test for unit test of proc-macro crate
Browse files Browse the repository at this point in the history
  • Loading branch information
hyd-dev committed Jan 24, 2021
1 parent ecab8a4 commit 2857792
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion test-cargo-miri/run-test.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def test_cargo_miri_test():
)
test("`cargo miri test` (subcrate, no isolation)",
cargo_miri("test") + ["-p", "subcrate"],
"test.subcrate.stdout.ref", "test.stderr-empty.ref",
"test.subcrate.stdout.ref", "test.stderr-proc-macro.ref",
env={'MIRIFLAGS': "-Zmiri-disable-isolation"},
)

Expand Down
4 changes: 4 additions & 0 deletions test-cargo-miri/subcrate/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ version = "0.1.0"
authors = ["Miri Team"]
edition = "2018"

[lib]
proc-macro = true
doctest = false

[[bin]]
name = "subcrate"
path = "main.rs"
Expand Down
2 changes: 2 additions & 0 deletions test-cargo-miri/subcrate/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#[cfg(test)]
compile_error!("Miri should not touch me");
1 change: 1 addition & 0 deletions test-cargo-miri/test.stderr-proc-macro.ref
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Running unit tests of `proc-macro` crates is not currently supported by Miri.

0 comments on commit 2857792

Please sign in to comment.