-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Listing tests with empty LinuxMain.swift outputs error message (Swift 5.8) #5744
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
Comments
@adam-fowler is this still an issue?
|
Going to close this just now as I cannot replicate it. |
Re-opening, just managed to replicate this. |
It looks like it is related to packages that have a LinuxMain.swift |
Assuming we don't support |
A 5.8 release of swift should not have breaking changes in it though. Projects that built and test fine with swift 5.7 should do so with 5.8 as well. |
Right, so reopening this one seems more suitable then? |
I closed this issue then within 5 minutes realised it was still an issue so reopened it and managed to narrow down what the problem was. |
Ah, ok. I was a bit confused since the status for me is still showing up as closed. |
Ha I'm an idiot, forgot to re-open it |
I've also worked out the LinuxMain.swift needs to empty for the issue to occur. See https://forums.swift.org/t/test-discovery-on-linux/26203/10 for reasons why you might have an empty LinuxMain.swift |
@adam-fowler, some diagnostics for this error were just merged in trunk, #6860, try it with the next trunk snapshot build- the current Aug. 25 snapshot doesn't have that commit- and see if it helps. |
I now get
|
Thanks for the update, sounds like an empty JSON is produced? |
@adam-fowler any luck working around this? |
@mapedd I haven't seen this in a long time. Although I've removed LinuxMain.swift from pretty much all of my projects. |
Closing per Adam's latest comment; if somebody's still running into this issue, please do reopen! |
Description
Running
swift test list
outputs an error for SwiftPM packages that have an emptyLinuxMain.swift
Expected behavior
swift test list
to output a list of all the tests in a packageActual behavior
It outputs
Steps to reproduce
swift package init
touch Tests/LinuxMain.swift
swift test list
Swift Package Manager version/commit hash
No response
Swift & OS version (output of
swift --version && uname -a
)Swift version 5.8-dev (LLVM f6b60d5b8f4b443, Swift ecccce61139bbc4)
Target: x86_64-unknown-linux-gnu
Linux af-starbook 5.15.0-46-generic #49~20.04.1-Ubuntu SMP Thu Aug 4 19:15:44 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
The text was updated successfully, but these errors were encountered: