From 505cf3ea3c09b390a57c715e47b65fea764d726d Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 30 Sep 2013 12:06:49 -0400 Subject: test-common.sh: add an empty() routine to check if a file is empty, use it --- test/test-common.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'test/test-common.sh') diff --git a/test/test-common.sh b/test/test-common.sh index 01b1b35..4e528d5 100644 --- a/test/test-common.sh +++ b/test/test-common.sh @@ -22,7 +22,8 @@ _after_sudo() { fi } -require() { +require() ( + set +x local missing=() if libremessages in_array "network" "$@" && ! [[ $NETWORK ]]; then missing+=('networking') @@ -35,4 +36,9 @@ require() { return 1 fi return 0; -} +) + +empty() ( + set +x + [[ $(stat -c %s "$1") -eq 0 ]] +) -- cgit v1.2.3-54-g00ecf