-
-
Notifications
You must be signed in to change notification settings - Fork 10
TST: Add data driven tests based on xsref
parquet files using Catch2
#14
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
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
OK. Well we have tests for one platform now. The parquet files contain cases from all I had to make some fixes to get all of the tests to pass, including the problems noted by @ZappD0S here #16. So this PR should close that issue. Some remaining work for testing and CI:
I plan to work on these things incrementally, spending a few hours per week improving the state of things. |
I'm going to go ahead and merge this. I think we can iterate from here. |
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.