You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SR-11951 Test discovery on Linux breaks with test class extensions in multiple files
Issue Description:
If in SwiftPM 5.1 on Linux you use --enable-test-discovery and have unit test cases for one test suite spread across multiple files (using extension SomeTests), you will see the following build errors:
$ docker run -it --rm -v "$PWD:$PWD" -w "$PWD" swift:5.1.3 swift test --enable-test-discovery
/tmp/repro/.build/x86_64-unknown-linux/debug/testlist.derived/reproTests.swift:11:16: error: invalid redeclaration of '__allTests__reproTests'
static let __allTests__reproTests = [
^
/tmp/repro/.build/x86_64-unknown-linux/debug/testlist.derived/reproTests.swift:5:16: note: '__allTests__reproTests' previously declared here
static let __allTests__reproTests = [
^
[10/12] Compiling reproPackageTests main.swift
$ cat Tests/reproTests/reproTests.swift
import XCTest
@testable import repro
final class reproTests: XCTestCase {
func testExample() {
// This is an example of a functional test case.
// Use XCTAssert and related functions to verify your tests produce the correct
// results.
XCTAssertEqual(repro().text, "Hello, World!")
}
}
$ cat Tests/reproTests/otherFile.swift
import Foundation
extension reproTests {
func testSomthingInOtherFile() {
}
}
The text was updated successfully, but these errors were encountered:
Attachment: Download
Additional Detail from JIRA
md5: ef57b4e8fd91ce5cf7ed79d55aa6b477
duplicates:
Issue Description:
If in SwiftPM 5.1 on Linux you use
--enable-test-discovery
and have unit test cases for one test suite spread across multiple files (usingextension SomeTests
), you will see the following build errors:The attached repository contains an easy repro.
with
The text was updated successfully, but these errors were encountered: