Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to setup environment variables for gcov on iPhone
    primarykey
    data
    text
    <p>I have overcome all problems with setting up <code>gcov</code> on my iPhone project but now I am getting the following:</p> <pre><code>profiling:/Users:Cannot create directory </code></pre> <p>Does anyone have any suggestions as to what I might be doing wrong?</p> <p>I originally setup gcov following Google's instructions which can be found by Googling "UsingCoverStory"</p> <p>UPDATE: Okay, so let me clarify what I am trying to do. I have an iPhone app that I trying to test automatically. I am using the <code>UISpec</code> framework to drive the GUI. What I really what to know is how much code I am actually covering with my tests. I think that I am really close but I just need to understand how to properly set the environment/compiler variables to fit my project.</p> <p>Here is a summary of what I have done so far. I first copied my build target, specified the linker flag and a couple of other options as prescribed. (This can be done automatically using an AppleScript created by Google. Instructions and download can be found by Googling "UsingCoverStory") Anyway, I have verified that these settings are being assigned correctly. I set my config to Debug and I am running this on a 3.1.3 Device. When I run the app, it doesn't show anything special in the debugger until I exit the app. At that point I get an error:</p> <pre><code>profiling:/Users:Cannot create directory profiling:/Users/forbushbl/Documents/TestApp/build/TestApp.build/Debug-iphoneos/TestApp copy.build/Objects-normal/armv6/ApplicationController.gcda:Skip </code></pre> <p>I assume that <code>GCOV</code> is trying to write out the <code>.gcda</code> files but I'm not quite sure how to tell it where they should be written. I read somewhere that that <code>GCOV</code> tries to reproduce the directory structure where the <code>.gcno</code> files are stored in my project folder which would make sense as the directory above is where the <code>.gcno</code> files are located on my machine. However this is a problem because that structure doesn't exist on the iPhone nor can the device create that structure. </p> <p>I found another person with the same problem and they said that they had to set an environment variable. <a href="https://stackoverflow.com/questions/1945229/how-to-set-up-gcov-for-code-coverage-analysis-in-iphone-sdk">How to set up gcov for code coverage analysis in iPhone SDK?</a></p> <p>The <code>GCOV</code> documentation says the following: </p> <blockquote> <p>For example, if the object file <code>/user/build/foo.o</code> was built with <code>-fprofile-arcs</code>, the final executable will try to create the data file <code>/user/build/foo.gcda</code> when running on the target system. This will fail if the corresponding directory does not exist and it is unable to create it. This can be overcome by, for example, setting the environment as `GCOV_PREFIX=/target/run' and `GCOV_PREFIX_STRIP=1'. Such a setting will name the data file <code>/target/run/build/foo.gcda</code>.</p> </blockquote> <p>My question is, how do I set these environment variable on the iPhone? Should I be doing this in my build configuration or within the actual code?</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.
 

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