realm / SwiftCov

A tool to generate test code coverage information for Swift.
MIT License
561 stars 41 forks source link

Set ONLY_ACTIVE_ARCH to NO because that settings is default YES on De… #12

Closed kishikawakatsumi closed 9 years ago

kishikawakatsumi commented 9 years ago

…bug configuration

jpsim commented 9 years ago

What's wrong with having ONLY_ACTIVE_ARCH=NO? Wouldn't that be preferable when just running tests?

kishikawakatsumi commented 9 years ago

Though I do not know the cause yet when running in debug configuration (ONLY_ACTIVE_ARCH=YES), SwiftCov failed due to architecture is different.

You can reproduce to run for the ExampleFramework project in debug configuration, like below:

$ cd Examples/ExampleFramework/
$ swiftcov generate --output coverage \
  xcodebuild -project ExampleFramework.xcodeproj \
  -scheme ExampleFramework \
  -sdk iphonesimulator \
  -configuration Debug \
  test

And error message is:

The test bundle at /Users/katsumi/Library/Developer/Xcode/DerivedData/ExampleFramework-dejukqythshlljcaaxfukutqvvjv/Build/Products/Debug-iphonesimulator/ExampleFrameworkTests.xctest could not be loaded because it is built for a different architecture than the currently-running test rig (which is running as x86_64).
2015-05-29 09:45:15.318 xctest[57866:1312877] Detailed error information: Error Domain=NSCocoaErrorDomain Code=3585 "The bundle “ExampleFrameworkTests” couldn’t be loaded because it doesn’t contain a version for the current architecture." (dlopen_preflight(/Users/katsumi/Library/Developer/Xcode/DerivedData/ExampleFramework-dejukqythshlljcaaxfukutqvvjv/Build/Products/Debug-iphonesimulator/ExampleFrameworkTests.xctest/ExampleFrameworkTests): no suitable image found.  Did find:
    /Users/katsumi/Library/Developer/Xcode/DerivedData/ExampleFramework-dejukqythshlljcaaxfukutqvvjv/Build/Products/Debug-iphonesimulator/ExampleFrameworkTests.xctest/ExampleFrameworkTests: mach-o, but wrong architecture) UserInfo=0x7fd4c1409c50 {NSLocalizedFailureReason=The bundle doesn’t contain a version for the current architecture., NSLocalizedRecoverySuggestion=Try installing a universal version of the bundle., NSFilePath=/Users/katsumi/Library/Developer/Xcode/DerivedData/ExampleFramework-dejukqythshlljcaaxfukutqvvjv/Build/Products/Debug-iphonesimulator/ExampleFrameworkTests.xctest/ExampleFrameworkTests, NSDebugDescription=dlopen_preflight(/Users/katsumi/Library/Developer/Xcode/DerivedData/ExampleFramework-dejukqythshlljcaaxfukutqvvjv/Build/Products/Debug-iphonesimulator/ExampleFrameworkTests.xctest/ExampleFrameworkTests): no suitable image found.  Did find:
    /Users/katsumi/Library/Developer/Xcode/DerivedData/ExampleFramework-dejukqythshlljcaaxfukutqvvjv/Build/Products/Debug-iphonesimulator/ExampleFrameworkTests.xctest/ExampleFrameworkTests: mach-o, but wrong architecture, NSBundlePath=/Users/katsumi/Library/Developer/Xcode/DerivedData/ExampleFramework-dejukqythshlljcaaxfukutqvvjv/Build/Products/Debug-iphonesimulator/ExampleFrameworkTests.xctest, NSLocalizedDescription=The bundle “ExampleFrameworkTests” couldn’t be loaded because it doesn’t contain a version for the current architecture.}