Skip to content

fypp for tests? #496

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

Closed
ghbrown opened this issue Aug 24, 2021 · 4 comments
Closed

fypp for tests? #496

ghbrown opened this issue Aug 24, 2021 · 4 comments
Labels
idea Proposition of an idea and opening an issue to discuss it

Comments

@ghbrown
Copy link
Member

ghbrown commented Aug 24, 2021

I considered bringing this up in the Discourse, but figured here was a more relevant place.

My question boils down to this: is there a reason we are not taking advantage of fypp for the stdlib tests (all of the test files I have seen are .f90)? Especially for mathematical functions where one needs to test reals, complex, and integers, a few lines of fypp could compress the source code (pre-fypp) by more than 3 to 1 by looping over the kinds of reals, complex, and integers.

I am sure there may be a good reason, but I have performed a quick search in the Discourse and in other GitHub issues (turning up nothing) and tried to reason about it (also turning up nothing).

@ghbrown ghbrown added the idea Proposition of an idea and opening an issue to discuss it label Aug 24, 2021
@awvwgk
Copy link
Member

awvwgk commented Aug 24, 2021

The reason are probably the build system limitations, the CMake tests are currently generated by an ugly macro and the manual Makefile tests by an include file template, both approaches lack the required flexibility to mix fypp preprocessed files and normal Fortran source code. It doesn't mean it is impossible, but the result is suboptimal at best.

Rather than over-engineering our build systems further, I think the first step is adopting some testing framework and bundle together all tests in a consistent way, we acquired quite some different styles now in the testsuites. For this purpose we discussed using vegetables, fytest or test-drive in #162 and are now in the process of adopting test-drive in #494.

Using fypp in the testsuite will be mainly useful for conditionally skipping tests in case the compiler does not support some of our requirements.

@ghbrown
Copy link
Member Author

ghbrown commented Aug 25, 2021

I see, thanks for the detailed explanation. Great to hear that some plans for improvement are in motion though!

I'm going to close the issue so as not to pollute the Issues.

@ghbrown ghbrown closed this as completed Aug 25, 2021
@jvdp1
Copy link
Member

jvdp1 commented Aug 25, 2021 via email

@ghbrown
Copy link
Member Author

ghbrown commented Aug 26, 2021

I missed that one, but good to hear it's possible. I'm going to keep my PR (in progress) for an addition to linalg in .f90 so as not to do more than one thing at once, but I'm happy to move the test_linalg over to whatever new platform we decide on / is in progress once my current PR is finished.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
idea Proposition of an idea and opening an issue to discuss it
Projects
None yet
Development

No branches or pull requests

3 participants