Add "--fail-passed-todo" option to stop the test immediately when a
test that is expected to fail succeeds.  After seeing the test stop,
the developer can go to the trash directory and inspect why it failed
to fail as expected.

I usually just insert "exit" after such test with an editor, but
an option like this might be easier to use.  I dunno.

Signed-off-by: Junio C Hamano <>

 * Stopping immediately after a test that is failing (and expected
   to fail) and then going to the trash directory to inspect the
   status of the sandbox are the first two steps I often end up
   doing while fixing a bug.  It may make sense to add an option to
   cause the test to stop at a failure of test_expect_failure, but
   that is a separate topic.

 t/ | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/t/ b/t/
index f50f834..7b7cce6 100644
--- a/t/
+++ b/t/
@@ -176,6 +176,8 @@ do
                debug=t; shift ;;
                immediate=t; shift ;;
+       --fail-passed-todo)
+               fail_passed_todo=t; shift ;;
                GIT_TEST_LONG=t; export GIT_TEST_LONG; shift ;;
@@ -307,6 +309,7 @@ test_failure_ () {
 test_known_broken_ok_ () {
        say_color "" "ok $test_count - $@ # TODO known breakage"
+       test "$fail_passed_todo" = "" || { GIT_EXIT_OK=t; exit 1; }
 test_known_broken_failure_ () {

To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to
More majordomo info at

Reply via email to