Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-11951] Test discovery on Linux breaks with test class extensions in multiple files #4635

Open
swift-ci opened this issue Dec 13, 2019 · 2 comments
Labels

Comments

@swift-ci
Copy link
Contributor

Previous ID SR-11951
Radar rdar://problem/58435666
Original Reporter siemensikkema (JIRA User)
Type Bug

Attachment: Download

Environment

(Ubuntu) Linux

Docker image swift:5.1

Additional Detail from JIRA
Votes 0
Component/s Package Manager, XCTest
Labels Bug
Assignee None
Priority Medium

md5: c363235c1de0150b1ca7961dbfc9ed16

is duplicated by:

  • 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.

@beccadax
Copy link
Contributor

@swift-ci create

@tomerd
Copy link
Member

tomerd commented Apr 23, 2021

fix is coming via: #3433

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants