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

Unit tests don't compile on Windows #46

Open
valeriyvan opened this issue Dec 7, 2022 · 2 comments
Open

Unit tests don't compile on Windows #46

valeriyvan opened this issue Dec 7, 2022 · 2 comments

Comments

@valeriyvan
Copy link

swift run PNGTests
Building for debugging...
c:\Users\1\Documents\tmp1\swift-png\Tests\PNG\Main.swift:9:1: error: 'main' attribute cannot be used in a module that contains top-level code
@main
^
c:\Users\1\Documents\tmp1\swift-png\Tests\PNG\Main.swift:1:1: note: top-level code defined in this source file
@testable import PNG
^
c:\Users\1\Documents\tmp1\swift-png\Tests\PNG\Main.swift:9:1: error: 'main' attribute cannot be used in a module that contains top-level code
@main
^
c:\Users\1\Documents\tmp1\swift-png\Tests\PNG\Main.swift:1:1: note: top-level code defined in this source file
@testable import PNG
^

Version of swift:

swift --version
compnerd.org Swift version 5.7.1 (swift-5.7.1-RELEASE)
Target: x86_64-unknown-windows-msvc

These unit tests build and run on macOS normally. Version of swift on macOS is the same as on Windows.

@tayloraswift
Copy link
Owner

can you test if this also occurs with 5.6.2? (that is what the CI uses)

also, does -parse-as-library help?

@valeriyvan
Copy link
Author

can you test if this also occurs with 5.6.2? (that is what the CI uses)

for me it was so hard to make swift on WIndows up and running, that I am affraid to install older version along with latest.

also, does -parse-as-library help?

swift -parse-as-library run PNGTests
error: option '-parse-as-library' is not supported by 'swift'; did you mean to use 'swiftc'?

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

2 participants