From 5d9d75fc1f2fc87f419913db7bf8a073b04f955d Mon Sep 17 00:00:00 2001 From: David Cook Date: Fri, 28 Aug 2020 23:12:11 -0500 Subject: [PATCH] Test cargo miri target selection --- test-cargo-miri/run-test.py | 12 ++++++++++++ test-cargo-miri/test.stdout.ref4 | 12 ++++++++++++ test-cargo-miri/test.stdout.ref5 | 6 ++++++ 3 files changed, 30 insertions(+) create mode 100644 test-cargo-miri/test.stdout.ref4 create mode 100644 test-cargo-miri/test.stdout.ref5 diff --git a/test-cargo-miri/run-test.py b/test-cargo-miri/run-test.py index 57b23a6a2afe..a258c7f73c2d 100755 --- a/test-cargo-miri/run-test.py +++ b/test-cargo-miri/run-test.py @@ -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" @@ -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__))) diff --git a/test-cargo-miri/test.stdout.ref4 b/test-cargo-miri/test.stdout.ref4 new file mode 100644 index 000000000000..b6403bf6c091 --- /dev/null +++ b/test-cargo-miri/test.stdout.ref4 @@ -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 + diff --git a/test-cargo-miri/test.stdout.ref5 b/test-cargo-miri/test.stdout.ref5 new file mode 100644 index 000000000000..4caa30a7f0e5 --- /dev/null +++ b/test-cargo-miri/test.stdout.ref5 @@ -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 +