Seen on ninja development mailing list (thanks, Evan Martin) For each test, add a build rule like: build test1.stamp: test1.exe cmd = $in && touch $out And then one to gather them: build tests: phony test1.stamp And now "ninja tests" will build and run all modified tests.