-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
TST: Add data driven tests based on xsref
parquet files using Catch2
#14
Draft
steppi
wants to merge
28
commits into
scipy:main
Choose a base branch
from
steppi:catch-test-setup
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+313
−8
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
steppi
commented
Mar 11, 2025
Comment on lines
+32
to
+40
INFO("a := " << std::setprecision(std::numeric_limits<double>::max_digits10) << a << '\n' | ||
<< "b := " << b << '\n' | ||
<< "c := " << c << '\n' | ||
<< "z := " << z << '\n' | ||
<< "out := " << out << '\n' | ||
<< "desired := " << desired << '\n' | ||
<< "error := " << error << '\n' | ||
<< "tolerance := " << tol << '\n' | ||
); |
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.
If catchorg/Catch2#2226 lands. This could be replaced with
CAPTURE(a, b, c, z, out, desired, error, tolerance);
- this is what worked for the xsref first workflow
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is a rough sketch of what I'm thinking of for tests. It uses Catch2 as the testing framework, and implements a custom Catch2 generator to iterate through test cases. Tests are only implemented for
hyp2f1
on this PR. Once I have everything settled down, I plan to write a script to generate the test files for other functions since they follow a pretty straightforward recipe. I've only added tests for 64 bit Linux GCC, but more can come later. I'll need to add a parquet file of tolerances for every tested platform, but this shouldn't be too bad actually.I think Catch2 seems nice enough to work with. So far I've found one thing that it would be good to have fixed. It seems that all floating point numbers are printed with
std::fixed
when using Catch2's built in logging features, whenstd::scientific
is needed for our case in order to actual see floating point values to full precision. There's a languishing PR, catchorg/Catch2#2226, to allow setting the format tostd::scientific
, which only needs a small tweak to make work. I see this as a bellweather. If I'm able to nudge this PR through on a reasonable timescale, then I think Catch2 is actively developed enough to be worth using here, but if the PR continues to languish, I guess we can just use GoogleTest or something. I'll leave a comment with more details on this.I haven't done any of the nice stuff with coverage that @inkydragon did. This is important, but this is just a sketch for now. @inkydragon, let me know if you think there's anything else that could be improved here. It also might be a good idea to set up ccache.
I'm not sure if github workflow i wrote will work yet. I still haven't got up to speed on testing those locally. The tests themselves due work locally for me though.