[PATCH 0/6] tests: add a bash "set -o pipefail" test mode

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

 



There's been past attempts to add a "set -o pipefail" test mode. I
suspect it can't be done in any sane way the way it works in bash
now. See 6/6 for details.

This series makes it work because I patched it to work sanely in bash
itself when it comes to SIGPIPE. I'm partially submitting this so I
can prod the bash maintainer with a link to this thread.

But also because even though you need to patch your bash to benefit
from this new test mode, it doesn't break anything for anyone who
doesn't have the patch (we guard it with a detection for the sane
behavior), and at the very least 4/6 (or maybe just to 2/6) are
generally sane fixes even without the rest.

1. https://lore.kernel.org/git/cover.1573779465.git.liu.denton@xxxxxxxxx/

Ævar Arnfjörð Bjarmason (6):
  test-lib: add tests for test_might_fail
  test-lib: add ok=* support to test_might_fail
  test_lib: allow test_{must,might}_fail to accept non-git on "sigpipe"
  tests: use "test_might_fail ok=sigpipe grep" when appropriate
  tests: split up bash detection library
  tests: add a "set -o pipefail" for a patched bash

 t/README                           |  6 +++++
 t/lib-bash-detection.sh            |  8 +++++++
 t/lib-bash.sh                      |  4 +++-
 t/t0000-basic.sh                   | 38 ++++++++++++++++++++++++++++++
 t/t0005-signals.sh                 |  4 ++--
 t/t0090-cache-tree.sh              |  2 +-
 t/t5000-tar-tree.sh                |  2 +-
 t/t5703-upload-pack-ref-in-want.sh |  2 +-
 t/t9151-svn-mergeinfo.sh           |  6 ++---
 t/t9902-completion.sh              |  5 ++++
 t/test-lib-functions.sh            | 24 ++++++++++++++++++-
 t/test-lib.sh                      | 29 +++++++++++++++++++++++
 12 files changed, 120 insertions(+), 10 deletions(-)
 create mode 100644 t/lib-bash-detection.sh

-- 
2.29.2.222.g5d2a92d10f8




[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]

  Powered by Linux