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-12232] [SPM] --enable-test-discovery ignores inherited test methods #54658

Closed
swift-ci opened this issue Feb 19, 2020 · 3 comments
Closed
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior.

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-12232
Radar rdar://problem/59655518
Original Reporter tannernelson (JIRA User)
Type Bug

Attachment: Download

Environment

Xcode Version 11.4 beta (11N111s)

Additional Detail from JIRA
Votes 1
Component/s
Labels Bug
Assignee None
Priority Medium

md5: 1a81d491ee635b8aef736c38df2e9633

Issue Description:

The following code runs `testStuff` on macOS in Xcode and via CLI. However, on Linux using --enable-test-discovery, the `testStuff` method is not found resulting in no tests running.

// module A
open class Foo: XCTestCase { }
extension Foo {
    func testStuff() { ... }
}
// module B
import A
final class Bar: Foo { }

Potentially related to https://bugs.swift.org/browse/SR-11951, but I'm not sure.

@hborla
Copy link
Member

hborla commented Feb 21, 2020

@swift-ci create

@swift-ci
Copy link
Collaborator Author

swift-ci commented Jul 3, 2020

Comment by Christopher Prince (JIRA)

The more direct style of inheritance also shows the same result.

import XCTest
// module A
class Foo: XCTestCase {
    func testStuff() {
    }
}
class Bar: Foo {
}

On Linux, only one test case is executed. On MacOS, 2 test cases are executed.

Archive.zipThis archive gives the executable package and both linux and mac os x results.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior.
Projects
None yet
Development

No branches or pull requests

3 participants