You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
EXAMPLE 2: Test suite name provides context info for test-cases
// -- FILE: test_example2_with_testsuites.cpp
#include"doctest/doctest.h"TEST_SUITE("Function A") {
TEST_CASE("It should succeed if ...") { ... }
TEST_CASE("It should fail if ...") { ... }
...
}
TEST_SUITE("Function B") {
TEST_CASE("It should succeed if ...") { ... }
TEST_CASE("It should fail if ...") { ... }
...
}
CONSIDERED ALTERNATIVES: TEST_CASE/SUB_CASE combination
This disambiguates the example above
This combines the TEST_CASE name with the SUB_CASE name in one <testcase name="{TEST_CASE.name}/{SUBCASE.name}" /> XML element
The testcase.name can become rather large
BUT: The grouping gets slightly lost or must be rediscovered from the name info.
Extra information
DESIRED CHANGE:
Add methods to doctest::Reporter to add testsuite entry/exit.
Default implementation of these methods could be empty (to avoid to break existing reporters).
Call theses methods when a testsuite entry/exit is encountered by the doctest framework
NICE TO HAVE:
An extended junit reporter implementation that uses this additional testsuite context information to create the test report with the desired information
VERSION INFO:
doctest version: v2.4.11
The text was updated successfully, but these errors were encountered:
Description
Currently, the
doctest::IReporter
interface lacks methods to addtest-suite
information.CURRENT STATE:
junit
reporter just provides only<testsuite/>
XML element(s) for the test-program that is executednested testsuite(s)
, meaning a<testsuite/>
XML element(s) within another<testsuite/>
XML element.BUT:
nested testsuites
map well to the concept howtestsuites
are used in the C++ source code.NOTES:
Steps to reproduce
MOTIVATING EXAMPLE:
When you build the test program and run it with
... --reporters=junit
, you get the following JUnitXML report:PROBLEM:
DESIRED OUTPUT:
EXAMPLE 2: Test suite name provides context info for test-cases
CONSIDERED ALTERNATIVES:
TEST_CASE/SUB_CASE
combinationTEST_CASE
name with theSUB_CASE
name in one<testcase name="{TEST_CASE.name}/{SUBCASE.name}" />
XML elementtestcase.name
can become rather largename
info.Extra information
DESIRED CHANGE:
doctest::Reporter
to addtestsuite
entry/exit.testsuite
entry/exit is encountered by thedoctest
frameworkNICE TO HAVE:
junit
reporter implementation that uses this additionaltestsuite
context information to create the test report with the desired informationVERSION INFO:
The text was updated successfully, but these errors were encountered: