How to reliably install and configure Quick test framework on Xcode 8?

Background :
While working on this answer, I noticed that it is not easy to properly configure Quick test frameworkXcode correctly. In my case, it took 3-4 unsuccessful attempts to finally have a working version. And yet, I'm not sure where my previous attempts were wrong. Or, more importantly, why the questionnaire in this thread may have a repeated run each time. Then he also made several attempts to finally create a worker.

Question :
I ask if any of you have a reliable way to configure Quick Framework on Xcode using Cocoa pods (or Carthage or Git Submodule), right up to running the correctly working Quick test case that you want to share.

How I did this before :
Here is how I created my work Quick framework on Xcode:
1. Follow the step in the XCTest article on the RayWenderlich website to set up the XCTest environment.
2. Then I add Cocoa Pods to install Quick
3. Then follow the instructions in Configuring your Xcode
4. Then I hacked and improvised the rest of the way, searching for every problem I encountered after that, try this and until then until it works.
(These steps include adding a Quick framework to link the binary in the build phase of my goal).

I'm not proud to share my steps above, but right now I have no better way. I hope to find a better way by asking this question. This may be too much to ask.

My subfile:

target 'PlayQuick' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!

# Pods for PlayQuick

target 'PlayQuickTests' do
    inherit! :search_paths
    # Pods for testing
    pod 'Quick'
    pod 'Nimble' 
end

end
+1
source share
2 answers

The git submodule method is the worst and easiest way to achieve this.

Follow these steps to start from scratch:

1.a. Create an Xcode project with Include Unit Tests.

1b. Alternatively, you could be create unit test targetin an existing project.

  • Open the test navigator.
  • Click the β€œ+” button in the lower left corner, then select β€œCreate” Unit Test Target ... from the menu:


2. Xcode (1)

3. Xcode. β†’ β†’ .

4. /Bash Shell/Cmd.exe

5. GitHubProjectClones.

  • : $HOME/Developer/GitHubProjectClones


6. cd (5):

  • mkdir
  • Git init


7. one Git Submodule section

  • Git subodule add git @github.com: // /
  • Git subodule add git @github.com: Quick/Nimble.git Vendor/Nimble
  • Git --init --recursive


8. two Git Submodule section.

  • Xcode :
    • , Project Navigator
      • β†’ :
        • , 7.
      • β†’ :
        • Nimble, 7.
      • β†’ :
        • Xcode 1.


9. three Git Submodule section, Quick.framework Nimble.framework Link Binary with Library.

10.

+1

Quick and Nimble cocoapods (macOS Sierra, Xcode8.3.2, IOS 10.3 SDK, Swift 3.1, cocoapods 1.2.1).

, ​​ cocoapods (gem update cocoapods) pod install, pod update. , pod deintegrate && pod install.

, - . .

, (, GitHub), .

+1

Source: https://habr.com/ru/post/1677449/


All Articles