Skip to content

Instantly share code, notes, and snippets.

@dmerejkowsky
Created September 12, 2016 18:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dmerejkowsky/a5c39d2424b4a15c4bce62ff73203f0f to your computer and use it in GitHub Desktop.
Save dmerejkowsky/a5c39d2424b4a15c4bce62ff73203f0f to your computer and use it in GitHub Desktop.
Only run modified tests with ninja

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment