Quick icon indicating copy to clipboard operation
Quick copied to clipboard

tests not running

Open AndrewSB opened this issue 10 years ago • 3 comments

  • [x] I have read CONTRIBUTING and have done my best to follow them.

What did you do?

I wrote a spec for GitHub.com/AndrewSB/Library (see Array + LastOccouranceSpec.swift), and tried to run the test using Product -> Test

What did you expect to happen?

I expected the test to run

What actually happened instead?

My target built, but the test didn't run

Environment

List the software versions you're using:

  • Quick: v0.10.0
  • Nimble: v5.1.1
  • Xcode Version: 8.1
  • Swift Version: 3.1

Please also mention which package manager you used and its version. Delete the other package managers in this list:

  • Carthage: 0.18.1

Project that demonstrates the issue

https://github.com/AndrewSB/Library

EDIT: video showing what happens when I try to test: https://vid.me/KdcA. Notice the debug bar show up on the bottom of the screen for a split second after the target builds

AndrewSB avatar Dec 01 '16 22:12 AndrewSB

2016-12-02 08:47:33.060 xctest[25639:186633] The bundle “LibraryTests” couldn’t be loaded because it is damaged or missing necessary resources. Try reinstalling the bundle.
2016-12-02 08:47:33.062 xctest[25639:186633] (dlopen_preflight(/Users/ikesyo/Library/Developer/Xcode/DerivedData/Library-bejyooymywutcmdzkzanrxprmkfe/Build/Products/Debug-iphonesimulator/LibraryTests.xctest/LibraryTests): Library not loaded: @rpath/Nimble.framework/Nimble
  Referenced from: /Users/ikesyo/Library/Developer/Xcode/DerivedData/Library-bejyooymywutcmdzkzanrxprmkfe/Build/Products/Debug-iphonesimulator/LibraryTests.xctest/LibraryTests
  Reason: image not found)
Program ended with exit code: 82

The test target crashes immediately. You are missing a step for the target: https://github.com/Carthage/Carthage#adding-frameworks-to-unit-tests-or-a-framework

In rare cases, you may want to also copy each dependency into the build product (e.g., to embed dependencies within the outer framework, or make sure dependencies are present in a test bundle). To do this, create a new “Copy Files” build phase with the “Frameworks” destination, then add the framework reference there as well.

ikesyo avatar Dec 01 '16 23:12 ikesyo

Ahh, that makes complete sense. Thanks @ikesyo!

I should have pulled up the debugger view to see the log. Strange that it didn't stay there after the crash

AndrewSB avatar Dec 01 '16 23:12 AndrewSB

@ikesyo Thank you for your answer. It helped me fix an issue with Apollo and GraphQL.

yairsz avatar Jan 22 '19 21:01 yairsz