Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Here are links to a tool that colorizes the text in the Log window. It's free and the source is in github so you can figure out how it works. The first link says that it just uses simple ANSI codes to do the job.</p> <p><a href="http://deepitpro.com/en/articles/XcodeColors/info" rel="nofollow">http://deepitpro.com/en/articles/XcodeColors/info</a><br> <a href="https://github.com/robbiehanson/XcodeColors#readme" rel="nofollow">https://github.com/robbiehanson/XcodeColors#readme</a></p> <p>To kick off the execution from within Xcode, you will probably need to add a new target to your project. To add a Target, click on your project and then there is an Add Target button on the bottom of the screen. I don't know exactly what you're executing but here are my best guesses based on your question:</p> <ul> <li>MacOSX/Application/Cocoa-AppleScript or Command Line Tool - Create a simple script or program that will execute your units tests.</li> <li>MacOSX/Other/External Build System - Allows for execution of an external "make" program with args.</li> </ul> <p>Once you have a way to execute your unit tests, you just need to figure out how to route the output from the unit tests to the Log window. If you can edit the Google Test project and make it use <code>NSLog()</code>, that would seem to be the easiest solution. You could create your own logging method, perform the ANSI colorization, and then send the final text to <code>NSLog()</code>.</p> <p><strong>ADDED</strong>: OK. Interesting findings... Read all before starting. Here's what to do:</p> <p>Start AppleScript Editor. This is in LaunchPad. Paste the following script into it:</p> <pre><code>tell application "Terminal" activate do script "&lt;your commands&gt;" in window 1 end tell </code></pre> <p>You can repeat the "do script" line as needed. Use this to execute your unit tests. In Script Editor, do Save As.../File Format=Script and save it to a safe location for now like your Documents directory. This will create a file like "UnitTests.scpt".</p> <p>Now go to your iOS project. Select the project at the top-left. Select the Build Phases tab top-middle. Click the Add Build Phase button on the bottom right. Here's the interesting part.</p> <p>Leave Shell as is ("/bin/sh"). Add one line:</p> <pre><code>osascript ~/Documents/UnitTests.scpt </code></pre> <p>That will execute the script after every build.</p> <p>But here's the interesting part I found. Click on Build Settings (top-middle). Make sure All is selected (not Basic). Scroll down the list to find Unit Testing. Open Test Host. Hit the + next to Debug. You can also put the above <code>osascript</code> command here. You might be able to execute your unit tests here and if you can, the output will likely show up in the Log! Let me know what happens.</p>
    singulars
    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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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