X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=scripts%2Fshunit%2Fexample_shunit_test.sh;fp=scripts%2Fshunit%2Fexample_shunit_test.sh;h=c3dc8de5cb6abd72f9883b6becd840e1f42ed30f;hb=af5f3c3dd22ed040f42a38265b6b5c8cba094b96;hp=f499bf95b5cad4e9f99840b17feac703a2838121;hpb=499a5c0aaa492d73afe975409476e7ccdec316f4;p=feisty_meow.git diff --git a/scripts/shunit/example_shunit_test.sh b/scripts/shunit/example_shunit_test.sh index f499bf95..c3dc8de5 100755 --- a/scripts/shunit/example_shunit_test.sh +++ b/scripts/shunit/example_shunit_test.sh @@ -5,27 +5,30 @@ # Author: Chris Koeritz export WORKDIR="$( \cd "$(\dirname "$0")" && \pwd )" # obtain the script's working directory. -cd $WORKDIR - -# this variable needs to be set somewhere. feisty meow scripts will set it. -#SHUNIT_DIR=/home/fred/shunit +#cd $WORKDIR +if [[ ! "$0" =~ ^/.* ]]; then + # re-run the script with the absolute path if it didn't start that way; otherwise + # shunit is not happy with finding the script. + exec "$WORKDIR/$(basename $0)" $* +fi oneTimeSetUp() { - echo into set up. + echo "into oneTimeSetUp." } testOneThing() { - echo got to test case. + echo "got to test case. sleeping for a bit..." zero=0 assertEquals "zero should be equal to 0" 0 $zero sleep 23 + echo "woke up. passed tautological test." } oneTimeTearDown() { - echo into tear down. + echo "into oneTimeTearDown." } # load and run shUnit2