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

SwiftEval: Load tests bundle if exists. #66

Merged

Conversation

byohay
Copy link
Contributor

@byohay byohay commented Nov 24, 2022

Previously, when running tests through injection, if the test would have depended upon a symbol that's in the tests bundle, it would give an undefined symbol error. This commit solves this by loading the tests bundle if it exists, which allows for much better support when loading new test files through injection.

Notes:

  • Right now the tests bundle is loaded regardless of the file being injected - I couldn't figure whether I can get the name of the file from loadAndInject function.
  • I only tested it on iOS, with standalone mode and with the mac app.

Previously, when running tests through injection, if the test would have
depended upon a symbol that's in the tests bundle, it would give an
undefined symbol error. This commit solves this by loading the tests
bundle if it exists, which allows for much better support when loading
new test files through injection.
@johnno1962
Copy link
Owner

johnno1962 commented Nov 24, 2022

Awesome! I'll take your word for it working and I can roll a new release candidate. Thanks for wading through some pretty eccentric code to work this out. Is it worth combining the two methods to be able to load than one .xctest bundle? Would that ever happen? I wouldn't worry about filtering by file name, these loads only happen once.

@johnno1962 johnno1962 merged commit 225d28e into johnno1962:main Nov 24, 2022
johnno1962 pushed a commit that referenced this pull request Nov 24, 2022
Previously, when running tests through injection, if the test would have
depended upon a symbol that's in the tests bundle, it would give an
undefined symbol error. This commit solves this by loading the tests
bundle if it exists, which allows for much better support when loading
new test files through injection.
@johnno1962
Copy link
Owner

I went ahead, merged and rolled a new release candidate with your change. Can you check it for me please? https://github.com/johnno1962/InjectionIII/releases/tag/4.5.3. Thanks very much taking the time to fix this.

@byohay
Copy link
Contributor Author

byohay commented Nov 26, 2022

@johnno1962 sorry for the delay, it works perfectly 😄

@johnno1962
Copy link
Owner

It's a bit of a novelty to get a PR on SwiftEval.swift. I wonder why 😄? Thanks again @byohay.

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

Successfully merging this pull request may close these issues.

None yet

2 participants