From: lacton <la...@us...> - 2008-03-24 15:48:20
|
Update of /cvsroot/shunit/ShUnit In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv11223 Modified Files: shUnitTest Log Message: [refactor] Indentation and coding consistency. Index: shUnitTest =================================================================== RCS file: /cvsroot/shunit/ShUnit/shUnitTest,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** shUnitTest 24 Mar 2008 12:56:27 -0000 1.22 --- shUnitTest 24 Mar 2008 15:48:09 -0000 1.23 *************** *** 6,14 **** # # find the shUnit file using the command as a reference # inherit() { d=`expr ${0} : '\([a-zA-Z/._-]*\/\)'` ! test `expr "$d" : '[./]'` -eq 0 && d="./$d" . ${d}${1} } --- 6,18 ---- # + # Unit tests for ShUnit that should work with all Bourne derived shells. + # + + # # find the shUnit file using the command as a reference # inherit() { d=`expr ${0} : '\([a-zA-Z/._-]*\/\)'` ! [ `expr "$d" : '[./]'` -eq 0 ] && d="./$d" . ${d}${1} } *************** *** 19,22 **** --- 23,27 ---- : } + TestShuRegTest() { orig="${SHU_STR_ALL_TESTS}" *************** *** 31,34 **** --- 36,40 ---- SHU_STR_ALL_TESTS=${orig} } + TestShuRunOneTest() { orig_total_nr_run="${shuTestNbr}" *************** *** 60,64 **** TestSetupCalledCorrectly() { ! test -f ./test.$$ shuAssert "test file not created: " $? } --- 66,70 ---- TestSetupCalledCorrectly() { ! [ -f ./test.$$ ] shuAssert "test file not created: " $? } *************** *** 88,96 **** TestIntentionalFailure() { shuAssert "This test failed intentionally" ${SHU_FALSE} ! test ${SHU_TEST_SUCCEEDED} -eq ${SHU_FALSE} shuAssert "Failed test didn't set SHU_TEST_SUCCEEDED to false" $? shuAssert "This is another test that failed intentionally" ${SHU_FALSE} ! test ${SHU_TEST_SUCCEEDED} -eq ${SHU_FALSE} shuAssert "Failed test didn't set SHU_TEST_SUCCEEDED to false" $? --- 94,102 ---- TestIntentionalFailure() { shuAssert "This test failed intentionally" ${SHU_FALSE} ! [ ${SHU_TEST_SUCCEEDED} -eq ${SHU_FALSE} ] shuAssert "Failed test didn't set SHU_TEST_SUCCEEDED to false" $? shuAssert "This is another test that failed intentionally" ${SHU_FALSE} ! [ ${SHU_TEST_SUCCEEDED} -eq ${SHU_FALSE} ] shuAssert "Failed test didn't set SHU_TEST_SUCCEEDED to false" $? *************** *** 132,136 **** shuAssert "This test succeeded intentionally" ${SHU_TRUE} ! if test ${SHU_TEST_SUCCEEDED} -eq ${SHU_FALSE} then SHU_TEST_SUCCEEDED=${SHU_TRUE} --- 138,142 ---- shuAssert "This test succeeded intentionally" ${SHU_TRUE} ! if [ ${SHU_TEST_SUCCEEDED} -eq ${SHU_FALSE} ] then SHU_TEST_SUCCEEDED=${SHU_TRUE} *************** *** 145,149 **** shuDeny "This test succeeded intentionally" ${SHU_FALSE} ! if test ${SHU_TEST_SUCCEEDED} -eq ${SHU_FALSE} then SHU_TEST_SUCCEEDED=${SHU_TRUE} --- 151,155 ---- shuDeny "This test succeeded intentionally" ${SHU_FALSE} ! if [ ${SHU_TEST_SUCCEEDED} -eq ${SHU_FALSE} ] then SHU_TEST_SUCCEEDED=${SHU_TRUE} *************** *** 154,158 **** } ! InitFunction() { shuRegTest TestIntentionalFailure shuRegTest TestShuRegisterFailedTest --- 160,164 ---- } ! Suite() { shuRegTest TestIntentionalFailure shuRegTest TestShuRegisterFailedTest *************** *** 170,172 **** ### Main ! shuStart InitFunction --- 176,178 ---- ### Main ! shuStart Suite |