pFUnit icon indicating copy to clipboard operation
pFUnit copied to clipboard

Test collector with pFUnit

Open kurtsansom opened this issue 4 years ago • 3 comments

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?

kurtsansom avatar Dec 18 '20 21:12 kurtsansom

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

danielhollas avatar Jan 19 '21 15:01 danielhollas

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

abrown41 avatar Nov 03 '21 11:11 abrown41

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.

tclune avatar Nov 03 '21 13:11 tclune