Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rustdoc --persist-doctests does not work with --test-run-directory #112191

Closed
ehuss opened this issue Jun 1, 2023 · 0 comments · Fixed by #112751
Closed

rustdoc --persist-doctests does not work with --test-run-directory #112191

ehuss opened this issue Jun 1, 2023 · 0 comments · Fixed by #112751
Assignees
Labels
A-doctests Area: Documentation tests, run by rustdoc C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@ehuss
Copy link
Contributor

ehuss commented Jun 1, 2023

The combination of --persist-doctests doesn't seem to work with --test-run-directory.

Reproduction:

  1. mkdir foo

  2. cd foo

  3. mkdir subdir

  4. Create subdir/example.rs with the contents:

    /// ```
    /// example::foo();
    /// ```
    pub fn foo() {}
  5. rustc --crate-type=rlib subdir/example.rs

  6. Verify a basic test works: rustdoc --edition=2021 -L . --test subdir/example.rs

  7. Verify that persist-doctests works: rustdoc --edition=2021 -L . --test subdir/example.rs --persist-doctests persist -Zunstable-options

  8. Verify that test-run-directory works: rustdoc --edition=2021 -L . --test subdir/example.rs --test-run-directory=subdir

  9. 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

@ehuss ehuss added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. C-bug Category: This is a bug. A-doctests Area: Documentation tests, run by rustdoc labels Jun 1, 2023
@ehuss ehuss self-assigned this Jun 17, 2023
@bors bors closed this as completed in da54108 Aug 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-doctests Area: Documentation tests, run by rustdoc C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant