about summary refs log tree commit diff
path: root/src/tools/compiletest
diff options
context:
space:
mode:
authorJubilee <46493976+workingjubilee@users.noreply.github.com>2021-10-07 20:26:12 -0700
committerGitHub <noreply@github.com>2021-10-07 20:26:12 -0700
commit37f17bca7ccca0b393a58c87bb87bac18f371f61 (patch)
tree23c2653b0ede7c0e6fd0b49687219a138ab13796 /src/tools/compiletest
parent6c17601a2e6fa55e5d2ec7284359bee931c0c61a (diff)
parentecf474152350664f1227421eeb278b2e8185cd07 (diff)
Rollup merge of #89082 - smoelius:master, r=kennytm
Implement #85440 (Random test ordering)

This PR adds `--shuffle` and `--shuffle-seed` options to `libtest`. The options are similar to the [`-shuffle` option](https://github.com/golang/go/blob/c894b442d1e5e150ad33fa3ce13dbfab1c037b3a/src/testing/testing.go#L1482-L1499) that was recently added to Go.

Here are the relevant parts of the help message:
```
        --shuffle       Run tests in random order
        --shuffle-seed SEED
                        Run tests in random order; seed the random number
                        generator with SEED
...
By default, the tests are run in alphabetical order. Use --shuffle or set
RUST_TEST_SHUFFLE to run the tests in random order. Pass the generated
"shuffle seed" to --shuffle-seed (or set RUST_TEST_SHUFFLE_SEED) to run the
tests in the same order again. Note that --shuffle and --shuffle-seed do not
affect whether the tests are run in parallel.
```
Is an RFC needed for this?
Diffstat (limited to 'src/tools/compiletest')
-rw-r--r--src/tools/compiletest/src/main.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/tools/compiletest/src/main.rs b/src/tools/compiletest/src/main.rs
index fbf3249db94..87aba8c5d32 100644
--- a/src/tools/compiletest/src/main.rs
+++ b/src/tools/compiletest/src/main.rs
@@ -506,6 +506,8 @@ pub fn test_opts(config: &Config) -> test::TestOpts {
             Err(_) => false,
         },
         color: config.color,
+        shuffle: false,
+        shuffle_seed: None,
         test_threads: None,
         skip: vec![],
         list: false,