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-32] Find way to make allTests required / audited on OS X #411

Closed
ddunbar opened this issue Dec 4, 2015 · 5 comments
Closed

[SR-32] Find way to make allTests required / audited on OS X #411

ddunbar opened this issue Dec 4, 2015 · 5 comments

Comments

@ddunbar
Copy link
Member

ddunbar commented Dec 4, 2015

Previous ID SR-32
Radar None
Original Reporter @ddunbar
Type Bug
Status Closed
Resolution Duplicate
Additional Detail from JIRA
Votes 0
Component/s XCTest
Labels Bug
Assignee None
Priority Medium

md5: 093d90aa3adc1cdd0aa21c38ed26efb0

is duplicated by:

  • SR-710 Generate XCTestCaseProvider entries on Linux

Issue Description:

We currently have to add allTests entries for each test to work around the lack of auto-discovery on Linux. This is a source of error when adding new tests and developing on OS X as it is easy to forget.

We should see if we can use the method discovery features on OS X to verify that the allTests method has been implemented and contains all of the available tests. This would ensure that it isn't possible to add new tests and forget to update the list.

@briancroom
Copy link
Collaborator

I'm trying to think through what kind of approach to take for this. If I understand correctly, this would not be a responsibility of `swift-corelibs-xctest`, because that library is not ordinarily used on OS X at all, is that right? @ddunbar

@briancroom
Copy link
Collaborator

See some thoughts on this at apple/swift-package-manager#84

@briancroom
Copy link
Collaborator

For future reference, here is a gist with a Swift source file that can be included in `XCTest` bundles on OS X to trigger failures for tests that aren't found in the test case's `allTests` property. It is essentially the same as the file adopted by SPM:

https://gist.github.com/briancroom/dd7d241fa5cbb887389c

Barring some kind of support from Apple's XCTest, I don't believe there is any way to `automagically` obtain the behavior requested by this ticket. Instead, individual projects will need to include code such as linked above.

@modocache
Copy link
Mannequin

modocache mannequin commented Mar 10, 2016

Latest attempt at this is here: apple/swift-package-manager#164

@modocache
Copy link
Mannequin

modocache mannequin commented Mar 29, 2016

This task is a duplicate of https://bugs.swift.org/browse/SR-710. Let's concentrate the discussion there.

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

No branches or pull requests

2 participants