Skip to content

[SR-1872] Use runloop source in XCTestCase.waitForExpectations(withTimeout:file:line:handler:) #384

Open
@modocache

Description

@modocache
Previous ID SR-1872
Radar None
Original Reporter @modocache
Type Improvement
Status In Progress
Resolution
Additional Detail from JIRA
Votes 0
Component/s XCTest
Labels Improvement, StarterBug
Assignee pranavShenoy95 (JIRA)
Priority Medium

md5: 2f80d90c1c1340fe3c193450551b82f7

Issue Description:

See this FIXME:

"Instead of polling the expectations to check whether they've been fulfilled, it would be more efficient to use a runloop source that can be signaled to wake up when an expectation is fulfilled."

Prerequisites:

  • A development environment capable of building Swift from source.

Helpful skills:
Familiarity with Swift, XCTest, and Foundation's NSRunLoop.

Starting point:

  1. Build Swift from source by following the instructions in the Swift README.

  2. Build and run the swift-corelibs-xctest tests by following the instructions in the swift-corelibs-xctest README. Confirm that all the tests pass.

  3. Modify the source code in XCTestCase+Asynchronous.swift to use a runloop source. The Apple documentation on run loops might be helpful.

  4. Run the swift-corelibs-xctest tests again. Confirm they all still pass. If they do, send a pull request!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions