@@ -72,14 +72,14 @@ For example:
72
72
73
73
You can (cross-)run the entire test suite using:
74
74
75
- ```
75
+ ``` sh
76
76
./miri test
77
- MIRI_TEST_TARGET= i686-unknown-linux-gnu ./miri test
77
+ ./miri test --target i686-unknown-linux-gnu
78
78
```
79
79
80
80
` ./miri test FILTER ` only runs those tests that contain ` FILTER ` in their filename (including the
81
- base directory, e.g. ` ./miri test fail ` will run all compile-fail tests). These filters are passed
82
- to ` cargo test` , so for multiple filters you need to use ` ./miri test -- FILTER1 FILTER2 ` .
81
+ base directory, e.g. ` ./miri test fail ` will run all compile-fail tests). Multiple filters are
82
+ supported: ` ./miri test FILTER1 FILTER2 ` runs all tests that contain either string .
83
83
84
84
#### Fine grained logging
85
85
@@ -139,9 +139,8 @@ and then you can use it as if it was installed by `rustup` as a component of the
139
139
in the ` miri ` toolchain's sysroot to prevent conflicts with other toolchains.
140
140
The Miri binaries in the ` cargo ` bin directory (usually ` ~/.cargo/bin ` ) are managed by rustup.
141
141
142
- There's a test for the cargo wrapper in the ` test-cargo-miri ` directory; run
143
- ` ./run-test.py ` in there to execute it. Like ` ./miri test ` , this respects the
144
- ` MIRI_TEST_TARGET ` environment variable to execute the test for another target.
142
+ There's a test for the cargo wrapper in the ` test-cargo-miri ` directory; run ` ./run-test.py ` in
143
+ there to execute it. You can pass ` --target ` to execute the test for another target.
145
144
146
145
### Using a modified standard library
147
146
@@ -287,3 +286,41 @@ https. Add the following to your `.gitconfig`:
287
286
[url "git@github .com:" ]
288
287
pushInsteadOf = https://github.com/
289
288
```
289
+
290
+ ## Internal environment variables
291
+
292
+ The following environment variables are * internal* and must not be used by
293
+ anyone but Miri itself. They are used to communicate between different Miri
294
+ binaries, and as such worth documenting:
295
+
296
+ * ` CARGO_EXTRA_FLAGS ` is understood by ` ./miri ` and passed to all host cargo invocations.
297
+ * ` MIRI_BE_RUSTC ` can be set to ` host ` or ` target ` . It tells the Miri driver to
298
+ actually not interpret the code but compile it like rustc would. With ` target ` , Miri sets
299
+ some compiler flags to prepare the code for interpretation; with ` host ` , this is not done.
300
+ This environment variable is useful to be sure that the compiled ` rlib ` s are compatible
301
+ with Miri.
302
+ * ` MIRI_CALLED_FROM_SETUP ` is set during the Miri sysroot build,
303
+ which will re-invoke ` cargo-miri ` as the ` rustc ` to use for this build.
304
+ * ` MIRI_CALLED_FROM_RUSTDOC ` when set to any value tells ` cargo-miri ` that it is
305
+ running as a child process of ` rustdoc ` , which invokes it twice for each doc-test
306
+ and requires special treatment, most notably a check-only build before interpretation.
307
+ This is set by ` cargo-miri ` itself when running as a ` rustdoc ` -wrapper.
308
+ * ` MIRI_CWD ` when set to any value tells the Miri driver to change to the given
309
+ directory after loading all the source files, but before commencing
310
+ interpretation. This is useful if the interpreted program wants a different
311
+ working directory at run-time than at build-time.
312
+ * ` MIRI_LOCAL_CRATES ` is set by ` cargo-miri ` to tell the Miri driver which
313
+ crates should be given special treatment in diagnostics, in addition to the
314
+ crate currently being compiled.
315
+ * ` MIRI_ORIG_RUSTDOC ` is set and read by different phases of ` cargo-miri ` to remember the
316
+ value of ` RUSTDOC ` from before it was overwritten.
317
+ * ` MIRI_REPLACE_LIBRS_IF_NOT_TEST ` when set to any value enables a hack that helps bootstrap
318
+ run the standard library tests in Miri.
319
+ * ` MIRI_TEST_TARGET ` is set by ` ./miri test ` (and ` ./x.py test miri ` ) to tell the test harness about
320
+ the chosen target.
321
+ * ` MIRI_VERBOSE ` when set to any value tells the various ` cargo-miri ` phases to
322
+ perform verbose logging.
323
+ * ` MIRI_HOST_SYSROOT ` is set by bootstrap to tell ` cargo-miri ` which sysroot to use for * host*
324
+ operations.
325
+ * ` RUSTC_BLESS ` is set by ` ./miri test ` (and ` ./x.py test miri ` ) to indicate bless-mode to the test
326
+ harness.
0 commit comments