added licensing on example file.
[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 # license gnu gpl v3
7
8 export WORKDIR="$( \cd "$(\dirname "$0")" && \pwd )"  # obtain the script's working directory.
9 if [[ ! "$0" =~ ^/.* ]]; then
10   # re-run the script with an absolute path if it didn't start out that way; otherwise,
11   # shunit is not happy with finding the script.
12   exec "$WORKDIR/$(basename $0)" $*
13 fi
14 cd $WORKDIR
15
16 oneTimeSetUp()
17 {
18   echo "into oneTimeSetUp."
19 }
20
21 testOneThing()
22 {
23   echo "got to test case.  sleeping for a bit..."
24   zero=0
25   assertEquals "zero should be equal to 0" 0 $zero
26   sleep 23
27   echo "woke up.  passed tautological test."
28 }
29
30 oneTimeTearDown()
31 {
32   echo "into oneTimeTearDown."
33 }
34
35 # load and run shUnit2
36 source $SHUNIT_DIR/shunit2
37