X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=scripts%2Fshunit%2Fexample_shunit_test.sh;h=8931aef130e2e904ef09bc3cf977ca511f849ac6;hb=8c349a38d121683c7ca2eccd3ba57e41ddcf299d;hp=4b3482adf9b435855a71db60c3ab640937ab8d35;hpb=a68c5c231bc1000ba0b569d3de90dfc849c147ee;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 4b3482ad..8931aef1 --- a/scripts/shunit/example_shunit_test.sh +++ b/scripts/shunit/example_shunit_test.sh @@ -5,13 +5,13 @@ # Author: Chris Koeritz # license gnu gpl v3 -export WORKDIR="$( \cd "$(\dirname "$0")" && \pwd )" # obtain the script's working directory. +export THISDIR="$( \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)" $* + exec "$THISDIR/$(basename $0)" $* fi -cd $WORKDIR +cd $THISDIR oneTimeSetUp() { @@ -20,11 +20,14 @@ oneTimeSetUp() testOneThing() { - echo "got to test case. sleeping for a bit..." + echo "got to primary test case." zero=0 assertEquals "zero should be equal to 0" 0 $zero - sleep 23 - echo "woke up. passed tautological test." + echo "passed tautological test." + sleep_time=83 + echo "$(date): now sleeping for $sleep_time seconds." + sleep $sleep_time + echo "$(date): woke up." } oneTimeTearDown() @@ -33,5 +36,5 @@ oneTimeTearDown() } # load and run shUnit2 -source $SHUNIT_DIR/shunit2 +source $SHUNIT_PATH/shunit2