bringing in testkit tools
[feisty_meow.git] / testkit / shunit / shunit2_test_standalone.sh
1 #! /bin/sh
2 # $Id: shunit2_test_standalone.sh 303 2010-05-03 13:11:27Z kate.ward@forestent.com $
3 # vim:et:ft=sh:sts=2:sw=2
4 #
5 # Copyright 2010 Kate Ward. All Rights Reserved.
6 # Released under the LGPL (GNU Lesser General Public License)
7 # Author: kate.ward@forestent.com (Kate Ward)
8 #
9 # shUnit2 unit test for standalone operation.
10 #
11 # This unit test is purely to test that calling shunit2 directly, while passing
12 # the name of a unit test script, works. When run, this script determines if it
13 # is running as a standalone program, and calls main() if it is.
14
15 ARGV0=`basename "$0"`
16
17 # load test helpers
18 . ./shunit2_test_helpers
19
20 #------------------------------------------------------------------------------
21 # suite tests
22 #
23
24 testStandalone()
25 {
26   assertTrue ${SHUNIT_TRUE}
27 }
28
29 #------------------------------------------------------------------------------
30 # main
31 #
32
33 main()
34 {
35   ${TH_SHUNIT} "${ARGV0}"
36 }
37
38 # are we running as a standalone?
39 if [ "${ARGV0}" = 'shunit2_test_standalone.sh' ]; then
40   if [ $# -gt 0 ]; then main "$@"; else main; fi
41 fi