3 Test whether cargo-miri works properly.
4 Assumes the `MIRI_SYSROOT` env var to be set appropriately,
5 and the working directory to contain the cargo-miri-test project.
10 def test(name, cmd, stdout_ref, stderr_ref):
11 print("==> Testing `{}` <==".format(name))
12 ## Call `cargo miri`, capture all output
15 stdout=subprocess.PIPE,
16 stderr=subprocess.PIPE
18 (stdout, stderr) = p.communicate()
19 stdout = stdout.decode("UTF-8")
20 stderr = stderr.decode("UTF-8")
22 print("=> captured stdout <=")
24 print("=> captured stderr <=")
29 if stdout != open(stdout_ref).read():
30 print("stdout does not match reference")
32 if stderr != open(stderr_ref).read():
33 print("stderr does not match reference")
36 def test_cargo_miri_run():
37 test("cargo miri run", ["cargo", "miri", "run", "-q"], "stout.ref", "stderr.ref")
39 def test_cargo_miri_test():
40 # FIXME: validation disabled for now because of https://github.com/rust-lang/rust/issues/54957
41 test("cargo miri test", ["cargo", "miri", "test", "-q", "--", "-Zmiri-disable-validation"], "stout.ref", "stderr.ref")
44 test_cargo_miri_test()