xcodebuild test not running XCTestCase unit test file

10,726

I had this same problem when building my project from the command line. The problem is likely that the command line tools are configured to use a version prior to Xcode 6. This was the case with my configuration.

In my case I ran

xcodebuild -version

and it returned the following:

Xcode 5.1.1 Build version 5B1008

So then I went to Xcode Preferences as show below and picked the version 6 command line tools and the problem went away.

enter image description here

After that you can confirm the command line tools version by using

xcodebuild -version

and you should get back

Xcode 6.0 Build version 6A267n

or a similar value depending on which beta you currently have installed.

Share:
10,726
Encore PTL
Author by

Encore PTL

Ankur Patel is an experienced web and mobile application developer specializing in iOS with a passion for making cool and innovative consumer apps. Ankur is a generalist who has worked with a variety of programming languages like C, C++, Java, Objective-C, C#, Ruby and Javascript. He has held multiple roles in big firms like IBM, Oracle and Goldman Sachs and has been successful at all of them due to his drive to learn and to push technology to its limit. Creator of http://www.dollarswift.org Owner of https://www.encoredevlabs.com

Updated on June 14, 2022

Comments

  • Encore PTL
    Encore PTL almost 2 years

    Not able to run the unit test file using xcodebuild test -scheme DollarTests -project Dollar.xcodeproj -configuration Debug -sdk macosx

    Below is the output of the command

    xcodebuild test -scheme DollarTests -project Dollar.xcodeproj -configuration Debug -sdk macosx
    Build settings from command line:
        SDKROOT = macosx10.9
    
    2014-06-14 16:43:29.537 xcodebuild[3504:92734] stream error: stream error at offset 29: created by an unsupported XCDependencyGraph build
    2014-06-14 16:43:29.540 xcodebuild[3504:92735] stream error: stream error at offset 29: created by an unsupported XCDependencyGraph build
    === BUILD TARGET Dollar OF PROJECT Dollar WITH CONFIGURATION Debug ===
    
    Check dependencies
    warning: no rule to process file '/Users/ankur/Personal/Dollar/Dollar/Dollar.swift' of type text for architecture x86_64
    OS X deployment target '10.10' for architecture 'x86_64' and variant 'normal' is greater than the maximum value '10.9' for the OS X 10.9 SDK.
    
    === BUILD TARGET DollarTests OF PROJECT Dollar WITH CONFIGURATION Debug ===
    
    Check dependencies
    warning: no rule to process file '/Users/ankur/Personal/Dollar/DollarTests/DollarTests.swift' of type text for architecture x86_64
    warning: no rule to process file '/Users/ankur/Personal/Dollar/DollarTests/CarExample.swift' of type text for architecture x86_64
    OS X deployment target '10.10' for architecture 'x86_64' and variant 'normal' is greater than the maximum value '10.9' for the OS X 10.9 SDK.
    
    Test Suite 'All tests' started at 2014-06-14 20:43:30 +0000
    Test Suite 'All tests' finished at 2014-06-14 20:43:30 +0000.
    Executed 0 tests, with 0 failures (0 unexpected) in 0.000 (0.001) seconds
    ** TEST SUCCEEDED **
    

    For some reason it is not able to pick up the XCTestCase files and I get the following warning

    warning: no rule to process file '/Users/ankur/Personal/Dollar/DollarTests/DollarTests.swift' of type text for architecture x86_64
    warning: no rule to process file '/Users/ankur/Personal/Dollar/DollarTests/CarExample.swift' of type text for architecture x86_64
    

    The test files are in Swift, so it that the issue and how can I resolve it to include these and run these file when running test.

    Attaching screenshots of the configuration and files I have in the project

    enter image description here

    enter image description here

  • Terry Rice
    Terry Rice about 9 years
    You may also want to try xcode-select. It allows you to switch the directories for developer tools. See: developer.apple.com/library/mac/documentation/Darwin/Referen‌​ce/…