Skip to content

Commit 2857792

Browse files
author
hyd-dev
committed
Add a test for unit test of proc-macro crate
1 parent ecab8a4 commit 2857792

File tree

4 files changed

+8
-1
lines changed

4 files changed

+8
-1
lines changed

test-cargo-miri/run-test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def test_cargo_miri_test():
102102
)
103103
test("`cargo miri test` (subcrate, no isolation)",
104104
cargo_miri("test") + ["-p", "subcrate"],
105-
"test.subcrate.stdout.ref", "test.stderr-empty.ref",
105+
"test.subcrate.stdout.ref", "test.stderr-proc-macro.ref",
106106
env={'MIRIFLAGS': "-Zmiri-disable-isolation"},
107107
)
108108

test-cargo-miri/subcrate/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ version = "0.1.0"
44
authors = ["Miri Team"]
55
edition = "2018"
66

7+
[lib]
8+
proc-macro = true
9+
doctest = false
10+
711
[[bin]]
812
name = "subcrate"
913
path = "main.rs"

test-cargo-miri/subcrate/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#[cfg(test)]
2+
compile_error!("Miri should not touch me");
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Running unit tests of `proc-macro` crates is not currently supported by Miri.

0 commit comments

Comments
 (0)