diff options
author | Michael Allen <michael@michaelallen.io> | 2015-02-11 23:39:19 +0000 |
---|---|---|
committer | Michael Allen <michael@michaelallen.io> | 2015-02-11 23:39:19 +0000 |
commit | 89fa3a5f520297bd353cd9720cc6d0d0e96a075a (patch) | |
tree | f135adf522dbd99bba868ba9f4da9803c8242298 /shunit/shunit2_test_standalone.sh | |
parent | db4d3a9c42b788561bfd15d32a841cd1e8fd5a5f (diff) | |
download | git-sonar-89fa3a5f520297bd353cd9720cc6d0d0e96a075a.tar.gz git-sonar-89fa3a5f520297bd353cd9720cc6d0d0e96a075a.zip |
turning some tests into proper shunit tests and found a few bugs
Diffstat (limited to 'shunit/shunit2_test_standalone.sh')
-rwxr-xr-x | shunit/shunit2_test_standalone.sh | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/shunit/shunit2_test_standalone.sh b/shunit/shunit2_test_standalone.sh new file mode 100755 index 0000000..6df64b3 --- /dev/null +++ b/shunit/shunit2_test_standalone.sh @@ -0,0 +1,41 @@ +#! /bin/sh +# $Id: shunit2_test_standalone.sh 303 2010-05-03 13:11:27Z kate.ward@forestent.com $ +# vim:et:ft=sh:sts=2:sw=2 +# +# Copyright 2010 Kate Ward. All Rights Reserved. +# Released under the LGPL (GNU Lesser General Public License) +# Author: kate.ward@forestent.com (Kate Ward) +# +# shUnit2 unit test for standalone operation. +# +# 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. + +ARGV0=`basename "$0"` + +# load test helpers +. ./shunit2_test_helpers + +#------------------------------------------------------------------------------ +# suite tests +# + +testStandalone() +{ + assertTrue ${SHUNIT_TRUE} +} + +#------------------------------------------------------------------------------ +# main +# + +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 |