From 9b845da478ae2fb65ac63de95f6005ecacbb52ce Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Fri, 17 Apr 2015 13:10:33 +1000 Subject: [PATCH] Fix die_if_not_set tests The "die_if_not_set" test has the LINENO as a positional argument. The existing tests are not passing this in, so they are failing. Along with this, remove the "-x" from the invocation and hide the output of the tests that are expected to fail to avoid confusion. Change-Id: Ibf6b9d7bb72b9f92831e1a90292ff8b0bec7faea --- tests/test_functions.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/test_functions.sh b/tests/test_functions.sh index 126080f1e3..4d0237afb7 100755 --- a/tests/test_functions.sh +++ b/tests/test_functions.sh @@ -13,26 +13,26 @@ source $TOP/openrc echo "Testing die_if_not_set()" -bash -cx "source $TOP/functions; X=`echo Y && true`; die_if_not_set X 'not OK'" +bash -c "source $TOP/functions; X=`echo Y && true`; die_if_not_set $LINENO X 'not OK'" if [[ $? != 0 ]]; then echo "die_if_not_set [X='Y' true] Failed" else echo 'OK' fi -bash -cx "source $TOP/functions; X=`true`; die_if_not_set X 'OK'" +bash -c "source $TOP/functions; X=`true`; die_if_not_set $LINENO X 'OK'" > /dev/null 2>&1 if [[ $? = 0 ]]; then echo "die_if_not_set [X='' true] Failed" fi -bash -cx "source $TOP/functions; X=`echo Y && false`; die_if_not_set X 'not OK'" +bash -c "source $TOP/functions; X=`echo Y && false`; die_if_not_set $LINENO X 'not OK'" if [[ $? != 0 ]]; then echo "die_if_not_set [X='Y' false] Failed" else echo 'OK' fi -bash -cx "source $TOP/functions; X=`false`; die_if_not_set X 'OK'" +bash -c "source $TOP/functions; X=`false`; die_if_not_set $LINENO X 'OK'" > /dev/null 2>&1 if [[ $? = 0 ]]; then echo "die_if_not_set [X='' false] Failed" fi