Throw error if no test module #160

Merged
merged 1 commit into from Mar 9, 2016

Conversation

Projects
None yet
2 participants
@aciidb0mb3r
Member

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

@aciidb0mb3r

This comment has been minimized.

Show comment
Hide comment
@aciidb0mb3r

aciidb0mb3r Mar 8, 2016

Member

Squashed, rebased and resolved conflicts 🤓

Member

aciidb0mb3r commented Mar 8, 2016

Squashed, rebased and resolved conflicts 🤓

@mxcl

This comment has been minimized.

Show comment
Hide comment
@mxcl

mxcl Mar 8, 2016

Contributor

@swift-ci Please test

Contributor

mxcl commented Mar 8, 2016

@swift-ci Please test

@aciidb0mb3r

This comment has been minimized.

Show comment
Hide comment
@aciidb0mb3r

aciidb0mb3r Mar 8, 2016

Member

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

Member

aciidb0mb3r commented Mar 8, 2016

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

@mxcl

This comment has been minimized.

Show comment
Hide comment
@mxcl

mxcl Mar 9, 2016

Contributor

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

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

Merge pull request #160 from aciidb0mb3r/patch-12
Throw error if no test module

@mxcl mxcl merged commit cc15171 into apple:master Mar 9, 2016

2 checks passed

Swift Test Linux Platform Build finished. 7987 tests run, 0 skipped, 0 failed.
Details
Swift Test OS X Platform Build finished. 32112 tests run, 0 skipped, 0 failed.
Details
@aciidb0mb3r

This comment has been minimized.

Show comment
Hide comment
@aciidb0mb3r

aciidb0mb3r Mar 9, 2016

Member

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 ?

Member

aciidb0mb3r 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 ?

@aciidb0mb3r aciidb0mb3r deleted the aciidb0mb3r:patch-12 branch Apr 1, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment