Skip to content

Compatibility with Swift Testing traits #5

Open
@Uncommon

Description

@Uncommon

The Trait protocol has a prepare(for:) function that wouldn't be useful until Swift Testing exposes a public way to construct a Test. But traits that don't rely on that could be used, and Rundown could have its own trait protocol that is maybe made compatible via extensions.

Notes on existing traits:

  • Comment: just a text comment. Is it added automatically by the macro? How is it logged/used?
  • Bug: How is it logged? Does the URL field have a particular purpose?
  • ConditionTrait: good for platform-specific tests
  • ParallelizationTrait: makes parameterized tests run in parallel
  • TimeLimitTrait: apparently fails if the test takes too long. Is there an abort mechanism?
  • Tag: add arbitrary tags

Comment and Bug conform to TestTrait via extension. ConditionTrait.prepare(for:) doesn't use the given test, and an alternative version can be added that just evaluates the condition. Also, it throws SkipInfo if the condition fails.

TimeLimitTrait only contains the time limit, and provides functions for creating and calculating limits, plus a global withTimeLimit function for running a test (or any callback) with a callback.

But the problem is too many elements are not public.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions