diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-11-15 18:02:01 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-11-15 18:02:01 +0100 |
| commit | 4e6e1eccf1e512d1dee42ddad007b94f17b6e2de (patch) | |
| tree | 8f889a71b3af7e66bd8722fedd8b79d6fa640ae0 /src/libtest/cli.rs | |
| parent | e3c78d549e0d8cdd3c05190e93f4ec7ff09a9ed1 (diff) | |
| parent | d252ba35d490f16d2efefdedc581b1c9d6d64ecb (diff) | |
Rollup merge of #66415 - tmandry:force-test-in-process, r=alexcrichton
Add --force-run-in-process unstable option to libtest When running tests with `-Zpanic_abort_tests`, it's sometimes desirable to fall back to the old behavior of only running tests in-process. This comes in handy if the system process launcher is unavailable, or the test code somehow expects all tests to be run in the same process. For example, in Fuchsia we have unit tests that actually test the process launcher itself, in which case we can't use the process launcher to run the tests :). r? @alexcrichton cc @cramertj,@petrhosek
Diffstat (limited to 'src/libtest/cli.rs')
| -rw-r--r-- | src/libtest/cli.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libtest/cli.rs b/src/libtest/cli.rs index a34426305be..c97cb0e0605 100644 --- a/src/libtest/cli.rs +++ b/src/libtest/cli.rs @@ -13,6 +13,7 @@ pub struct TestOpts { pub list: bool, pub filter: Option<String>, pub filter_exact: bool, + pub force_run_in_process: bool, pub exclude_should_panic: bool, pub run_ignored: RunIgnored, pub run_tests: bool, @@ -46,6 +47,7 @@ fn optgroups() -> getopts::Options { let mut opts = getopts::Options::new(); opts.optflag("", "include-ignored", "Run ignored and not ignored tests") .optflag("", "ignored", "Run only ignored tests") + .optflag("", "force-run-in-process", "Forces tests to run in-process when panic=abort") .optflag("", "exclude-should-panic", "Excludes tests marked as should_panic") .optflag("", "test", "Run tests and not benchmarks") .optflag("", "bench", "Run benchmarks instead of tests") @@ -233,6 +235,7 @@ fn parse_opts_impl(matches: getopts::Matches) -> OptRes { let allow_unstable = get_allow_unstable(&matches)?; // Unstable flags + let force_run_in_process = unstable_optflag!(matches, allow_unstable, "force-run-in-process"); let exclude_should_panic = unstable_optflag!(matches, allow_unstable, "exclude-should-panic"); let include_ignored = unstable_optflag!(matches, allow_unstable, "include-ignored"); let time_options = get_time_options(&matches, allow_unstable)?; @@ -259,6 +262,7 @@ fn parse_opts_impl(matches: getopts::Matches) -> OptRes { list, filter, filter_exact: exact, + force_run_in_process, exclude_should_panic, run_ignored, run_tests, |
