diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-05 12:08:03 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-05 12:08:18 +0000 |
commit | 5da14042f70711ea5cf66e034699730335462f66 (patch) | |
tree | 0f6354ccac934ed87a2d555f45be4c831cf92f4a /src/fluent-bit/tests/lib/shunit2/shunit2_standalone_test.sh | |
parent | Releasing debian version 1.44.3-2. (diff) | |
download | netdata-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-x | src/fluent-bit/tests/lib/shunit2/shunit2_standalone_test.sh | 38 |
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 |