muter
muter copied to clipboard
If we launch muter using Xcode on a custom working directory, muter is failing. It throws UIKit not found
[4/6] Compiling Core Core.swift /Users/kogilapriadarsininathan/Documents/Projects/Core_mutated/Sources/Core/Core.swift:9:8: error: no such module 'UIKit' 7 | // https://docs.swift.org/swift-book 8 | // write a function to compare two strings 9 | import UIKit | `- error: no such module 'UIKit' 10 | import AVFoundation 11 | error: fatalError
Any chance you're trying to build a UIKit project for macOS instead of iOS? Are you able to provide a sample project that reproduces the error?
@ZevEisenberg WFCore.zip Attached the sample project which is SPM , supports only for iOS.
- This is how I selected the path of my spm project and ran muter.
Please let me know if muter.conf.yml needs any change.
Here's the contexts of your file for convenience:
arguments:
- test
executable: /usr/bin/swift
exclude: []
excludeCalls: []
coverageThreshold: 0e+0
If you run /usr/bin/swift test in your terminal, does it build and test successfully? Or do you need to specify a target platform of an iOS simulator?
hi @Kogilapriadarsini, I wasn't able to build the example project from Xcode. Could you check if its working on your end?
Here's the contexts of your file for convenience:
arguments:
- test executable: /usr/bin/swift exclude: [] excludeCalls: [] coverageThreshold: 0e+0 If you run
/usr/bin/swift testin your terminal, does it build and test successfully? Or do you need to specify a target platform of an iOS simulator?
its throwing same error.
But if I run using Xcode, it's working fine. In package.swift, I mentioned supported platform as "iOS" only.
hi @Kogilapriadarsini, I wasn't able to build the example project from Xcode. Could you check if its working on your end?
its building fine for me . have to select target as iPhone simulator.
Muter uses the command line invocation described in the config file to build. When building for iOS in the command line, you have to specify an iOS destination, even if the package doesn't support macOS, I guess. I believe you'll have to use xcodebuild instead of swift, and specify the destination. I like using this cheat sheet.
Could you please share working muter.cnf.yml for this use case. I tried using xcodebuild , but I got different errors. Once I got unknown argument “destination”, then I got deriveddata folder not found, then I got .xctestrun not found in TestContent folder. If you can share working muter config file for this project, it will be really helpful.
This crashes xcodebuild for me with Xcode 16.3 (😆/😭), but runs tests on Xcode 16.4:
xcodebuild test -scheme WFCore -destination "platform=iOS Simulator,name=iPhone SE (3rd generation),OS=18.4"
(Substitute the name of a simulator you have installed.)
After updating the config file, it threw the below error
. Let me know if you are aware about this.
can you please post your updated config file, or even better, the full project that reproduces the above error?