typealiased / mockingbird

A Swifty mocking framework for Swift and Objective-C.
https://mockingbirdswift.com
MIT License
657 stars 82 forks source link

Not all mocks generated #241

Closed Allje closed 2 years ago

Allje commented 2 years ago

Description

I have configured the test target with following command mockingbird install --project MyDevice.xcodeproj --source MyDevice --target MyDeviceTests

In Xcode I can see that following is inset in the build phase for the test target: mockingbird generate \ --targets 'MyDevice' \ --outputs "${SRCROOT}/MockingbirdMocks/MyDeviceTests-MyDeviceMocks.generated.swift"

The file "MyDeviceTests-MyDeviceMocks.generated.swift" generated from Xcode is 46 KB

The problem is that a mock isn't generated for all protocols

If I run following command from the terminal

mockingbird generate --targets 'MyDevice' --outputs "MyDevice/MockingbirdMocks/MyDeviceTests-MyDeviceMocks.generated.swift"

then all mock is generated for all protocols and the "MyDeviceTests-MyDeviceMocks.generated.swift" generated is 262 KB

Why is there a difference?

Environment

andrewchang-bird commented 2 years ago

Likely due to thunk pruning, which by default is set to omit. More info: https://github.com/birdrides/mockingbird#thunk-pruning