I am new to testing in Xcode. I am following the developer documentation "iOS Developement Guide" Unit Testing Applications.
I have successfully added unit test bundles to my application with one failing test.
When I build the test target the output shows 1 error as expected but the editor does not show the expected error message under the failed test.
Apples docs say: "If the unit-test bundle is configured correctly, the build fails and Xcode displays an error message in the text editor."
The error message is available however deeply nested in the build output window.
under the error noticed a second error. The message "Command /bin/sh failed with exit code 1"
When the test is made to pass BOTH errors go away.
The last lines of the error seem to indicate that the tests completed.
Thank you for any help on this.
PhaseScriptExecution "Run Script" build/Calculator.build/Debug-iphonesimulator/UnitTests.build/Script-63E8378111F77BBF00DAA704.sh
cd /Users/david/Desktop/Calculator
setenv ACTION build
setenv ALTERNATE_GROUP staff
--- CUT FOR BREVITY ---
setenv XCODE_VERSION_MINOR 0320
setenv YACC /Developer/usr/bin/yacc
/bin/sh -c /Users/david/Desktop/Calculator/build/Calculator.build/Debug-iphonesimulator/UnitTests.build/Script-63E8378111F77BBF00DAA704.sh
/Developer/Tools/RunPlatformUnitTests.include:412: note: Started tests for architectures 'i386'
/Developer/Tools/RunPlatformUnitTests.include:419: note: Running tests for architecture 'i386' (GC OFF)
Test Suite '/Users/david/Desktop/Calculator/build/Debug-iphonesimulator/UnitTests.octest(Tests)' started at 2010-07-21 16:38:25 -0700
Test Suite 'CalculatorTest' started at 2010-07-21 16:38:25 -0700
Test Case '-[CalculatorTest testAdd]' started.
Test Case '-[CalculatorTest testAdd]' passed (0.000 seconds).
Test Case '-[CalculatorTest testDivide]' started.
/Users/david/Desktop/Calculator/CalculatorTest.m:31: error: -[CalculatorTest testDivide] : '2' should be equal to '1': We expected 2, but we got 1
Test Case '-[CalculatorTest testDivide]' failed (0.000 seconds).
Test Case '-[CalculatorTest testMath]' started.
Test Case '-[CalculatorTest testMath]' passed (0.000 seconds).
Test Suite 'CalculatorTest' finished at 2010-07-21 16:38:25 -0700.
Executed 3 tests, with 1 failure (0 unexpected) in 0.000 (0.001) seconds
Test Suite '/Users/david/Desktop/Calculator/build/Debug-iphonesimulator/UnitTests.octest(Tests)' finished at 2010-07-21 16:38:25 -0700.
Executed 3 tests, with 1 failure (0 unexpected) in 0.000 (0.002) seconds
/Developer/Tools/RunPlatformUnitTests.include:448: error: Failed tests for architecture 'i386' (GC OFF)
/Developer/Tools/RunPlatformUnitTests.include:462: note: Completed tests for architectures 'i386'
Command /bin/sh failed with exit code 1