Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable get generate file #26

Closed
DhirajChaudhari opened this issue Jan 16, 2020 · 10 comments
Closed

Unable get generate file #26

DhirajChaudhari opened this issue Jan 16, 2020 · 10 comments
Assignees

Comments

@DhirajChaudhari
Copy link

can you guide me install and generating mock file. I have it tried by below way.
My Used file as below.
Protocol -> LoginProtocol
Manager -> LoginApiManager
TestFile -> LoginTests
project target -> Login
test target -> LoginTest

// Below command generate blur file of generated mocs but cant accessible in project

mockingbird install
--project Login.xcodeproj
--target LoginExample
--destination LoginTests

Can you guide me how to generate LoginProtocol mocs .

@andrewchang-bird
Copy link
Contributor

Based on your installation, mocks will generate in the pre-compile build phase for LoginTests. If you run (or build) your unit testing bundle you should see the file MockingbirdMocks/LoginExampleMocks.generated.swift get generated.

@andrewchang-bird
Copy link
Contributor

Closing this issue. Please re-open it or join the Slack if needed.

@user-mobil
Copy link

I am having the same issue with the transcript:

Showing All Messages
[WARN] Unable to decode the cached target data at /Users/user/Files/iOS/Mobile-iOS/Mobile.xcodeproj/MockingbirdCache/Mobile.lock

Any recommendation?

@user-mobil
Copy link

user-mobil commented Apr 9, 2020

Debugging the generator leads me to find this issue:

Showing All Messages
/Users/user/Library/Developer/Xcode/DerivedData/TDA-cgbasagkjrisyeazvvapcienjukt/Build/Intermediates.noindex/TDA.build/Mock-iphonesimulator/TDATests.build/Script-64285976CAF908518AF02F05.sh: line 5:   734 Illegal instruction: 4  mockingbird generate --targets 'TDA' --outputs "${SRCROOT}/MockingbirdMocks/TDAMocks.generated.swift" --support "${SRCROOT}/MockingbirdSupport"

UPDATE: not quite sure why I am getting this error ...
Fatal error: Loading sourcekitd.framework/Versions/A/sourcekitd failed: file /Users/ryan/Bird/Projects/mockingbird/.build/checkouts/SourceKitten/Source/SourceKittenFramework/library_wrapper.swift, line 39

@andrewchang-bird

@andrewchang-bird
Copy link
Contributor

@user-mobil What dependency manager are you using? Are you building the CLI from source, or using one of the pre-built artifacts?

@user-mobil
Copy link

user-mobil commented Apr 9, 2020

Cocoa pods

$ cd Pods/MockingbirdFramework
$ make install-prebuilt

It also successfully installs on my own test target.

$ mockingbird install \
  --target BirdTests \
  --sources Bird BirdManagers

edit: also, the demo project works as intended

@andrewchang-bird
Copy link
Contributor

It’s odd that the demo project would work but not your main project. Have you tried xcode-select per this thread? What version of macOS are you running?

@user-mobil
Copy link

user-mobil commented Apr 9, 2020

Catalina, and yes! I have updated it to the proper .app, since i have it under a different name. It still is not working as intended.

@andrewchang-bird
Copy link
Contributor

Try building and installing the CLI from source instead:

$ cd Pods/MockingbirdFramework
$ make setup-project
$ make install

If that doesn’t work, please consider joining the Slack channel as I’m not able to reproduce this on my end. However, I suspect it’s due to having multiple Xcode toolchains installed.

@user-mobil
Copy link

Hey! Took all day, but I figured it out... it was the .mockingbird-ignore file. This project is a bit massive, so what I did was ignore everything but a particular folder I am looking to test. That's an odd error, but I am assuming it's because it was trying to mock some things it wasn't capable of somewhere in here. Thanks for your time and help!

  • Travis

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants