Implementing Unit Testing with iOS

后端 未结 9 1023
轮回少年
轮回少年 2020-12-04 10:40

I\'ve followed this tutorial to setup unit testing on my app when I got a little stuck.

At bullet point 8 in that tutorial it shows this image, which is what I shou

相关标签:
9条回答
  • 2020-12-04 11:14

    That is the expected behavior. The build will fail if one of the tests fail and the build will succeed if all the tests pass.

    0 讨论(0)
  • 2020-12-04 11:16

    Double click 'Run script' under 'Targets'/'Your script target name' then type

    # Run the unit tests in this test bundle. 
    "${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests" 1> /tmp/RunUnitTests.out
    

    Basically you need to append

    1> /tmp/RunUnitTests.out
    

    to what is already there

    0 讨论(0)
  • 2020-12-04 11:16

    try to check this issue SenTestCase in Xcode 3.2 and XCBuildLogCommandInvocationSection Errors

    the workaround in that question work for me.

    0 讨论(0)
  • 2020-12-04 11:16

    I don't know it a right way or not, but it's work for me.

    In General Tab of info Test Case, I add my main application executable target as a direct dependency.

    And no error for ‘i386′ (GC OFF)”.

    Good luck.

    0 讨论(0)
  • 2020-12-04 11:20

    Menu: Project --> New Build Phase --> New RunScript Build Phase --> Paste the following into the empty text area:

    "${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests" 1> /tmp/RunUnitTests.out

    Now try to build and you should get an error on failed unit tests.

    0 讨论(0)
  • 2020-12-04 11:32

    Have you tried to set the build configuration to "Debug" for the test case ?

    i did that, as shown at http://nothing2fancy.com/2009/08/04/failed-tests-for-architecture-i386-gc-off/ and it worked

    0 讨论(0)
提交回复
热议问题