Skip to content

Commit

Permalink
Auto merge of #1531 - divergentdave:cargo-miri-targets-test, r=RalfJung
Browse files Browse the repository at this point in the history
Test cargo miri target selection

This is a followup to #1525, adding a few test invocations with targets specified in the cargo arguments.
  • Loading branch information
bors committed Aug 29, 2020
2 parents c2a2e25 + 5d9d75f commit 9123f0e
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 9123f0e

Please sign in to comment.