There is a free HWUT tool, a unit test tool that does the job! HWUT at Sourceforge
HWUT does this because of motivation to make it easy to set up unit tests. You can set "ctags" (hwut will use it automatically). Otherwise, the HWUT parses the code using the output file of the compiler object (which, as you know, is slow).
Once you have installed, you simply call it with
> hwut sos your.c --root some/root/dir another/root/dir --args -DMyCompilerArg -DAnother Arg --
He will start searching for the included files, source files, object files and libraries in "some / root / dir" and "another / root / dir". Starting with the file "your.c", it will search for all the necessary links and headers and create a well-formatted Makefile. If the project is still too large, you can specify sets of root directories to search for sources, inclusions, and libraries separately.
- - root-sources ... for root directories where to look for sources
- - root - includes ... where to look for include headers
- - root-libraries ... where to look for libraries
- - root objects ... where to look for objects
BTW: there is a "sols" mode (safe for our weak souls) that directly generates test files for all functions in the module, i.e.
hwut sols "module-to-test.c"
not only generates a Makefile, but also a battery of test files that serve as a starting point for writing tests.
Frank-rene schΓ€fer
source share