-
Notifications
You must be signed in to change notification settings - Fork 13.4k
coretests: extend and simplify float tests #141571
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
library/coretests/tests/num/mod.rs
Outdated
f64::MAX_EXP | ||
); | ||
// FIXME(f16_f128): `f16` is only tested in consts for now. | ||
test_float!(f16_const, float_const_assert, f16); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this will actually run the div_euclid/rem_euclid tests on the host, not in core, since those aren't const fn
yet. I'll constify them but that needs #141521 to land first.
I assume that means I should drop the first commit here since f16 / f128 don't work properly on all targets?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be great to have them tested here too, but I suppose dropping them may be best if there isn't an elegant solution.
Maybe something like #141521 (comment) would work here for *_euclid
? That would mean the test functions can be defined with relevant gates in the four different files, only the test cases would live in a macro here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not a fan of spreading the macro uses across multiple files, that makes it easy to forget using one of the macros for one of the types.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed the f16/f128 tests for now, the remaining changes are still good improvements IMO and I'll wait for #141521 to land before attempting any further changes here.
library/coretests/tests/num/mod.rs
Outdated
f64::MAX_EXP | ||
); | ||
// FIXME(f16_f128): `f16` is only tested in consts for now. | ||
test_float!(f16_const, float_const_assert, f16); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be great to have them tested here too, but I suppose dropping them may be best if there isn't an elegant solution.
Maybe something like #141521 (comment) would work here for *_euclid
? That would mean the test functions can be defined with relevant gates in the four different files, only the test cases would live in a macro here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r=me once CI passes
@bors r=tgross35 |
coretests: extend and simplify float tests Also de-duplicate tests by removing a ui test that duplicates the tests in core. r? `@tgross35`
Rollup of 4 pull requests Successful merges: - #138285 (Stabilize `repr128`) - #139994 (add `CStr::display`) - #141571 (coretests: extend and simplify float tests) - #141656 (CI: Add cargo tests to aarch64-apple-darwin) Failed merges: - #141430 (remove `visit_clobber` and move `DummyAstNode` to `rustc_expand`) - #141636 (avoid some usages of `&mut P<T>` in AST visitors) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of #141571 - RalfJung:float-tests, r=tgross35 coretests: extend and simplify float tests Also de-duplicate tests by removing a ui test that duplicates the tests in core. r? `@tgross35`
coretests: extend and simplify float tests Also de-duplicate tests by removing a ui test that duplicates the tests in core. r? `@tgross35`
Rollup of 4 pull requests Successful merges: - rust-lang#138285 (Stabilize `repr128`) - rust-lang#139994 (add `CStr::display`) - rust-lang#141571 (coretests: extend and simplify float tests) - rust-lang#141656 (CI: Add cargo tests to aarch64-apple-darwin) Failed merges: - rust-lang#141430 (remove `visit_clobber` and move `DummyAstNode` to `rustc_expand`) - rust-lang#141636 (avoid some usages of `&mut P<T>` in AST visitors) r? `@ghost` `@rustbot` modify labels: rollup
Rollup of 4 pull requests Successful merges: - rust-lang/rust#138285 (Stabilize `repr128`) - rust-lang/rust#139994 (add `CStr::display`) - rust-lang/rust#141571 (coretests: extend and simplify float tests) - rust-lang/rust#141656 (CI: Add cargo tests to aarch64-apple-darwin) Failed merges: - rust-lang/rust#141430 (remove `visit_clobber` and move `DummyAstNode` to `rustc_expand`) - rust-lang/rust#141636 (avoid some usages of `&mut P<T>` in AST visitors) r? `@ghost` `@rustbot` modify labels: rollup
Also de-duplicate tests by removing a ui test that duplicates the tests in core.
r? @tgross35