summaryrefslogtreecommitdiffstats
path: root/src/fluent-bit/tests/lib/shunit2/shunit2_standalone_test.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-05 12:08:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-05 12:08:18 +0000
commit5da14042f70711ea5cf66e034699730335462f66 (patch)
tree0f6354ccac934ed87a2d555f45be4c831cf92f4a /src/fluent-bit/tests/lib/shunit2/shunit2_standalone_test.sh
parentReleasing debian version 1.44.3-2. (diff)
downloadnetdata-5da14042f70711ea5cf66e034699730335462f66.tar.xz
netdata-5da14042f70711ea5cf66e034699730335462f66.zip
Merging upstream version 1.45.3+dfsg.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/fluent-bit/tests/lib/shunit2/shunit2_standalone_test.sh')
-rwxr-xr-xsrc/fluent-bit/tests/lib/shunit2/shunit2_standalone_test.sh38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/fluent-bit/tests/lib/shunit2/shunit2_standalone_test.sh b/src/fluent-bit/tests/lib/shunit2/shunit2_standalone_test.sh
new file mode 100755
index 000000000..2109d8f7f
--- /dev/null
+++ b/src/fluent-bit/tests/lib/shunit2/shunit2_standalone_test.sh
@@ -0,0 +1,38 @@
+#! /bin/sh
+# vim:et:ft=sh:sts=2:sw=2
+#
+# shUnit2 unit test for standalone operation.
+#
+# Copyright 2010-2017 Kate Ward. All Rights Reserved.
+# Released under the Apache 2.0 license.
+#
+# Author: kate.ward@forestent.com (Kate Ward)
+# https://github.com/kward/shunit2
+#
+# This unit test is purely to test that calling shunit2 directly, while passing
+# the name of a unit test script, works. When run, this script determines if it
+# is running as a standalone program, and calls main() if it is.
+#
+### ShellCheck http://www.shellcheck.net/
+# $() are not fully portable (POSIX != portable).
+# shellcheck disable=SC2006
+# Disable source following.
+# shellcheck disable=SC1090,SC1091
+
+ARGV0="`basename "$0"`"
+
+# Load test helpers.
+. ./shunit2_test_helpers
+
+testStandalone() {
+ assertTrue "${SHUNIT_TRUE}"
+}
+
+main() {
+ ${TH_SHUNIT} "${ARGV0}"
+}
+
+# Are we running as a standalone?
+if [ "${ARGV0}" = 'shunit2_test_standalone.sh' ]; then
+ if [ $# -gt 0 ]; then main "$@"; else main; fi
+fi