test all of the autocfg queries
This commit is contained in:
parent
d905901d65
commit
0b1d5a4957
@ -409,9 +409,9 @@ Moreover, Miri recognizes some environment variables:
|
||||
checkout. Note that changing files in that directory does not automatically
|
||||
trigger a re-build of the standard library; you have to clear the Miri build
|
||||
cache manually (on Linux, `rm -rf ~/.cache/miri`).
|
||||
* `MIRI_SYSROOT` (recognized by `cargo miri` and the Miri driver) indicates the
|
||||
sysroot to use. Only set this if you do not want to use the automatically
|
||||
created sysroot.
|
||||
* `MIRI_SYSROOT` (recognized by `cargo miri` and the Miri driver) indicates the sysroot to use. When
|
||||
using `cargo miri`, only set this if you do not want to use the automatically created sysroot. For
|
||||
directly invoking the Miri driver, this variable (or a `--sysroot` flag) is mandatory.
|
||||
* `MIRI_TEST_TARGET` (recognized by the test suite and the `./miri` script) indicates which target
|
||||
architecture to test against. `miri` and `cargo miri` accept the `--target` flag for the same
|
||||
purpose.
|
||||
|
@ -25,4 +25,16 @@ fn main() {
|
||||
let a = autocfg::new();
|
||||
assert!(a.probe_sysroot_crate("std"));
|
||||
assert!(!a.probe_sysroot_crate("doesnotexist"));
|
||||
assert!(a.probe_rustc_version(1, 0));
|
||||
assert!(!a.probe_rustc_version(2, 0));
|
||||
assert!(a.probe_type("i128"));
|
||||
assert!(!a.probe_type("doesnotexist"));
|
||||
assert!(a.probe_trait("Send"));
|
||||
assert!(!a.probe_trait("doesnotexist"));
|
||||
assert!(a.probe_path("std::num"));
|
||||
assert!(!a.probe_path("doesnotexist"));
|
||||
assert!(a.probe_constant("i32::MAX"));
|
||||
assert!(!a.probe_constant("doesnotexist"));
|
||||
assert!(a.probe_expression("Box::new(0)"));
|
||||
assert!(!a.probe_expression("doesnotexist"));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user