aboutsummaryrefslogtreecommitdiff
path: root/test/test-lib-FREEBSD.sh
diff options
context:
space:
mode:
authorMikhail <mp39590@gmail.com>2017-03-09 09:32:43 -0400
committerDavid Bremner <david@tethera.net>2017-03-25 07:56:52 -0300
commit9b7dbed58ebd3aeee16b044fdffda6b39e90643e (patch)
tree25f919a885e83e43954ef085ececbd849463f447 /test/test-lib-FREEBSD.sh
parente1ddd27968673e6785300e739f5257b83841fb97 (diff)
tests: add compatibility layer
Make test-lib-common.sh load test-lib-<$PLATFORM>.sh to create additional shim for platform specifics. Use test-lib-FREEBSD.sh to call GNU utilities instead of native ones. - amended by db following Tomi's suggestions
Diffstat (limited to 'test/test-lib-FREEBSD.sh')
-rw-r--r--test/test-lib-FREEBSD.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/test-lib-FREEBSD.sh b/test/test-lib-FREEBSD.sh
new file mode 100644
index 00000000..d1840b56
--- /dev/null
+++ b/test/test-lib-FREEBSD.sh
@@ -0,0 +1,9 @@
+# If present, use GNU Coreutils instead of a native BSD utils
+if command -v gdate >/dev/null
+ then
+ date () { gdate "$@"; }
+ base64 () { gbase64 "$@"; }
+ wc () { gwc "$@"; }
+ sed () { gsed "$@"; }
+ sha256sum () { gsha256sum "$@"; }
+ fi