From 7f177f1345cd26048f6aa66cbc449ba7a75ef4e5 Mon Sep 17 00:00:00 2001 From: Allan Odgaard Date: Sat, 18 Aug 2012 00:56:57 +0200 Subject: [PATCH] Introduce test targets that always run MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- .tm_properties | 2 +- bin/gen_build | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.tm_properties b/.tm_properties index 1a068901..cc009989 100644 --- a/.tm_properties +++ b/.tm_properties @@ -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/}' diff --git a/bin/gen_build b/bin/gen_build index a4b79cd5..6a260aad 100755 --- a/bin/gen_build +++ b/bin/gen_build @@ -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’…