File tree 2 files changed +11
-4
lines changed
2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -52,18 +52,19 @@ all the same flags as `rustc` (though the ones only affecting code generation
52
52
and linking obviously will have no effect) [ and more] [ miri-flags ] .
53
53
54
54
Running the Miri driver requires some fiddling with environment variables, so
55
- the ` miri ` script helps you do that. For example, you can run the driver on a
56
- particular file by doing
55
+ the ` miri ` script helps you do that. For example, you can (cross-) run the
56
+ driver on a particular file by doing
57
57
58
58
``` sh
59
59
./miri run tests/run-pass/format.rs
60
60
./miri run tests/run-pass/hello.rs --target i686-unknown-linux-gnu
61
61
```
62
62
63
- and you can run the test suite using:
63
+ and you can (cross-) run the test suite using:
64
64
65
65
```
66
66
./miri test
67
+ MIRI_TEST_TARGET=i686-unknown-linux-gnu ./miri test
67
68
```
68
69
69
70
` ./miri test FILTER ` only runs those tests that contain ` FILTER ` in their
@@ -104,7 +105,8 @@ and then you can use it as if it was installed by `rustup`. Make sure you use
104
105
the same toolchain when calling ` cargo miri ` that you used when installing Miri!
105
106
106
107
There's a test for the cargo wrapper in the ` test-cargo-miri ` directory; run
107
- ` ./run-test.py ` in there to execute it.
108
+ ` ./run-test.py ` in there to execute it. Like ` ./miri test ` , this respects the
109
+ ` MIRI_TEST_TARGET ` environment variable to execute the test for another target.
108
110
109
111
## Building Miri with a locally built rustc
110
112
Original file line number Diff line number Diff line change @@ -76,6 +76,11 @@ Now you can run your project in Miri:
76
76
The first time you run Miri, it will perform some extra setup and install some
77
77
dependencies. It will ask you for confirmation before installing anything.
78
78
79
+ Miri supports cross-execution: if you want to run the program as if it was a
80
+ Linux program, you can do ` cargo miri run --target x86_64-unknown-linux-gnu ` .
81
+ This is particularly useful if you are using Windows, as the Linux target is
82
+ much better supported than Windows targets.
83
+
79
84
You can pass arguments to Miri after the first ` -- ` , and pass arguments to the
80
85
interpreted program or test suite after the second ` -- ` . For example, `cargo
81
86
miri run -- -Zmiri-disable-validation` runs the program without validation of
You can’t perform that action at this time.
0 commit comments