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-1607] SwiftPM doesn't help diagnose mis-named test suites #5273

Closed
ddunbar opened this issue May 24, 2016 · 3 comments
Closed

[SR-1607] SwiftPM doesn't help diagnose mis-named test suites #5273

ddunbar opened this issue May 24, 2016 · 3 comments
Labels

Comments

@ddunbar
Copy link
Member

ddunbar commented May 24, 2016

Previous ID SR-1607
Radar None
Original Reporter @ddunbar
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Package Manager
Labels Bug, StarterBug
Assignee None
Priority Medium

md5: 9f713f0b7b19768b438d13bc666f5428

Issue Description:

This convention will fail to link:

$ find .
.
./.gitignore
./Package.swift
./Sources
./Sources/foo.swift
./Tests
./Tests/fooTests
./Tests/fooTests/fooTests.swift
./Tests/LinuxMain.swift

because of the misnamed test suite.

@ddunbar
Copy link
Member Author

ddunbar commented May 24, 2016

We have had a couple reports of this, and I have found the current behavior very confusing. I think we need to do a better job of enforcing and diagnosing the conventions so users know the expected layout.

@abertelrud
Copy link
Contributor

We can consider this problem to be fixed now. For one thing, the conventions are now more natural (in particular SwiftPM no longer silently appends a `TestSuite` suffix to the module name under `Tests` – rather, it expects the subdirectory name itself to have a `Tests` suffix, which is at least clearer.

And equally importantly, there are now decent error messages when a test suite doesn't have the right name:

sh> swift build
error: the module at Tests/abc has an invalid name ('abc'): the name of a test module has no ‘Tests’ suffix
fix: rename the module at ‘Tests/abc’ to have a ‘Tests’ suffix

@abertelrud
Copy link
Contributor

(nit pick about the `fix` message: we're specifically not telling the user what to rename the test to by just appending `Tests` to what they already have, since the fact that a `Tests` suffix is needed might mean that they want to pick a different name altogether).

@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
This issue was closed.
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

2 participants