Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 6f762f5

Browse files
committedJul 15, 2024
Update bootstrap tfp to --skip-huge instead of listing tests
1 parent c451197 commit 6f762f5

File tree

3 files changed

+21
-21
lines changed

3 files changed

+21
-21
lines changed
 

‎src/bootstrap/src/core/build_steps/test.rs

+2-6
Original file line numberDiff line numberDiff line change
@@ -3533,13 +3533,9 @@ impl Step for TestFloatParse {
35333533

35343534
cargo_run.arg("--");
35353535
if builder.config.args().is_empty() {
3536-
builder.info("only running a subset of tests by default");
35373536
// By default, exclude tests that take longer than ~1m.
3538-
cargo_run
3539-
.args(["--exclude", "fuzz"])
3540-
.args(["--exclude", "exhaustive"])
3541-
.args(["--exclude", "large exp"])
3542-
.args(["--exclude", "rand digits"]);
3537+
builder.info("only running a subset of tests by default");
3538+
cargo_run.arg("--skip-huge");
35433539
} else {
35443540
cargo_run.args(builder.config.args());
35453541
}

‎src/etc/test-float-parse/README.md

+17-14
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,20 @@ The generators work as follows:
77

88
- Each generator is a struct that lives somewhere in the `gen` module. Usually
99
it is generic over a float type.
10-
- These generators must implement `Iterator`, which should return a context
11-
type that can be used to construct a test string (but usually not the string
10+
- These generators must implement `Iterator`, which should return a context type
11+
that can be used to construct a test string (but usually not the string
1212
itself).
1313
- They must also implement the `Generator` trait, which provides a method to
1414
write test context to a string as a test case, as well as some extra metadata.
15-
16-
The split between context generation and string construction is so that
17-
we can reuse string allocations.
15+
16+
The split between context generation and string construction is so that we can
17+
reuse string allocations.
1818
- Each generator gets registered once for each float type. All of these
1919
generators then get iterated, and each test case checked against the float
2020
type's parse implementation.
2121

22-
Some tests produce decimal strings, others generate bit patterns that need
23-
to convert to the float type before printing to a string. For these, float to
22+
Some tests produce decimal strings, others generate bit patterns that need to
23+
convert to the float type before printing to a string. For these, float to
2424
decimal (`flt2dec`) conversions get tested, if unintentionally.
2525

2626
For each test case, the following is done:
@@ -30,13 +30,16 @@ For each test case, the following is done:
3030
- The test string is parsed separately to a `BigRational`, which acts as a
3131
representation with infinite precision.
3232
- The rational value then gets checked that it is within the float's
33-
representable values (absolute value greater than the smallest number to
34-
round to zero, but less less than the first value to round to infinity). If
35-
these limits are exceeded, check that the parsed float reflects that.
36-
- For real nonzero numbers, the parsed float is converted into a
37-
rational using `significand * 2^exponent`. It is then checked against the
38-
actual rational value, and verified to be within half a bit's precision
39-
of the parsed value.
33+
representable values (absolute value greater than the smallest number to round
34+
to zero, but less less than the first value to round to infinity). If these
35+
limits are exceeded, check that the parsed float reflects that.
36+
- For real nonzero numbers, the parsed float is converted into a rational using
37+
`significand * 2^exponent`. It is then checked against the actual rational
38+
value, and verified to be within half a bit's precision of the parsed value.
4039

4140
This is all highly parallelized with `rayon`; test generators can run in
4241
parallel, and their tests get chunked and run in parallel.
42+
43+
There is a simple command line that allows filtering which tests are run,
44+
setting the number of iterations for fuzzing tests, limiting failures, setting
45+
timeouts, etc. See `main.rs` or run with `--help` for options.

‎src/etc/test-float-parse/src/lib.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ mod gen {
3636
pub const DEFAULT_FUZZ_COUNT: u64 = u32::MAX as u64;
3737

3838
/// If there are more tests than this threashold, the test will be defered until after all
39-
/// others run (so as to avoid thread pool starvation).
39+
/// others run (so as to avoid thread pool starvation). They also can be excluded with
40+
/// `--skip-huge`.
4041
const HUGE_TEST_CUTOFF: u64 = 5_000_000;
4142

4243
/// Seed for tests that use a deterministic RNG.

0 commit comments

Comments
 (0)
Failed to load comments.