This refactors the testing of test-lib.sh itself in t0000 into a lib-subtest.sh, fixing duplicate setup, bugs and various shell nits along the way. This was waiting on my now-merged 2019256717d (Merge branch 'ab/test-lib-updates', 2021-06-14). There's a conflict here with Felipe's proposed http://lore.kernel.org/git/20210609170520.67014-1-felipe.contreras@xxxxxxxxx, but it's just a matter of moving the fix around and solving a trivial conflict. I thought it was better to submit this now anyway, while this code is fresh in people's minds. I'm hoping Felipe will take some variant of my http://lore.kernel.org/git/8735tk22if.fsf@xxxxxxxxxxxxxxxxxxx and perhaps review this series & base his patch on top of these changes, but alternatively they can go in independently with Junio solving the conflict. Ævar Arnfjörð Bjarmason (8): test-lib tests: move "run_sub_test" to a new lib-subtest.sh test-lib tests: split up "write and run" into two functions test-lib tests: stop using a subshell in write_sub_test_lib_test() test-lib tests: don't provide a description for the sub-tests test-lib tests: get rid of copy/pasted mock test code test-lib tests: avoid subshell for "test_cmp" for readability test-lib tests: refactor common part of check_sub_test_lib_test*() test-lib tests: assert 1 exit code, not non-zero t/lib-subtest.sh | 105 ++++++++++++ t/t0000-basic.sh | 419 +++++++++++++---------------------------------- 2 files changed, 219 insertions(+), 305 deletions(-) create mode 100644 t/lib-subtest.sh -- 2.32.0.rc3.434.gd8aed1f08a7