Skip to content

[build_script] Use built XCTest for Linux tests #46

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

Conversation

modocache
Copy link
Contributor

Previously, tests on Linux could only be run using the installed swift-corelibs-xctest. Modify the script to use the built XCTest instead of the installed one.

In addition, since the script no longer relies on the installed XCTest, move the --test logic such that it can be used even if --module-install-path and --library-install-path are not specified.


Now, running tests on Linux is as easy as:

$ ./build_script.py \
    --swiftc ~/build/Ninja-ReleaseAssert/swift-linux-x86_64/bin/swiftc \
    --build-dir ~/build/Ninja-ReleaseAssert/xctest-linux-x86_64 \
    --swift-build-dir ~/build/Ninja-ReleaseAssert/swift-linux-x86_64 \
    --test

Keep in mind that the tests won't pass until after #45 is merged.

@briancroom
Copy link
Contributor

I haven't had a chance to give it a try yet, but this seems like an important step towards making this test suite robust enough to catch the sorts of things we want it to. 👍

@modocache modocache force-pushed the linux-tests-use-built-product branch from a0ebca0 to dc30cec Compare February 7, 2016 04:45
modocache added a commit to modocache/swift that referenced this pull request Feb 8, 2016
As of swiftlang/swift-corelibs-xctest#43,
swift-corelibs-xctest is dependent upon swift-corelibs-foundation.
As such, it must be built after Foundation, and its build
script must be passed a reference to the Foundation build
directory. Update the build script in order to get XCTest
building after the changes in swiftlang/swift-corelibs-xctest#43.

In addition, this change also allows XCTest to be tested via
`utils/build-script --xctest --test`. This has been possible
since swiftlang/swift-corelibs-xctest#46.
@briancroom
Copy link
Contributor

The README should also be updated with the new build script invocation here!

Previously, tests on Linux could only be run using the installed
swift-corelibs-xctest. Modify the script to use the built XCTest
instead of the installed one.

In addition, since the script no longer relies on the installed
XCTest, move the `--test` logic such that it can be used even
if `--module-install-path` and `--library-install-path` are not
specified.
@modocache modocache force-pushed the linux-tests-use-built-product branch from dc30cec to cd0f2d5 Compare February 9, 2016 22:59

```sh
./build_script.py \
--swiftc="/swift/usr/bin/swiftc" \
--build-dir="/tmp/XCTest_build" \
--swift-build-dir="/swift/usr" \
--library-install-path="/swift/usr/lib/swift/linux" \
--module-install-path="/swift/usr/lib/swift/linux/x86_64" \
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The README should also be updated with the new build script invocation here!

@briancroom Is this what you meant?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome. Thanks!

@modocache
Copy link
Contributor Author

@mike-ferris-apple Friendly ping! This is one of those rare pull requests with no tradeoffs--only benefits to be had here! 😎

mike-ferris pushed a commit that referenced this pull request Feb 10, 2016
[build_script] Use built XCTest for Linux tests
@mike-ferris mike-ferris merged commit 383ea5b into swiftlang:master Feb 10, 2016
@modocache modocache deleted the linux-tests-use-built-product branch February 10, 2016 15:42
@modocache
Copy link
Contributor Author

Thanks!!

modocache added a commit to modocache/swift-corelibs-xctest that referenced this pull request Feb 15, 2016
swiftlang#46 is missing
this change to the compiler invocation, which allows tests to run
on Linux even when `--library-install-path` and
`--module-install-path` are not specified.
modocache added a commit to modocache/swift that referenced this pull request Feb 19, 2016
Allow swift-corelibs-xctest to be built and tested on Linux and OS X,
via `utils/build-script --xctest --test`.

On OS X, XCTest is built via `xcodebuild`, which has been possible since
swiftlang/swift-corelibs-xctest#47. It's tested via
the "SwiftXCTestFunctionalTests" Xcode target. Keep in mind that
`xcodebuild` must be configured on the host machine to use a Swift
toolchain that can build XCTest--as of
swiftlang/swift-corelibs-xctest#48, that would be
`swift-DEVELOPMENT-SNAPSHOT-2016-02-08` or later.

On Linux, XCTest is built and tested via the project's
`build_script.py`, which has been possible since
swiftlang/swift-corelibs-xctest#46.
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.

3 participants