2
0
mirror of https://github.com/deajan/osync synced 2024-11-19 03:25:37 +00:00
osync/dev/tests/shunit2/shunit2_standalone_test.sh

37 lines
887 B
Bash
Raw Normal View History

2016-08-22 08:26:38 +00:00
#! /bin/sh
# vim:et:ft=sh:sts=2:sw=2
#
# shUnit2 unit test for standalone operation.
#
2022-07-07 14:22:35 +00:00
# Copyright 2008-2021 Kate Ward. All Rights Reserved.
2018-07-02 21:25:49 +00:00
# Released under the Apache 2.0 license.
2022-07-07 14:22:35 +00:00
# http://www.apache.org/licenses/LICENSE-2.0
2018-07-02 21:25:49 +00:00
#
# Author: kate.ward@forestent.com (Kate Ward)
# https://github.com/kward/shunit2
#
2016-08-22 08:26:38 +00:00
# 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.
2018-07-02 21:25:49 +00:00
#
# Disable source following.
# shellcheck disable=SC1090,SC1091
2016-08-22 08:26:38 +00:00
2022-07-07 14:22:35 +00:00
ARGV0=$(basename "$0")
2016-08-22 08:26:38 +00:00
2018-07-02 21:25:49 +00:00
# Load test helpers.
2016-08-22 08:26:38 +00:00
. ./shunit2_test_helpers
2018-07-02 21:25:49 +00:00
testStandalone() {
assertTrue "${SHUNIT_TRUE}"
2016-08-22 08:26:38 +00:00
}
2018-07-02 21:25:49 +00:00
main() {
2016-08-22 08:26:38 +00:00
${TH_SHUNIT} "${ARGV0}"
}
2022-07-07 14:22:35 +00:00
# Run main() if are running as a standalone script.
if [ "${ARGV0}" = 'shunit2_standalone_test.sh' ]; then
main "$@"
2016-08-22 08:26:38 +00:00
fi