added cd back in, since many times the test script wants to access local files, etc.
[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 test case.  sleeping for a bit..."
23   zero=0
24   assertEquals "zero should be equal to 0" 0 $zero
25   sleep 23
26   echo "woke up.  passed tautological test."
27 }
28
29 oneTimeTearDown()
30 {
31   echo "into oneTimeTearDown."
32 }
33
34 # load and run shUnit2
35 source $SHUNIT_DIR/shunit2
36