ATF runs shell script tests with "sh -e" (WHY???)

Compensate for that by adding an explicit test to a command so
-e will not kill the shell when the command (expectedly) fails.

Previously this was saved by /bin/sh disabling -e in command subs.
This commit is contained in:
kre 2020-04-24 14:29:19 +00:00
parent 642bc4c72b
commit 0bcbd6c97f
1 changed files with 2 additions and 2 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: printf.sh,v 1.5 2019/11/12 18:59:51 kre Exp $
# $NetBSD: printf.sh,v 1.6 2020/04/24 14:29:19 kre Exp $
#
# Copyright (c) 2018 The NetBSD Foundation, Inc.
# All rights reserved.
@ -178,7 +178,7 @@ expect_fail()
test -z "${RES}" &&
atf_fail "$* ... failed (${STAT}) without error message"
RES="$( do_printf "$@" 2>/dev/null ; echo X )"
RES="$( do_printf "$@" 2>/dev/null || : ; echo X )"
RES=${RES%X} # hack to defeat \n removal from $() output
case "${RES}" in