test: run-test1 run-test2 .PHONY: run-test1 run-test1: test1.x ./test.x test1.x: test1.cpp ... gcc -o test1.x test1.cpp ...Of course, in a decent build system, this is a macro Build_Targets_For("foo.cpp"), rather than having to write them all out by hand. Scons may not be the best, but it avoids much clutter.
Andy "Krazy" Glew is a computer architect, a long time poster on comp.arch ... and an evangelist of collaboration tools such as wikis, calendars, blogs, etc. Plus an occasional commentator on politics, taxes, and policy. Particularly the politics of multi-ethnic societies such as Quebec, my birthplace. Photo credit: http://docs.google.com/View?id=dcxddbtr_23cg5thdfj
Observe the meta-pattern: Define individual actions, but have them registered with a bigger action that runs all the actions of a type.
ReplyDeleteFlip side: make pattern to only run the tests if there is reason to expect that they have changed. Note that we want both: sometimes tests are dependent on time, etc. Want to rerun if the surrounding environment has changed.
ReplyDelete