Skip to content

Commit 7b90511

Browse files
avargitster
authored andcommitted
t/t0000-basic.sh: Run the passing TODO test inside its own test-lib
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: PASS And 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: PASS Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 62f5390 commit 7b90511

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

t/t0000-basic.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,40 @@ test_expect_success 'success is reported like this' '
5454
test_expect_failure 'pretend we have a known breakage' '
5555
false
5656
'
57+
58+
test_expect_success 'pretend we have fixed a known breakage (run in sub test-lib)' "
59+
mkdir passing-todo &&
60+
(cd passing-todo &&
61+
cat >passing-todo.sh <<EOF &&
62+
#!$SHELL_PATH
63+
64+
test_description='A passing TODO test
65+
66+
This is run in a sub test-lib so that we do not get incorrect passing
67+
metrics
68+
'
69+
70+
# Point to the t/test-lib.sh, which isn't in ../ as usual
71+
TEST_DIRECTORY=\"$TEST_DIRECTORY\"
72+
. \"\$TEST_DIRECTORY\"/test-lib.sh
73+
5774
test_expect_failure 'pretend we have fixed a known breakage' '
5875
:
5976
'
77+
78+
test_done
79+
EOF
80+
chmod +x passing-todo.sh &&
81+
./passing-todo.sh >out 2>err &&
82+
! test -s err &&
83+
cat >expect <<EOF &&
84+
ok 1 - pretend we have fixed a known breakage # TODO known breakage
85+
# fixed 1 known breakage(s)
86+
# passed all 1 test(s)
87+
1..1
88+
EOF
89+
test_cmp expect out)
90+
"
6091
test_set_prereq HAVEIT
6192
haveit=no
6293
test_expect_success HAVEIT 'test runs if prerequisite is satisfied' '

0 commit comments

Comments
 (0)