test: testexec for test in $(TESTS); do ./$$test ; done
I'm using CPPUnit (http://cppunit.sourceforge.net/cppunit-wiki) to make unit tests for each class in my C++ program. I can say "make test" tohave them all built and executed.
...
I thought I'd be clever and use the shell "for" control construct to execute all the tests that are named in $(TESTS) rather than listing them explicitly. But it doesn't work because make sees the $ and expands it before passing the command line to the shell: test: testexec for test in $(TESTS); do ./$test; done
-- Mike Crawford crawford@goingware.com Read "GoingWare's Bag of Programming Tricks" at: