Scuttle is now working as intended for the standard use case. As described in the introductory post, for a C project with a standard layout, adding unit testing with Scuttle requires the following steps:
- Install
scuttle.heither locally to the project or in the system include path - Install
scuttle.sheither locally to the project or somewhere on your$PATH - Add test suite source files under
test/, each corresponding to a module of your project, namedtest_<module>.c, using Scuttle’s simple macros - Add a
testtarget to your mainMakefileas follows:
test:
bash scuttle.sh test
$(MAKE) -C test
Scuttle will generate test/Makefile, test/test_<module>.h and test/test_<module>_gen.h for each test/test_<module>.c suite, and the test/test_<project>.c harness; and the generated Makefile’s test target will build and run the test harness and pipe the output to test/log/test_<project>.log.
There’s a lot of room to make this more flexible and add some convenience features, but in terms of functionality it’s at MVP level now.
Tomorrow I’ll do a quick cleanup pass, make a few small tweaks I’ve already thought of, write some basic documentation, and actually push the code up to a public repo so if anyone’s interested in trying it out, it’ll be available.