X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=scripts%2Fshunit%2Fexample_shunit_test.sh;h=17b3dd89509b1b45424654a679748e7aa58abc10;hb=5c0de3a39b1c7e2d127c1441e97e9134a84e5dd8;hp=ab3e01c9aab1616e000e0213388e1adf0d5abe3f;hpb=e25ac6e59711fa21200845327cafe07a1b4a4f25;p=feisty_meow.git diff --git a/scripts/shunit/example_shunit_test.sh b/scripts/shunit/example_shunit_test.sh old mode 100755 new mode 100644 index ab3e01c9..17b3dd89 --- a/scripts/shunit/example_shunit_test.sh +++ b/scripts/shunit/example_shunit_test.sh @@ -3,30 +3,38 @@ # An example of using shunit2. # # Author: Chris Koeritz - -export WORKDIR="$( \cd "$(\dirname "$0")" && \pwd )" # obtain the script's working directory. +# license gnu gpl v3 + +export WORKDIR="$( \cd "$(\dirname "$0")" && /bin/pwd )" # obtain the script's working directory. +if [[ ! "$0" =~ ^/.* ]]; then + # re-run the script with an absolute path if it didn't start out that way; otherwise, + # shunit is not happy with finding the script. + exec "$WORKDIR/$(basename $0)" $* +fi cd $WORKDIR -SHUNIT_DIR=/home/fred/xsede/xsede_tests/shunit - oneTimeSetUp() { - echo into set up. + echo "into oneTimeSetUp." } testOneThing() { - echo got to test case. + echo "got to primary test case." zero=0 assertEquals "zero should be equal to 0" 0 $zero - sleep 23 + echo "passed tautological test." + sleep_time=83 + echo "$(date): now sleeping for $sleep_time seconds." + sleep $sleep_time + echo "$(date): woke up." } oneTimeTearDown() { - echo into tear down. + echo "into oneTimeTearDown." } # load and run shUnit2 -source $SHUNIT_DIR/shunit2 +source $SHUNIT_PATH/shunit2