Error when running `swift test` in Playing Card example project

testing

(ankit goel) #1

I am unable to run tests using the swift test command.

I tried cloning the Playing card example project (https://github.com/apple/example-package-playingcard)

I am able to successfully build the project using swift build but when I run swift test, it outputs the following error:

error: cannot load underlying module for 'XCTest'


(ankit goel) #2

I had created an executable project and hence it had main.swift file. TIL that if you have main.swift in the same target then linking with tests fails.