-
Notifications
You must be signed in to change notification settings - Fork 14k
Description
The combination of --persist-doctests doesn't seem to work with --test-run-directory.
Reproduction:
-
mkdir foo -
cd foo -
mkdir subdir -
Create
subdir/example.rswith the contents:/// ``` /// example::foo(); /// ``` pub fn foo() {}
-
rustc --crate-type=rlib subdir/example.rs -
Verify a basic test works:
rustdoc --edition=2021 -L . --test subdir/example.rs -
Verify that persist-doctests works:
rustdoc --edition=2021 -L . --test subdir/example.rs --persist-doctests persist -Zunstable-options -
Verify that test-run-directory works:
rustdoc --edition=2021 -L . --test subdir/example.rs --test-run-directory=subdir -
Check behavior when both are specified:
rustdoc --edition=2021 -L . --test subdir/example.rs --test-run-directory=subdir --persist-doctests persist -Zunstable-options
Expected behavior: Tests should run successfully.
Actual behavior: Test fails with this error:
running 1 test
test subdir/example.rs - foo (line 1) ... FAILED
failures:
---- subdir/example.rs - foo (line 1) stdout ----
Couldn't run the test: No such file or directory (os error 2)
failures:
subdir/example.rs - foo (line 1)
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.06s
Meta
rustc --version --verbose:
rustc 1.71.0-nightly (9d871b061 2023-05-21)
binary: rustc
commit-hash: 9d871b0617a4b3d6610b7cee0ab5310dcb542c62
commit-date: 2023-05-21
host: aarch64-apple-darwin
release: 1.71.0-nightly
LLVM version: 16.0.4
cc #56925