Skip to content

Throw error if no test module #160

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

Merged
merged 1 commit into from
Mar 9, 2016
Merged

Throw error if no test module #160

merged 1 commit into from
Mar 9, 2016

Conversation

aciidgh
Copy link
Contributor

@aciidgh aciidgh commented Mar 1, 2016

When no Test modules are present, running swift test produces this error :

Usage: xctest [-XCTest All | <TestCaseClassName/testMethodName>] <path of unit to be tested>

Failure: No test bundle found at path `/Users/ankit/mycode/temp/.build/debug/Package.xctest`

Displaying process arguments and environment for debugging purposes:
Arguments: (
    "/Applications/Xcode.app/Contents/Developer/usr/bin/xctest",
    "/Users/ankit/mycode/temp/.build/debug/Package.xctest"
)
Environment: {
    HOME = "/Users/ankit";
    PATH = "/Library/Developer/Toolchains/swift-latest.xctoolchain/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin";
    "SPM_INSTALL_PATH" = "/Users/ankit/mycode/temp/.build";
    "__CF_USER_TEXT_ENCODING" = "0x1F5:0x0:0x0";
}

This patch will show this error instead :

error: no tests found to execute, create a test-module in `Tests` directory

by checking if Package.xctest or test-Package exists.

It might be possible to detect if there are no test targets during build phase of tests if in future swift-build-tools reports some error while building an empty target.

@aciidgh
Copy link
Contributor Author

aciidgh commented Mar 8, 2016

Squashed, rebased and resolved conflicts 🤓

@mxcl
Copy link
Contributor

mxcl commented Mar 8, 2016

@swift-ci Please test

@aciidgh
Copy link
Contributor Author

aciidgh commented Mar 8, 2016

@mxcl can we avoid running all the tests in CI?

@mxcl
Copy link
Contributor

mxcl commented Mar 9, 2016

@aciidb0mb3r yes @shahmishal is going to make this happen.

mxcl added a commit that referenced this pull request Mar 9, 2016
Throw error if no test module
@mxcl mxcl merged commit cc15171 into swiftlang:master Mar 9, 2016
@aciidgh
Copy link
Contributor Author

aciidgh commented Mar 9, 2016

Cool, also CI used to send in the beginning to the committer but now don't get any notification if when build finishes. Is there a way to subscribe ?

@aciidgh aciidgh deleted the patch-12 branch April 1, 2016 09:10
aciidgh pushed a commit to aciidgh/swift-package-manager that referenced this pull request Jan 11, 2019
[BuildSystem] Error if there is no root document.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants