Skip to content

[SR-906] Allow XCTestCase.continueAfterFailure to be set #403

Open
@modocache

Description

@modocache
mannequin
Previous ID SR-906
Radar None
Original Reporter @modocache
Type Improvement
Additional Detail from JIRA
Votes 2
Component/s XCTest
Labels Improvement
Assignee None
Priority Medium

md5: 8a68ba9a31eeee0ca919922b7bddbeee

Issue Description:

XCTestCase.continueAfterFailure currently always returns true, no matter what: https://github.com/apple/swift-corelibs-xctest/blob/d28cbd679e407bda760ce7a862c062de4b6912c8/Sources/XCTest/XCTestCase.swift#L65-L72

However, as of #40 there is no reason for this attribute to always return true--if a user sets it to false, it should currently work (grep the codebase for "continueAfterFailure" to see for yourself).

1. Remove the custom setter/getter from continueAfterFailure in order to allow it to be set to true/false by the user.
2. Add functional tests that confirm the test suite stops when continueAfterFailure is false. This might be tricky--a false value for continueAfterFailure causes the test to throw a fatalError, and none of the functional tests currently test this sort of behavior. Still, I don't think this will require any massive changes to the testing architecture in the repo. Start by adding a simple test case that uses continueAfterFailure and check the output. It should be similar to other functional test output.

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