Quick / Nimble

A Matcher Framework for Swift and Objective-C
https://quick.github.io/Nimble/documentation/nimble/
Apache License 2.0
4.79k stars 595 forks source link

Fix cocoapods dependencies #1111

Closed svenmuennich closed 6 months ago

svenmuennich commented 6 months ago

This PR fixes the cocoapods dependencies needed to make throwAssertion() matcher work. Since https://github.com/Quick/Nimble/pull/1108 the matching was broken due to CwlPreconditionTesting being missing. As a result the respective canImport(CwlPreconditionTesting) condition in ThrowAssertion.swift was always false when using cocoapods.

Note: The existing dependencies CwlMachBadInstructionHandler and CwlCatchException are replaced by CwlPreconditionTesting, which adds them transitively.

This PR probably fixes https://github.com/Quick/Nimble/issues/1110.

Checklist - While not every PR needs it, new features should consider this list:

yuri-qualtie commented 6 months ago

@svenmuennich I pulled fix from your branch:

  pod 'Nimble',
    :git => 'https://github.com/pickware/Nimble.git',
    :branch => 'bug/precondition-testing'
> pod install
Analyzing dependencies
Pre-downloading: `Nimble` from `https://github.com/pickware/Nimble.git`, branch `bug/precondition-testing`
Downloading dependencies
Installing CwlCatchException (2.1.2)
Installing CwlCatchExceptionSupport (2.1.2)
Installing CwlMachBadInstructionHandler (2.1.2)
Installing CwlPosixPreconditionTesting (2.1.2)
Installing CwlPreconditionTesting (2.1.2)
Installing Nimble 13.1.1 (was 13.0.0)
Generating Pods project
Integrating client project

But tests are failed to build with:

error: .../Pods/Nimble/Carthage/Checkouts/CwlPreconditionTesting/Sources/CwlMachBadInstructionHandler/mach_excServer.h: No such file or directory (in target 'Nimble-macOS' from project 'Pods')
svenmuennich commented 6 months ago

This is weird. It looks like it is trying to find files which were removed in https://github.com/Quick/Nimble/commit/ebe9d8038af54d5be6bbd754501f6ee192b80e48. Maybe try removing both the Pods directory and project and run pod install again.

yuri-qualtie commented 6 months ago

@svenmuennich yep, sorry for confusion. Everything works as expected after I removed Pods folder and cleaned derived data folder.