summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/zstd/tests/cli-tests/common/platform.sh
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/zstd/tests/cli-tests/common/platform.sh')
-rw-r--r--3rdparty/zstd/tests/cli-tests/common/platform.sh37
1 files changed, 37 insertions, 0 deletions
diff --git a/3rdparty/zstd/tests/cli-tests/common/platform.sh b/3rdparty/zstd/tests/cli-tests/common/platform.sh
new file mode 100644
index 00000000000..6eb45eab99e
--- /dev/null
+++ b/3rdparty/zstd/tests/cli-tests/common/platform.sh
@@ -0,0 +1,37 @@
+#!/bin/sh
+
+UNAME=$(uname)
+
+isWindows=false
+INTOVOID="/dev/null"
+case "$UNAME" in
+ GNU) DEVDEVICE="/dev/random" ;;
+ *) DEVDEVICE="/dev/zero" ;;
+esac
+case "$OS" in
+ Windows*)
+ isWindows=true
+ INTOVOID="NUL"
+ DEVDEVICE="NUL"
+ ;;
+esac
+
+case "$UNAME" in
+ Darwin) MD5SUM="md5 -r" ;;
+ FreeBSD) MD5SUM="gmd5sum" ;;
+ NetBSD) MD5SUM="md5 -n" ;;
+ OpenBSD) MD5SUM="md5" ;;
+ *) MD5SUM="md5sum" ;;
+esac
+
+DIFF="diff"
+case "$UNAME" in
+ SunOS) DIFF="gdiff" ;;
+esac
+
+if echo hello | zstd -v -T2 2>&1 > $INTOVOID | grep -q 'multi-threading is disabled'
+then
+ hasMT=""
+else
+ hasMT="true"
+fi