Skip to content

swift test prints error: fatalError twice on build failure #6605

Closed as not planned
@MaxDesiatov

Description

@MaxDesiatov

Description

In addition to an unhelpful error message it is printed twice when swift test fails to build a test target.

Expected behavior

An error message is printed saying that tests couldn't be run as they failed to build. The error message should be printed only once.

Actual behavior

error: fatalError message is printed twice.

Steps to reproduce

  1. swift package init --type library
  2. Open the automatically generated test case.
  3. Add this code snippet to it:
    func testExample() throws {
        let x = 0
        let y = 1 / x
        print(y)
    }
  1. Run swift test on the command line.

Swift Package Manager version/commit hash

Latest SwiftPM nightly from main

Swift & OS version (output of swift --version ; uname -a)

Swift development snapshot, macOS 13

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugswift testChanges impacting `swift test` tool

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions