added hours and minutes version of run time.
[feisty_meow.git] / scripts / shunit / example_shunit_test.sh
1 #!/bin/bash
2
3 # An example of using shunit2.
4 #
5 # Author: Chris Koeritz
6
7 export WORKDIR="$( \cd "$(\dirname "$0")" && \pwd )"  # obtain the script's working directory.
8 if [[ ! "$0" =~ ^/.* ]]; then
9   # re-run the script with an absolute path if it didn't start out that way; otherwise,
10   # shunit is not happy with finding the script.
11   exec "$WORKDIR/$(basename $0)" $*
12 fi
13 cd $WORKDIR
14
15 oneTimeSetUp()
16 {
17   echo "into oneTimeSetUp."
18 }
19
20 testOneThing()
21 {
22   echo "got to primary test case."
23   zero=0
24   assertEquals "zero should be equal to 0" 0 $zero
25   echo "passed tautological test."
26   sleep_time=83
27   echo "$(date): now sleeping for $sleep_time seconds."
28   sleep $sleep_time
29   echo "$(date): woke up."
30 }
31
32 oneTimeTearDown()
33 {
34   echo "into oneTimeTearDown."
35 }
36
37 # load and run shUnit2
38 source $SHUNIT_DIR/shunit2
39