Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FEATURE: Support for decorator data that can be used in a test report by a reporter #798

Open
jenisys opened this issue Aug 29, 2023 · 0 comments

Comments

@jenisys
Copy link

jenisys commented Aug 29, 2023

Description

Currently, the decorator works fine for already defined, built-in decorators.
But the functionality is really limited for adding new decorators to doctest.

What is missing is some kind of named annotations storage in a test case.
This mechanism would allow to store decorator name as a string to a test_case (or test_suite), like:

// — EXAMPLE:
#include <doctest/doctest.h>
#include <my_doctest_ext/decorator_verifies.h>TEST_CASE(„Some test …“ * my_doctest_ext::verifies(„REQ-ID_0815“)) {
   … // — TEST IMPLEMENTATION DETAILS (left out here)
}

// — ALTERNATIVE: Direct support of annotations as test decorator
TEST_CASE(„Other test …“ * my_doctest_ext::annotation(„verifies“, „REQ-ID_0816“)) {
   … // — TEST IMPLEMENTATION DETAILS (left out here)
}

DESIRED FUNCTIONALITY:

  • My own decorator stores its param(s) in the test case, like:
test_case.add_annotation(„verifies“, „REQ-ID_0815“);  // OR SIMILAR

During the test run:

  • A test reporter could retrieve the annotations and show/store them in the test report
  • For JUnitXML, the annotations can be stored as properties of the test-case.

OTHERWISE:

  • A similar functionality with named annotations will also be needed for a test-suite (out-of-symmetry)
  • NICE TO HAVE: Ability to use add_annotation(…) in the body of a test-case.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant