projects
/
feisty_meow.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
updated for new paths also, which revealed a few locations that are
[feisty_meow.git]
/
scripts
/
shunit
/
example_shunit_test.sh
diff --git
a/scripts/shunit/example_shunit_test.sh
b/scripts/shunit/example_shunit_test.sh
index f499bf95b5cad4e9f99840b17feac703a2838121..9d389bee41a93d6a5b013cd6a951e6ebfb4a4c0b 100755
(executable)
--- a/
scripts/shunit/example_shunit_test.sh
+++ b/
scripts/shunit/example_shunit_test.sh
@@
-3,29
+3,36
@@
# An example of using shunit2.
#
# Author: Chris Koeritz
# An example of using shunit2.
#
# Author: Chris Koeritz
+# license gnu gpl v3
export WORKDIR="$( \cd "$(\dirname "$0")" && \pwd )" # obtain the script's working directory.
export WORKDIR="$( \cd "$(\dirname "$0")" && \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
cd $WORKDIR
-# this variable needs to be set somewhere. feisty meow scripts will set it.
-#SHUNIT_DIR=/home/fred/shunit
-
oneTimeSetUp()
{
oneTimeSetUp()
{
- echo
into set up.
+ echo
"into oneTimeSetUp."
}
testOneThing()
{
}
testOneThing()
{
- echo
got to test case.
+ echo
"got to primary test case."
zero=0
assertEquals "zero should be equal to 0" 0 $zero
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()
{
}
oneTimeTearDown()
{
- echo
into tear down.
+ echo
"into oneTimeTearDown."
}
# load and run shUnit2
}
# load and run shUnit2