Skip to content

Commit

Permalink
Test cargo miri target selection
Browse files Browse the repository at this point in the history
  • Loading branch information
divergentdave committed Aug 29, 2020
1 parent c2a2e25 commit 5d9d75f
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test-cargo-miri/run-test.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ def test_cargo_miri_run():
cargo_miri("run"),
"stdout.ref", "stderr.ref"
)
test("cargo miri run (with target)",
cargo_miri("run") + ["--bin", "cargo-miri-test"],
"stdout.ref", "stderr.ref"
)
test("cargo miri run (with arguments)",
cargo_miri("run") + ["--", "--", "hello world", '"hello world"'],
"stdout.ref", "stderr.ref2"
Expand All @@ -68,6 +72,14 @@ def test_cargo_miri_test():
cargo_miri("test") + ["--", "-Zmiri-disable-isolation", "--", "num_cpus"],
"test.stdout.ref3", "test.stderr.ref"
)
test("cargo miri test (test target)",
cargo_miri("test") + ["--test", "test"],
"test.stdout.ref4", "test.stderr.ref"
)
test("cargo miri test (bin target)",
cargo_miri("test") + ["--bin", "cargo-miri-test"],
"test.stdout.ref5", "test.stderr.ref"
)

os.chdir(os.path.dirname(os.path.realpath(__file__)))

Expand Down
12 changes: 12 additions & 0 deletions test-cargo-miri/test.stdout.ref4
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

running 7 tests
test do_panic ... ok
test does_not_work_on_miri ... ignored
test entropy_rng ... ok
test fail_index_check ... ok
test num_cpus ... ok
test simple1 ... ok
test simple2 ... ok

test result: ok. 6 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out

6 changes: 6 additions & 0 deletions test-cargo-miri/test.stdout.ref5
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

running 1 test
test test::rng ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

0 comments on commit 5d9d75f

Please sign in to comment.