added shunit support in variables, made shunit provide run time for whole
authorChris Koeritz <fred@gruntose.com>
Thu, 10 May 2012 19:33:33 +0000 (15:33 -0400)
committerChris Koeritz <fred@gruntose.com>
Thu, 10 May 2012 19:33:33 +0000 (15:33 -0400)
test suite, added example script using shunit.

scripts/core/variables.sh
scripts/shunit/example_shunit_test.sh
scripts/shunit/shunit2 [changed mode: 0644->0755]

index 1a9d5b396f5418845033bdaa15820c40da676acb..dd9adc273435461b82ae6f1c638ba0a7492db391 100644 (file)
@@ -173,6 +173,11 @@ if [ -z "$NECHUNG" ]; then
   export PATH="$FEISTY_MEOW_GENERATED:$PATH:/sbin:."
 ###noise! :/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/lib:/usr/games:/usr/bin:.
   
+  ##############
+
+  # set the SHUNIT_DIR so our shunit tests can find the codebase.
+  export SHUNIT_DIR="$FEIST_MEOW_SCRIPTS/shunit"
+  
   ##############
   
   if [ ! -z "$SHELL_DEBUG" ]; then echo variables initialization ends....; fi
index ab3e01c9aab1616e000e0213388e1adf0d5abe3f..f499bf95b5cad4e9f99840b17feac703a2838121 100755 (executable)
@@ -7,7 +7,8 @@
 export WORKDIR="$( \cd "$(\dirname "$0")" && \pwd )"  # obtain the script's working directory.
 cd $WORKDIR
 
-SHUNIT_DIR=/home/fred/xsede/xsede_tests/shunit
+# this variable needs to be set somewhere.  feisty meow scripts will set it.
+#SHUNIT_DIR=/home/fred/shunit
 
 oneTimeSetUp()
 {
old mode 100644 (file)
new mode 100755 (executable)
index a56ed4a..71a3d8c
@@ -862,6 +862,7 @@ _shunit_generateReport()
     _shunit_msg_="${_shunit_msg_})"
   fi
 
+  echo "Suite ran for $(($suite_end - $suite_start)) seconds."
   echo
   echo "$(date): ${_shunit_msg_}"
   __shunit_reportGenerated=${SHUNIT_TRUE}
@@ -1041,6 +1042,9 @@ if [ "${__shunit_mode}" = "${__SHUNIT_MODE_STANDALONE}" ]; then
   . "`_shunit_prepForSourcing \"${__shunit_script}\"`"
 fi
 
+# record when the tests started running.
+suite_start=$(date +%s)
+
 # execute the oneTimeSetUp function (if it exists)
 oneTimeSetUp
 
@@ -1063,6 +1067,8 @@ _shunit_execSuite
 # execute the oneTimeTearDown function (if it exists)
 oneTimeTearDown
 
+suite_end=$(date +%s)
+
 # generate the report
 _shunit_generateReport