swiftlang / vscode-swift

Visual Studio Code Extension for Swift
https://marketplace.visualstudio.com/items?itemName=sswg.swift-lang
Apache License 2.0
755 stars 54 forks source link

Ensure build output is printed on swift-testing compiler error #919

Closed plemarquand closed 4 months ago

plemarquand commented 4 months ago

When performing a swift-testing test run with code that fails to compile the build output was being discarded. This made it hard to see why tests weren't being run.

This was happening because swift-testing tests don't have their run started until the .swift-testing binary has sent all of its test events, which enumerate the parameterized test cases. This means that build output is witheld until the run starts.

If there is a compile error, unless we call testRunStarted() to flush the buffer of test result output, nothing is printed to the Test Results panel and build output is lost.