Introduce test targets that always run

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.
This commit is contained in:
Allan Odgaard
2012-08-18 00:56:57 +02:00
parent 7e9f10ae29
commit 7f177f1345
2 changed files with 7 additions and 1 deletions

View File

@@ -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/}'

View File

@@ -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"
@@ -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