nits; test running no doctests

This commit is contained in:
Ralf Jung 2021-04-05 12:46:36 +02:00
parent e66a89c8af
commit f9bd6b0756
2 changed files with 8 additions and 7 deletions

View File

@ -683,6 +683,7 @@ fn out_filename(prefix: &str, suffix: &str) -> PathBuf {
let mut cmd = miri();
// Ensure --emit argument for a check-only build is present.
// We cannot use the usual helpers since we need to check specifically in `env.args`.
if let Some(i) = env.args.iter().position(|arg| arg.starts_with("--emit=")) {
// For `no_run` tests, rustdoc passes a `--emit` flag; make sure it has the right shape.
assert_eq!(env.args[i], "--emit=metadata");
@ -877,7 +878,7 @@ fn phase_cargo_rustdoc(fst_arg: &str, mut args: env::Args) {
// phase_cargo_miri sets the RUSTDOC env var to ourselves, so we can't use that here;
// just default to a straight-forward invocation for now:
let mut cmd = Command::new(OsString::from("rustdoc"));
let mut cmd = Command::new("rustdoc");
// Because of the way the main function is structured, we have to take the first argument spearately
// from the rest; to simplify the following argument patching loop, we'll just skip that one.
@ -888,6 +889,7 @@ fn phase_cargo_rustdoc(fst_arg: &str, mut args: env::Args) {
cmd.arg(fst_arg);
let runtool_flag = "--runtool";
// `crossmode` records if *any* argument matches `runtool_flag`; here we check the first one.
let mut crossmode = fst_arg == runtool_flag;
while let Some(arg) = args.next() {
if arg == extern_flag {
@ -950,9 +952,8 @@ fn main() {
return;
}
// The way rustdoc invokes rustc is indistuingishable from the way cargo invokes rustdoc
// by the arguments alone, and we can't take from the args iterator in this case.
// phase_cargo_rustdoc sets this environment variable to let us disambiguate here
// The way rustdoc invokes rustc is indistuingishable from the way cargo invokes rustdoc by the
// arguments alone. `phase_cargo_rustdoc` sets this environment variable to let us disambiguate.
let invoked_by_rustdoc = env::var_os("MIRI_CALLED_FROM_RUSTDOC").is_some();
if invoked_by_rustdoc {
// ...however, we then also see this variable when rustdoc invokes us as the testrunner!

View File

@ -113,9 +113,9 @@ def test_cargo_miri_test():
default_ref, "test.stderr-empty.ref",
env={'MIRIFLAGS': "-Zmiri-seed=feed"},
)
test("`cargo miri test` (no isolation)",
cargo_miri("test"),
default_ref, "test.stderr-empty.ref",
test("`cargo miri test` (no isolation, no doctests)",
cargo_miri("test") + ["--bins", "--tests"], # no `--lib`, we disabled that in `Cargo.toml`
"test.cross-target.stdout.ref", "test.stderr-empty.ref",
env={'MIRIFLAGS': "-Zmiri-disable-isolation"},
)
test("`cargo miri test` (raw-ptr tracking)",