Encore PTL
Encore PTL

Reputation: 8214

xcodebuild test not running XCTestCase unit test file

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

Upvotes: 2

Views: 11296

Answers (1)

Terry Rice
Terry Rice

Reputation: 494

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.

Upvotes: 6

Related Questions