Giter Club home page Giter Club logo

swift-corelibs-xctest's Introduction

XCTest

The XCTest library is designed to provide a common framework for writing unit tests in Swift, for Swift packages and applications.

This version of XCTest uses the same API as the XCTest you are familiar with from Xcode. Our goal is to enable your project's tests to run on all Swift platforms without having to rewrite them.

Current Status and Project Goals

This project is in the very earliest stages of development. It is scheduled to be part of the Swift 3 release.

Only the most basic functionality is currently present. This year, we have the following goals for the project:

  • Finish implementing support for the most important non-UI testing APIs present in XCTest for Xcode.
  • Develop an effective solution to the problem of test discoverability without the Objective-C runtime.
  • Provide support for efforts to standardize test functionality across the Swift stack.

For more details, visit the Documentation directory.

Using XCTest

Your tests are organized into a simple hierarchy. Each XCTestCase subclass has a set of test methods, each of which should test one part of your code.

You can find all kinds of useful information on using XCTest in Apple's documentation.

Contributing to XCTest

To contribute, you'll need to be able to build this project and and run its test suite. The easiest way to do so is via the Swift build script.

First, follow the instructions in the Swift README to build Swift from source. Confirm you're able to build the Swift project using utils/build-script -R.

Once you are able to build the Swift project, build XCTest and run its tests:

$ cd swift-corelibs-xctest
$ ../swift/utils/build-script --preset corelibs-xctest

This project is only guaranteed to build with the very latest commit on the Swift and swift-corelibs-foundation master branches. You may update to the latest commits using the Swift utils/update-checkout script:

$ ../swift/utils/update-checkout

Using Xcode

To browse files in this project using Xcode, use XCTest.xcworkspace. You may build the project using the "SwiftXCTest" scheme. Run the "SwiftXCTestFunctionalTests" scheme to run the tests.

However, in order to successfully build the project in Xcode, you must use an Xcode toolchain with an extremely recent version of Swift. The Swift website provides Xcode toolchains to download, as well as instructions on how to use Xcode with those toolchains. Swift development moves fairly quickly, and so even a week-old toolchain may no longer work.

If none of the toolchains available to download are recent enough to build XCTest, you may build your own toolchain by using the utils/build-toolchain script in the Swift repository.

Keep in mind that the build script invocation in "Contributing to XCTest" above will always work, regardless of which Swift toolchains you have installed. The Xcode workspace exists simply for the convenience of contibutors. It is not necessary to successfully build this project in Xcode in order to contribute.

swift-corelibs-xctest's People

Contributors

modocache avatar briancroom avatar parkera avatar marcusrossel avatar eschaton avatar ddunbar avatar gribozavr avatar dcci avatar douggregor avatar jonallured avatar jrose-apple avatar nsalmoria avatar phausler avatar codafi avatar seabaylea avatar adrfer avatar bryanpkc avatar lattner avatar thii avatar harlanhaskins avatar czechboy0 avatar imanuelcostigan avatar jamala avatar jasonnoahchoi avatar brownleej avatar keith avatar kylesyoon avatar mattrajca avatar kovpas avatar swiftix avatar

Watchers

James Cloos avatar PKCodeBox avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.