Note that there are some explanatory texts on larger screens.

plurals
  1. PONo test coverage files generated for Unit Test bundle in Xcode
    primarykey
    data
    text
    <blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="https://stackoverflow.com/questions/1385568/why-doesnt-gcov-report-any-lines-being-covered-by-my-unit-tests">Why doesn&#39;t gcov report any lines being covered by my unit tests?</a> </p> </blockquote> <p><strong>The Problem</strong></p> <p>I've got a Cocoa project on the desktop and I'm using Xcode 3.2.1 on Snow Leopard 10.6.2.</p> <p>I want to generate code coverage files for my Unit Test Target in Xcode.</p> <p><strong>What I've Tried</strong></p> <p>As articles like <a href="http://www.supermegaultragroovy.com/blog/2005/11/03/unit-testing-and-code-coverage-with-xcode/" rel="nofollow noreferrer">this one</a> suggest, I've adjusted the build settings to:</p> <p>“Generate Test Coverage Files” checked “Instrument Program Flow” checked “-lgcov” added to “Other Linker Flags”</p> <p>I've also set the Run Script section of the test target to have the following:</p> <pre><code># Run the unit tests in this test bundle. "${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests" # Run gcov on the framework getting tested if [ "${CONFIGURATION}" = 'Coverage' ]; then FRAMEWORK_NAME=LapsusInterpretationEngine FRAMEWORK_OBJ_DIR=${OBJROOT}/${FRAMEWORK_NAME}.build/${CONFIGURATION}/EngineTests.build/Objects-normal/${NATIVE_ARCH} mkdir -p coverage pushd coverage find ${OBJROOT} -name *.gcda -exec gcov -o ${FRAMEWORK_OBJ_DIR} {} \; popd fi </code></pre> <p>Since my Framework name is LapsusInterpretationEngine but my target is named EngineTests, I put this directly into the FRAMEWORK_OBJ_DIR but this didn't seem to help.</p> <p>I've tried cleaning before building. I've made sure all the above build settings apply to both the Unit Test Target and the Application Target.</p> <p><strong>What I Get</strong></p> <p>No .gcda or .gcno files anywhere in the build directory I'm using.</p> <p>I point CoverStory to the Objects-normal directory in my builds folder and it complains that there's nothing there for it to read.</p> <p>I must be doing something really obvious wrong. Anyone any ideas?</p> <p>I have tried the "EngineTests.build" directory being ${FRAMEWORK_NAME} and this gives the same results.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload