{"thread":{"id":"32403","subject":"[RFC/PATCH] tests: optionally fail passed todo immediately","startedAt":"2012-12-19T05:38:20Z","lastAt":"2012-12-19T05:38:20Z","messageCount":1,"participants":["Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"205175","messageId":"7vzk1abnzn.fsf@alter.siamese.dyndns.org","threadId":"32403","inReplyTo":null,"subject":"[RFC/PATCH] tests: optionally fail passed todo immediately","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-12-19T05:38:20Z","receivedAt":"2012-12-19T05:38:20Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Add \"--fail-passed-todo\" option to stop the test immediately when a\ntest that is expected to fail succeeds.  After seeing the test stop,\nthe developer can go to the trash directory and inspect why it failed\nto fail as expected.\n\nI usually just insert \"exit\" after such test with an editor, but\nan option like this might be easier to use.  I dunno.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n\n * Stopping immediately after a test that is failing (and expected\n   to fail) and then going to the trash directory to inspect the\n   status of the sandbox are the first two steps I often end up\n   doing while fixing a bug.  It may make sense to add an option to\n   cause the test to stop at a failure of test_expect_failure, but\n   that is a separate topic.\n\n t/test-lib.sh | 3 +++\n 1 file changed, 3 insertions(+)\n\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex f50f834..7b7cce6 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -176,6 +176,8 @@ do\n \t\tdebug=t; shift ;;\n \t-i|--i|--im|--imm|--imme|--immed|--immedi|--immedia|--immediat|--immediate)\n \t\timmediate=t; shift ;;\n+\t--fail-passed-todo)\n+\t\tfail_passed_todo=t; shift ;;\n \t-l|--l|--lo|--lon|--long|--long-|--long-t|--long-te|--long-tes|--long-test|--long-tests)\n \t\tGIT_TEST_LONG=t; export GIT_TEST_LONG; shift ;;\n \t-h|--h|--he|--hel|--help)\n@@ -307,6 +309,7 @@ test_failure_ () {\n test_known_broken_ok_ () {\n \ttest_fixed=$(($test_fixed+1))\n \tsay_color \"\" \"ok $test_count - $@ # TODO known breakage\"\n+\ttest \"$fail_passed_todo\" = \"\" || { GIT_EXIT_OK=t; exit 1; }\n }\n \n test_known_broken_failure_ () {\n-- \n1.8.1.rc2.196.g90926c8\n"}]}