[PATCH] grep: Don't pass a TODO test if REG_STARTEND is supported

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Change the git grep test that utilizes the REG_STARTEND flag so that
it doesn't TODO pass on platforms where REG_STARTEND is supported.

Git's own harness doesn't care, but a TAP harness will report all TODO
tests that pass. Having t7008-grep-binary.sh be the only test (aside
from the test-lib.sh test) that passes a TODO test is distracting.

Before prove(1)'s test summary looked like this:

    All tests successful.

    Test Summary Report
    -------------------
    ./t0000-basic.sh                        (Wstat: 0 Tests: 46 Failed: 0)
      TODO passed:   5
    ./t7008-grep-binary.sh                  (Wstat: 0 Tests: 18 Failed: 0)
      TODO passed:   11
    Files=476, Tests=6071, [...]
    Result: PASS

And now it'll give:

    All tests successful.

    Test Summary Report
    -------------------
    ./t0000-basic.sh                        (Wstat: 0 Tests: 46 Failed: 0)
      TODO passed:   5
    Files=476, Tests=6071,

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@xxxxxxxxx>
---
 t/t7008-grep-binary.sh |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/t/t7008-grep-binary.sh b/t/t7008-grep-binary.sh
index eb8ca88..6fd2b40 100755
--- a/t/t7008-grep-binary.sh
+++ b/t/t7008-grep-binary.sh
@@ -59,11 +59,16 @@ test_expect_success 'git grep -Fi iLE a' '
 	git grep -Fi iLE a
 '
 
-# This test actually passes on platforms where regexec() supports the
-# flag REG_STARTEND.
-test_expect_failure 'git grep ile a' '
-	git grep ile a
-'
+if git grep ile a
+then
+	# This only passes on platforms where regexec() supports the
+	# REG_STARTEND flag.
+	test_expect_success 'git grep ile a' 'git grep ile a'
+else
+	# On platforms where REG_STARTEND isn't supported we mark the
+	# failure as a TODO.
+	test_expect_failure 'git grep ile a' 'git grep ile a'
+fi
 
 test_expect_failure 'git grep .fi a' '
 	git grep .fi a
-- 
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]