git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 0/2] test-lib.sh: add BAIL_OUT function, use it for SANITIZE=leak

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Oct 14, 2021, 00:47 UTC
Message-ID
<cover-0.2-00000000000-20211014T004542Z-avarab@gmail.com>

This series adds a BAIL_OUT function, and uses it when the new GIT_TEST_PASSING_SANITIZE_LEAK=true mode is misused.

Once we have this function we'll be able to use it for any other error that's a cause for aborting the entire test run.

I experimented with making BUG() and error() always be a "BAIL_OUT". I think that's worth pursuing, but e.g. for the error about missing "&&-chains" we'd need to support emitting multi-line messages.

TAP consumers only understand what follows the "Bail out!" message up to the first "\n", so we can't quote the entire "test_expect_success", as the "&&-chain" error does. I think emitting them with "say_error()" beforehand (piped with ">&7" in the case of "BUG()") should work, but let's leave those #leftoverbits for later.

Ævar Arnfjörð Bjarmason (2):
  test-lib.sh: de-duplicate error() teardown code
  test-lib.sh: use "Bail out!" syntax on bad SANITIZE=leak use
 t/test-lib.sh | 28 +++++++++++++++++++++-------
 1 file changed, 21 insertions(+), 7 deletions(-)
-- 
2.33.1.1346.g48288c3c089
Next: Ævar Arnfjörð Bjarmason
Message 1 of 6 in “test-lib.sh: add BAIL_OUT function, use it for SANITIZE=leak”
  1. 0/2 test-lib.sh: add BAIL_OUT function, use it for SANITIZE=leakÆvar Arnfjörð Bjarmason, Oct 14, 2021
  2. 1/2 test-lib.sh: de-duplicate error() teardown codeÆvar Arnfjörð Bjarmason, Oct 14, 2021
  3. Junio C HamanoOct 14, 2021
  4. 2/2 test-lib.sh: use "Bail out!" syntax on bad SANITIZE=leak useÆvar Arnfjörð Bjarmason, Oct 14, 2021
  5. Junio C HamanoOct 14, 2021
  6. Ævar Arnfjörð BjarmasonOct 14, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.