rust/tests
bors e5bb341f0e Auto merge of #111992 - ferrocene:pa-panic-abort-tests-bench, r=m-ou-se
Test benchmarks with `-Z panic-abort-tests`

During test execution, when a `#[bench]` benchmark is encountered it's executed once to check whether it works. Unfortunately that was not compatible with `-Z panic-abort-tests`: the feature works by spawning a subprocess for each test, which prevents the use of dynamic tests as we cannot pass closures to child processes, and before this PR the conversion from benchmark to test was done by turning benchmarks into dynamic tests whose closures execute the benchmark once.

The approach this PR took was to add two new kinds of `TestFn`s: `StaticBenchAsTestFn` and `DynBenchAsTestFn` (⚠️ **this is a breaking change** ⚠️). With that change, a `StaticBenchFn` can be converted into a `StaticBenchAsTestFn` without creating dynamic tests, and making it possible to test `#[bench]` functions with `-Z panic-abort-tests`. The subprocess test runner also had to be updated to perform the conversion from benchmark to test when appropriate.

Along with the bug fix, in the first commit I refactored how tests are executed: rather than executing the test function in multiple places across `libtest`, there is now a private `TestFn::into_runnable()` method, which returns either a `RunnableTest` or `RunnableBench`, on which you can call the `run()` method. This simplified the rest of the changes in the PR.

This PR is best reviewed commit-by-commit.
Fixes https://github.com/rust-lang/rust/issues/73509
2023-07-01 07:07:50 +00:00
..
assembly
auxiliary
codegen Auto merge of #112516 - erikdesjardins:loop, r=davidtwco 2023-06-27 15:01:56 +00:00
codegen-units
debuginfo
incremental
mir-opt Auto merge of #112307 - lcnr:operand-ref, r=compiler-errors 2023-06-28 00:41:37 +00:00
pretty
run-coverage Re-bless the newly-migrated tests 2023-06-28 11:09:19 +10:00
run-coverage-rustdoc Re-bless the newly-migrated tests 2023-06-28 11:09:19 +10:00
run-make Rollup merge of #112300 - Zalathar:run-coverage, r=wesleywiser 2023-06-29 16:36:31 +02:00
run-make-fulldeps Provide more context for rustc +nightly -Zunstable-options on stable 2023-06-27 23:23:33 +08:00
run-pass-valgrind
rustdoc Rollup merge of #113058 - GuillaumeGomez:improve-code-comments, r=notriddle 2023-06-27 07:01:32 +02:00
rustdoc-gui Improve search-result-display.goml test 2023-06-30 11:45:42 +02:00
rustdoc-js
rustdoc-js-std
rustdoc-json
rustdoc-ui
ui Auto merge of #111992 - ferrocene:pa-panic-abort-tests-bench, r=m-ou-se 2023-07-01 07:07:50 +00:00
ui-fulldeps Auto merge of #111269 - clubby789:validate-fluent-variables, r=davidtwco 2023-06-28 03:47:02 +00:00
COMPILER_TESTS.md