Unit tests don't compile on Windows
valeriyvan opened this issue · comments
Valeriy Van commented
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.
taylorswift commented
can you test if this also occurs with 5.6.2? (that is what the CI uses)
also, does -parse-as-library
help?
Valeriy Van commented
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'?