Repository navigation
[rustdoc] Move the creation of IndividualTestOptions into the test runner closure to ensure the temporary folder is removed right after the test is done running - #164202
Conversation
|
|
| @@ -0,0 +1,15 @@ | |||
|
|
|||
| running 1 test | |||
There was a problem hiding this comment.
This change is because we used to try to make the temporary directly ahead of the DynTestFn closure when using --persist-doctest, so before the doctest was even running. But it actually doesn't make much sense to have a different behaviour so it's now moved inside the DynTestFn closure and has the same output as when --persist-doctest isn't used.
| doctest_run_fn( | ||
| &rustdoc_test_options, |
There was a problem hiding this comment.
I think this means you can change doctest_run_fn mak to taking rustdoc_test_options by-value as it was before my PR.
There was a problem hiding this comment.
Ah indeed, missed that.
| /// entry.as_ref().unwrap().file_name().to_str().unwrap().starts_with("rustdoctest") | ||
| /// }) | ||
| /// .count(); | ||
| /// assert_eq!(count, 2); |
There was a problem hiding this comment.
Why is 2 the right number here? Shouldn't it be 1 if the previous test got cleaned up?
There was a problem hiding this comment.
We create a first temp dir where we write the rustdoc-cfgs file which contains the list of all args to be passed to the doctests. But I'll write a code comment to explain it.
427c050 to
917a1cb
Compare
…sure to ensure the temporary folder is removed right after the test is done running
917a1cb to
2cb8b0b
Compare
|
Added the code comment and cleaned up rustdoc code a bit more. |
|
LGTM, thanks a lot. :) |
…moval, r=RalfJung,Urgau [rustdoc] Move the creation of `IndividualTestOptions` into the test runner closure to ensure the temporary folder is removed right after the test is done running Fixes rust-lang#164145. Fixes one missed case in rust-lang#161868: the `IndividualTestOptions` should have been created directly into the `DynTestFn` closure so its temporary directory is removed right after it's done running. r? @RalfJung
…moval, r=RalfJung,Urgau [rustdoc] Move the creation of `IndividualTestOptions` into the test runner closure to ensure the temporary folder is removed right after the test is done running Fixes rust-lang#164145. Fixes one missed case in rust-lang#161868: the `IndividualTestOptions` should have been created directly into the `DynTestFn` closure so its temporary directory is removed right after it's done running. r? @RalfJung
…uwer Rollup of 8 pull requests Successful merges: - #164196 (`rust-analyzer` subtree update) - #164037 (Restrict application of optimization attributes from instance) - #164201 (Improve `--bless` output for `tests/debuginfo`) - #164202 ([rustdoc] Move the creation of `IndividualTestOptions` into the test runner closure to ensure the temporary folder is removed right after the test is done running) - #162140 (fn_addr_eq: we actually can guarantee basically nothing) - #163946 (Fix transmutability type mismatch bug) - #163978 (Copy over some methods from At to InferCtxt) - #164045 (-Zassumptions-on-binders: replace region vars with bound vars when handling alias outlives')
Rollup merge of #164202 - GuillaumeGomez:fix-doctest-temp-removal, r=RalfJung,Urgau [rustdoc] Move the creation of `IndividualTestOptions` into the test runner closure to ensure the temporary folder is removed right after the test is done running Fixes #164145. Fixes one missed case in #161868: the `IndividualTestOptions` should have been created directly into the `DynTestFn` closure so its temporary directory is removed right after it's done running. r? @RalfJung
|
removing t-compiler since this seems to be entirely T-rustdoc (probably good to backport, imo) |
Fixes #164145.
Fixes one missed case in #161868: the
IndividualTestOptionsshould have been created directly into theDynTestFnclosure so its temporary directory is removed right after it's done running.r? @RalfJung