Skip to content

Commit

Permalink
Introduce test targets that always run
Browse files Browse the repository at this point in the history
This means having a test file open (in TextMate) and using ⌘B, the test will always run, even if it has previously succeeded and none of the test’s dependencies have been updated.
  • Loading branch information
sorbits committed Aug 18, 2012
1 parent 7e9f10a commit 7f177f1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .tm_properties
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ fileType = 'source.c++'

[ tests/*.{cc,mm} ]
scopeAttributes = 'attr.test.cxxtest'
TM_NINJA_TARGET = '${TM_FILEPATH/^.*?([^\/]*)\/tests\/.*$/$1/}'
TM_NINJA_TARGET = '${TM_FILEPATH/^.*?([^\/]*)\/tests\/.*$/$1\/test/}'

[ tests/t_*.mm ]
GUI_TESTS = '${TM_FILENAME/^t_(.*)\.mm$/$1/}'
6 changes: 6 additions & 0 deletions bin/gen_build
Original file line number Diff line number Diff line change
Expand Up @@ -271,10 +271,12 @@ def tests(target)
res << " RAVE_FLAGS = #{fws} #{libs}\n"

res << "build #{dst}.run: run_test #{dst}\n"
res << "build #{dst}.always-run: always_run_test #{dst}\n"
res << "build #{dst}.coerce: skip_test #{dst}\n"
res << " seal = #{dst}.run\n"

res << "build #{target[:name]}: phony #{dst}.run\n"
res << "build #{target[:name]}/test: phony #{dst}.always-run\n"
res << "build #{target[:name]}/coerce: phony #{dst}.coerce\n"

target[:test] = "#{dst}.run"
Expand Down Expand Up @@ -697,6 +699,10 @@ rule run_test
command = $in && touch $out
description = Run test ‘$in’…

rule always_run_test
command = $in
description = Run test ‘$in’…

rule skip_test
command = touch "$seal"
description = Skip test ‘$in’…
Expand Down

0 comments on commit 7f177f1

Please sign in to comment.