pFUnit
pFUnit copied to clipboard
Test collector with pFUnit
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?
++ on the idea, adding tests manually to the Makefile is not super ergonomic.
@kurtsansom I have been looking for this exact functionality: have you made any progress on this?
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.