[PATCH v3 4/4] t/t0000-basic.sh: Run the passing TODO test inside its own test-lib
- From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
- Date
- Aug 19, 2010, 16:08 UTC
- Message-ID
- <1282234092-27429-5-git-send-email-avarab@gmail.com>
- In-Reply-To
- <1282138473-15613-1-git-send-email-avarab@gmail.com>
Change the passing TODO test in t0000-basic.sh to run inside its own test-lib.sh. The motivation is to have nothing out of the ordinary on a normal test run for test smoking purposes.
If every normal test run has a passing TODO you're more likely to turn a blind eye to it and not to investigate cases where things really are passing unexpectedly.
It also makes the prove(1) output less noisy. Before:
All tests successful.
Test Summary Report
-------------------
./t0000-basic.sh (Wstat: 0 Tests: 46 Failed: 0)
TODO passed: 5
Files=484, Tests=6229, 143 wallclock secs ( 4.00 usr 4.15 sys + 104.77 cusr 351.57 csys = 464.49 CPU)
Result: PASSAnd after:
All tests successful.
Files=484, Tests=6228, 139 wallclock secs ( 4.07 usr 4.25 sys + 104.54 cusr 350.85 csys = 463.71 CPU)
Result: PASSSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> --- t/t0000-basic.sh | 31 +++++++++++++++++++++++++++++++ 1 files changed, 31 insertions(+), 0 deletions(-)
diff --git a/t/t0000-basic.sh b/t/t0000-basic.sh index 9602085..f688bd3 100755 --- a/t/t0000-basic.sh +++ b/t/t0000-basic.sh @@ -54,9 +54,40 @@ test_expect_success 'success is reported like this' ' test_expect_failure 'pretend we have a known breakage' ' false ' + +test_expect_success 'pretend we have fixed a known breakage (run in sub test-lib)' " + mkdir passing-todo && + (cd passing-todo && + cat >passing-todo.sh <<EOF && +#!$SHELL_PATH + +test_description='A passing TODO test + +This is run in a sub test-lib so that we do not get incorrect passing +metrics +' + +# Point to the t/test-lib.sh, which isn't in ../ as usual +TEST_DIRECTORY=\"$TEST_DIRECTORY\" +. \"\$TEST_DIRECTORY\"/test-lib.sh + test_expect_failure 'pretend we have fixed a known breakage' ' : ' + +test_done +EOF + chmod +x passing-todo.sh && + ./passing-todo.sh >out 2>err && + ! test -s err && +cat >expect <<EOF && +ok 1 - pretend we have fixed a known breakage # TODO known breakage +# fixed 1 known breakage(s) +# passed all 1 test(s) +1..1 +EOF + test_cmp expect out) +" test_set_prereq HAVEIT haveit=no test_expect_success HAVEIT 'test runs if prerequisite is satisfied' '
-- 1.7.2.1.446.g168052