Goddard-Fortran-Ecosystem / pFUnit

Parallel Fortran Unit Testing Framework
Other
171 stars 45 forks source link

Test collector with pFUnit #260

Open kurtsansom opened 3 years ago

kurtsansom commented 3 years ago

Tools like pytest provides a test collection mechanism.

We are looking into using a cmake macro to do test collection. i.e. search the source tree for files with *.pf extension and generate the test for each one. This way a test can be added without explicit cmake changes.

Is this a functionality that pFUnit could have or would it be better suited somewhere else? and as python is already being used for pre-processing, would it make since to implement a test collector with python?

Is this something the project has considered in the past? What are peoples thoughts on the the subject?

danielhollas commented 3 years ago

++ on the idea, adding tests manually to the Makefile is not super ergonomic.

abrown41 commented 2 years ago

@kurtsansom I have been looking for this exact functionality: have you made any progress on this?

tclune commented 2 years ago

Hmm - I somehow missed this issue last year, or at least no longer remember it.

To be clear, you'd prefer some sort of "glob" mechanism than having an explicit list of test files? This is contrary to the usual CMake guidance, but it should be pretty straightforward to write such a macro. The only bit I can't immediately see how to do easily is the traversal of an arbitrary tree. Just have not had to do anything like that in CMake before, but surely doable.

I welcome the contribution.