summaryrefslogtreecommitdiff
path: root/test/test-common.sh
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2013-09-30 12:06:49 -0400
committerLuke Shumaker <LukeShu@sbcglobal.net>2013-09-30 12:07:44 -0400
commit505cf3ea3c09b390a57c715e47b65fea764d726d (patch)
tree1d6410c460e2df89fe64fe45e11df9dbbffbf647 /test/test-common.sh
parent3473a80a47f2cadc729f3be05fa7485ae5b12e22 (diff)
test-common.sh: add an empty() routine to check if a file is empty, use it
Diffstat (limited to 'test/test-common.sh')
-rw-r--r--test/test-common.sh10
1 files changed, 8 insertions, 2 deletions
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 ]]
+)