swift-package-manager: Listing tests with empty LinuxMain.swift outputs error message (Swift 5.8)

Description

Running swift test list outputs an error for SwiftPM packages that have an empty LinuxMain.swift

Expected behavior

swift test list to output a list of all the tests in a package

Actual behavior

It outputs

error: malformed

Steps to reproduce

  1. swift package init
  2. touch Tests/LinuxMain.swift
  3. 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

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Comments: 16 (6 by maintainers)

Most upvoted comments

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