From 472d05111a38276192e30f454f42aa39df51d604 Mon Sep 17 00:00:00 2001 From: Phillip Wood Date: Sun, 2 Oct 2022 16:51:02 +0100 Subject: [PATCH 1/3] [RFC] tests: add test_todo() to mark known breakages test_todo() is intended as a fine grained replacement for test_expect_failure(). Rather than marking the whole test as failing test_todo() is used to mark individual failing commands within a test. This approach to writing failing tests allows us to detect unexpected failures that are hidden by test_expect_failure(). Failing commands are reported by the test harness in the same way as test_expect_failure() so there is no change in output when migrating from test_expect_failure() to test_todo(). If a command marked with test_todo() succeeds then the test will fail. This is designed to make it easier to see when a command starts succeeding in our CI compared to using test_expect_failure() where it is easy to fix a failing test case and not realize it. test_todo() is built upon test_expect_failure() but accepts commands starting with test_* in addition to git. As our test_* assertions use BUG() to signal usage errors any such error will not be hidden by test_todo(). This commit coverts a few tests to show the intended use of test_todo(). A limitation of test_todo() as it is currently implemented is that it cannot be used in a subshell. Signed-off-by: Phillip Wood --- t/README | 12 +++ t/t0000-basic.sh | 64 ++++++++++++++ t/t3401-rebase-and-am-rename.sh | 12 +-- t/t3424-rebase-empty.sh | 6 +- t/t3600-rm.sh | 8 +- t/test-lib-functions.sh | 147 +++++++++++++++++++++++--------- 6 files changed, 194 insertions(+), 55 deletions(-) diff --git a/t/README b/t/README index 979b2d4833d983..642aeab80b4913 100644 --- a/t/README +++ b/t/README @@ -892,6 +892,10 @@ see test-lib-functions.sh for the full list and their options. - test_expect_failure []