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-11968 SwiftPM test discovery: creating extra tests in separate files causes build errors
SR-14512 Duplicate allTests array when extending a XCTestCase class on Linux
Issue Description:
When having tests in an XCTestCase class in extensions in multiple files while using --enable-test-discovery building the test target fails with:
[9/12] Compiling ExamplePackageTests ExampleTests.swift /package/.build/x86_64-unknown-linux/debug/testlist.derived/ExampleTests.swift:11:16: error: invalid redeclaration of '_allTests_ExampleTests' static let _allTestsExampleTests = [ ^ /package/.build/x86_64-unknown-linux/debug/testlist.derived/ExampleTests.swift:5:16: note: 'allTests_ExampleTests' previously declared here static let _allTests_ExampleTests = [
The attached example can be run with docker build .
The example has a test in the class definition itself and one in an extension. But the problem also appears when having an empty class definition and tests in 2 or more extensions each in their own file.
The text was updated successfully, but these errors were encountered:
Attachment: Download
Environment
(Ubuntu) Linux
Docker image swift:5.1
Additional Detail from JIRA
md5: c363235c1de0150b1ca7961dbfc9ed16
is duplicated by:
Issue Description:
When having tests in an XCTestCase class in extensions in multiple files while using
--enable-test-discovery
building the test target fails with:[9/12] Compiling ExamplePackageTests ExampleTests.swift /package/.build/x86_64-unknown-linux/debug/testlist.derived/ExampleTests.swift:11:16: error: invalid redeclaration of '_allTests_ExampleTests' static let _allTestsExampleTests = [ ^ /package/.build/x86_64-unknown-linux/debug/testlist.derived/ExampleTests.swift:5:16: note: 'allTests_ExampleTests' previously declared here static let _allTests_ExampleTests = [
The attached example can be run with
docker build .
The example has a test in the class definition itself and one in an extension. But the problem also appears when having an empty class definition and tests in 2 or more extensions each in their own file.
The text was updated successfully, but these errors were encountered: