projects
/
feisty_meow.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added missing
[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
old mode 100755
(executable)
new mode 100644
(file)
index
c3dc8de
..
17b3dd8
--- a/
scripts/shunit/example_shunit_test.sh
+++ b/
scripts/shunit/example_shunit_test.sh
@@
-3,14
+3,15
@@
# 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.
-#cd $WORKDIR
+export WORKDIR="$( \cd "$(\dirname "$0")" && /bin/pwd )" # obtain the script's working directory.
if [[ ! "$0" =~ ^/.* ]]; then
if [[ ! "$0" =~ ^/.* ]]; then
- # re-run the script with
the absolute path if it didn't start that way; otherwise
+ # 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
# shunit is not happy with finding the script.
exec "$WORKDIR/$(basename $0)" $*
fi
+cd $WORKDIR
oneTimeSetUp()
{
oneTimeSetUp()
{
@@
-19,11
+20,14
@@
oneTimeSetUp()
testOneThing()
{
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
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()
}
oneTimeTearDown()
@@
-32,5
+36,5
@@
oneTimeTearDown()
}
# load and run shUnit2
}
# load and run shUnit2
-source $SHUNIT_
DIR
/shunit2
+source $SHUNIT_
PATH
/shunit2