summaryrefslogtreecommitdiffstats
path: root/tests/common
diff options
context:
space:
mode:
Diffstat (limited to 'tests/common')
-rw-r--r--tests/common13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/common b/tests/common
new file mode 100644
index 0000000..353b12c
--- /dev/null
+++ b/tests/common
@@ -0,0 +1,13 @@
+
+# Get the size of a file in bytes
+#
+# @1: filename
+function get_filesize()
+{
+ if [[ "$(uname -s)" =~ (Linux|CYGWIN_NT-) ]]; then
+ stat -c%s $1
+ else
+ # OpenBSD
+ stat -f%z $1
+ fi
+}