Tests redirect to err file when grepping stderr
commit9f9ced5c7c52cec31531b185e9fdf42e78e8e3aa
authorPeter Grayson <pete@jpgrayson.net>
Tue, 14 Dec 2021 21:39:21 +0000 (14 16:39 -0500)
committerPeter Grayson <pete@jpgrayson.net>
Wed, 15 Dec 2021 13:43:06 +0000 (15 08:43 -0500)
tree17d49c3a8a46e20b17de89136b5904876df0a418
parentacfed479ed68938150956311e8ab59c11c304971
Tests redirect to err file when grepping stderr

The old pattern:

    command_error stg xxx 2>&1 | grep -e "..."

had the problem that the command_error testing would not abort the test
if stg returned the wrong code. The command_error error message would
print out, but the test would merrily continue as long as grep
succeeded.

The new pattern is:

    command_error stg xxx 2>err && grep -e "..." err

which properly separates the command_error test from the grep test and
has the debugability benefit of being able to insert test_pause between
the stg command and the grep, and being able to inspect err at that
point without having to re-run the stg command.

Signed-off-by: Peter Grayson <pete@jpgrayson.net>
49 files changed:
t/t0003-id.sh
t/t0004-main.sh
t/t0005-show.sh
t/t0006-patches.sh
t/t0007-files.sh
t/t0008-series.sh
t/t0009-log.sh
t/t1000-branch-create.sh
t/t1001-branch-rename.sh
t/t1003-new.sh
t/t1005-branch-delete.sh
t/t1006-branch-cleanup.sh
t/t1007-branch-protect.sh
t/t1008-branch-description.sh
t/t1100-clone-under.sh
t/t1201-push-noapply.sh
t/t1208-push-and-pop.sh
t/t1210-pop-spill.sh
t/t1300-uncommit.sh
t/t1301-repair.sh
t/t1303-commit.sh
t/t1500-float.sh
t/t1501-sink.sh
t/t1504-float-noapply.sh
t/t1600-delete-one.sh
t/t1700-goto.sh
t/t1800-import.sh
t/t1900-mail.sh
t/t2000-sync.sh
t/t2101-pull-policy-pull.sh
t/t2102-pull-policy-rebase.sh
t/t2203-rebase-interactive.sh
t/t2204-rebase-autostash.sh
t/t2400-diff.sh
t/t2500-clean.sh
t/t2600-squash.sh
t/t2700-refresh.sh
t/t2703-refresh-pre-commit-hook.sh
t/t2704-refresh-spill.sh
t/t2900-rename.sh
t/t3101-reset-hard.sh
t/t3104-redo.sh
t/t3300-edit.sh
t/t3301-edit-args.sh
t/t3400-pick.sh
t/t3500-hide-unhide.sh
t/t3600-fold.sh
t/t4300-export.sh
t/t7504-commit-msg-hook.sh