Skip to content

Add support for doctest #4240

@jcw

Description

@jcw
  • Feature Request.

The "doctest" unit test framework is a variant of "Catch2", but much simpler (and faster). I've been using this on native builds for some time now. For an example, tied into PIO for native, but still using Unity for embedded tests, see https://git.jeelabs.org/monty/tree/test?h=v1.6

See also doctest/doctest#506 which tries to run Doctest on embedded.

The key benefit, as with Catch2, is the amount of info you can see when tests fail, i.e. a test such as CHECK(abc == 42); then the actual value of abc will also be reported. Better still, you can capture other expressions tp print out, only on failure. This is such a game-changer that I've been going out of my way to test as much as possible on native (always a good strategy, of course).

If nothing else, I would be nice to support mixed doctest/unity testing, but supporting doctest on embedded would be even more powerful.

(This feature request was previously mentioned at #2185 (comment))

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions