diff --git a/src/bootstrap/src/core/build_steps/test.rs b/src/bootstrap/src/core/build_steps/test.rs index 4801265f26aa3..f9e37da23468a 100644 --- a/src/bootstrap/src/core/build_steps/test.rs +++ b/src/bootstrap/src/core/build_steps/test.rs @@ -3533,13 +3533,9 @@ impl Step for TestFloatParse { cargo_run.arg("--"); if builder.config.args().is_empty() { - builder.info("only running a subset of tests by default"); // By default, exclude tests that take longer than ~1m. - cargo_run - .args(["--exclude", "fuzz"]) - .args(["--exclude", "exhaustive"]) - .args(["--exclude", "large exp"]) - .args(["--exclude", "rand digits"]); + builder.info("only running a subset of tests by default"); + cargo_run.arg("--skip-huge"); } else { cargo_run.args(builder.config.args()); } diff --git a/src/etc/test-float-parse/README.md b/src/etc/test-float-parse/README.md index a08adc16f984e..ceeb9b150cc0c 100644 --- a/src/etc/test-float-parse/README.md +++ b/src/etc/test-float-parse/README.md @@ -7,20 +7,20 @@ The generators work as follows: - Each generator is a struct that lives somewhere in the `gen` module. Usually it is generic over a float type. -- These generators must implement `Iterator`, which should return a context - type that can be used to construct a test string (but usually not the string +- These generators must implement `Iterator`, which should return a context type + that can be used to construct a test string (but usually not the string itself). - They must also implement the `Generator` trait, which provides a method to write test context to a string as a test case, as well as some extra metadata. - - The split between context generation and string construction is so that - we can reuse string allocations. + + The split between context generation and string construction is so that we can + reuse string allocations. - Each generator gets registered once for each float type. All of these generators then get iterated, and each test case checked against the float type's parse implementation. -Some tests produce decimal strings, others generate bit patterns that need -to convert to the float type before printing to a string. For these, float to +Some tests produce decimal strings, others generate bit patterns that need to +convert to the float type before printing to a string. For these, float to decimal (`flt2dec`) conversions get tested, if unintentionally. For each test case, the following is done: @@ -30,13 +30,16 @@ For each test case, the following is done: - The test string is parsed separately to a `BigRational`, which acts as a representation with infinite precision. - The rational value then gets checked that it is within the float's - representable values (absolute value greater than the smallest number to - round to zero, but less less than the first value to round to infinity). If - these limits are exceeded, check that the parsed float reflects that. -- For real nonzero numbers, the parsed float is converted into a - rational using `significand * 2^exponent`. It is then checked against the - actual rational value, and verified to be within half a bit's precision - of the parsed value. + representable values (absolute value greater than the smallest number to round + to zero, but less less than the first value to round to infinity). If these + limits are exceeded, check that the parsed float reflects that. +- For real nonzero numbers, the parsed float is converted into a rational using + `significand * 2^exponent`. It is then checked against the actual rational + value, and verified to be within half a bit's precision of the parsed value. This is all highly parallelized with `rayon`; test generators can run in parallel, and their tests get chunked and run in parallel. + +There is a simple command line that allows filtering which tests are run, +setting the number of iterations for fuzzing tests, limiting failures, setting +timeouts, etc. See `main.rs` or run with `--help` for options. diff --git a/src/etc/test-float-parse/src/lib.rs b/src/etc/test-float-parse/src/lib.rs index f0ccd97e4cad0..6f224469237c8 100644 --- a/src/etc/test-float-parse/src/lib.rs +++ b/src/etc/test-float-parse/src/lib.rs @@ -36,7 +36,8 @@ mod gen { pub const DEFAULT_FUZZ_COUNT: u64 = u32::MAX as u64; /// If there are more tests than this threashold, the test will be defered until after all -/// others run (so as to avoid thread pool starvation). +/// others run (so as to avoid thread pool starvation). They also can be excluded with +/// `--skip-huge`. const HUGE_TEST_CUTOFF: u64 = 5_000_000; /// Seed for tests that use a deterministic RNG.