I'm working on an executable and I'm trying to setup some unittests using XCTest. I have the default folder structure ( swift package init --type executable) and when I run
swift test in my terminal the unit tests work. However, When I try to import a struct in my Tests folder I get the error: undefined reference and a
clang-7: error: linker command failed with exit code 1 (use -v to see invocation). I have no clue why it doesn't work. There are no errors in the struct. Does anyone knows how to fix this?
P.S. at the top of test script I already do:
@testable import myProject
System: Ubuntu 20.04
swift version: Swift version 5.2.4 (swift-5.2.4-RELEASE)
clang version 7.0.0