|
From: lacton <la...@us...> - 2008-10-31 13:04:00
|
Update of /cvsroot/shunit/ShUnit In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv3394 Modified Files: shUnitPlus Added Files: shUnitPlusAcceptanceTest Log Message: shUnitPlus uses /home/acontal/workspace/ShUnit to find shUnit Index: shUnitPlus =================================================================== RCS file: /cvsroot/shunit/ShUnit/shUnitPlus,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** shUnitPlus 31 Dec 2005 06:26:44 -0000 1.8 --- shUnitPlus 31 Oct 2008 13:03:50 -0000 1.9 *************** *** 6,16 **** ################################################################################ ! inherit() { ! d=`expr "${0}" : '\([a-zA-Z/._-]*\/\)'` ! test `expr "$d" : '[./]'` -eq 0 && d="./$d" ! . ${d}${1} ! } ! ! inherit shUnit shuNonZeroFile() { --- 6,10 ---- ################################################################################ ! . ${SHUNIT_HOME}/shUnit shuNonZeroFile() { --- NEW FILE: shUnitPlusAcceptanceTest --- #! /usr/bin/env sh # # Acceptance tests for ShUnitPlus that should work with all Bourne derived shells. # Any failing test here should be considered a portability defect. # # # Test Cases # Suite() { shuRegTest TestCanRunATestAfterLoadingShUnitPlusOnly } TestCanRunATestAfterLoadingShUnitPlusOnly() { for shell in $available_shells do stdout=`$shell <<-EOF cd fixtures FailingTest() { shuAssert 'Always wrong' 1; } Suite() { shuRegTest FailingTest; } . "$SHUNIT_HOME/shUnitPlus" shuStart Suite EOF` echo "$stdout" | grep -q '1 test failed.' shuAssert "FailingTest should return '1 test failed.'" $? done } # # Support Functions # getAvailableShellsAmong() { known_shells="$1" for shell in $known_shells do if (exec $shell -c exit 2>/dev/null) then echo -n "$shell " fi done } # # Main # available_shells=`getAvailableShellsAmong "sh bash ksh93 pdksh ash dash"` echo "Available shells: $available_shells" >&2 . "$SHUNIT_HOME/shUnit" . "$SHUNIT_HOME/shUnitPlus" shuStart Suite |