Module Name: src Committed By: kre Date: Fri Apr 24 14:29:19 UTC 2020
Modified Files: src/tests/usr.bin/printf: printf.sh Log Message: 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. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/tests/usr.bin/printf/printf.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/tests/usr.bin/printf/printf.sh diff -u src/tests/usr.bin/printf/printf.sh:1.5 src/tests/usr.bin/printf/printf.sh:1.6 --- src/tests/usr.bin/printf/printf.sh:1.5 Tue Nov 12 18:59:51 2019 +++ src/tests/usr.bin/printf/printf.sh Fri Apr 24 14:29:19 2020 @@ -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