Printing the test suite name on test case failure - fixes #65
diff --git a/examples/all_features/test_output/assertion_macros.cpp.txt b/examples/all_features/test_output/assertion_macros.cpp.txt
index e1e2d76..1585579 100644
--- a/examples/all_features/test_output/assertion_macros.cpp.txt
+++ b/examples/all_features/test_output/assertion_macros.cpp.txt
@@ -1,7 +1,7 @@
[doctest] run with "--help" for options
-== TEST CASE ==================================================================
+===============================================================================
assertion_macros.cpp(0)
-normal macros
+TEST CASE: normal macros
assertion_macros.cpp(0) ERROR!
CHECK( throw_if(true, std::runtime_error("whops!")) == 42 )
@@ -13,9 +13,9 @@
with expansion:
CHECK( Approx( 0.502 ) == 0.501 )
-== TEST CASE ==================================================================
+===============================================================================
assertion_macros.cpp(0)
-exceptions-related macros
+TEST CASE: exceptions-related macros
assertion_macros.cpp(0) ERROR!
CHECK_THROWS( throw_if(false, 0) )
@@ -35,9 +35,9 @@
threw exception:
0
-== TEST CASE ==================================================================
+===============================================================================
assertion_macros.cpp(0)
-exceptions-related macros for std::exception
+TEST CASE: exceptions-related macros for std::exception
assertion_macros.cpp(0) ERROR!
CHECK_THROWS( throw_if(false, 0) )
@@ -57,9 +57,9 @@
threw exception:
whops!
-== TEST CASE ==================================================================
+===============================================================================
assertion_macros.cpp(0)
-WARN level of asserts don't fail the test case
+TEST CASE: WARN level of asserts don't fail the test case
assertion_macros.cpp(0) WARNING!
WARN( 0 )
@@ -119,9 +119,9 @@
with expansion:
FAST_WARN_UNARY_FALSE( 1 )
-== TEST CASE ==================================================================
+===============================================================================
assertion_macros.cpp(0)
-CHECK level of asserts fail the test case but don't abort it
+TEST CASE: CHECK level of asserts fail the test case but don't abort it
assertion_macros.cpp(0) ERROR!
CHECK( 0 )
@@ -184,106 +184,106 @@
assertion_macros.cpp(0) MESSAGE!
reached!
-== TEST CASE ==================================================================
+===============================================================================
assertion_macros.cpp(0)
-REQUIRE level of asserts fail and abort the test case - 1
+TEST CASE: REQUIRE level of asserts fail and abort the test case - 1
assertion_macros.cpp(0) FATAL ERROR!
REQUIRE( 0 )
with expansion:
REQUIRE( 0 )
-== TEST CASE ==================================================================
+===============================================================================
assertion_macros.cpp(0)
-REQUIRE level of asserts fail and abort the test case - 2
+TEST CASE: REQUIRE level of asserts fail and abort the test case - 2
assertion_macros.cpp(0) FATAL ERROR!
REQUIRE_FALSE( 1 )
with expansion:
REQUIRE_FALSE( 1 )
-== TEST CASE ==================================================================
+===============================================================================
assertion_macros.cpp(0)
-REQUIRE level of asserts fail and abort the test case - 3
+TEST CASE: REQUIRE level of asserts fail and abort the test case - 3
assertion_macros.cpp(0) FATAL ERROR!
REQUIRE_THROWS( throw_if(false, 0) )
didn't throw at all
-== TEST CASE ==================================================================
+===============================================================================
assertion_macros.cpp(0)
-REQUIRE level of asserts fail and abort the test case - 4
+TEST CASE: REQUIRE level of asserts fail and abort the test case - 4
assertion_macros.cpp(0) FATAL ERROR!
REQUIRE_THROWS_AS( throw_if(false, 0), bool )
didn't throw at all
-== TEST CASE ==================================================================
+===============================================================================
assertion_macros.cpp(0)
-REQUIRE level of asserts fail and abort the test case - 5
+TEST CASE: REQUIRE level of asserts fail and abort the test case - 5
assertion_macros.cpp(0) FATAL ERROR!
REQUIRE_THROWS_AS( throw_if(true, 0), bool )
threw a different exception:
0
-== TEST CASE ==================================================================
+===============================================================================
assertion_macros.cpp(0)
-REQUIRE level of asserts fail and abort the test case - 6
+TEST CASE: REQUIRE level of asserts fail and abort the test case - 6
assertion_macros.cpp(0) FATAL ERROR!
REQUIRE_NOTHROW( throw_if(true, 0) )
threw exception:
0
-== TEST CASE ==================================================================
+===============================================================================
assertion_macros.cpp(0)
-REQUIRE level of asserts fail and abort the test case - 7
+TEST CASE: REQUIRE level of asserts fail and abort the test case - 7
assertion_macros.cpp(0) FATAL ERROR!
REQUIRE_EQ( 1, 0 )
with expansion:
REQUIRE_EQ( 1, 0 )
-== TEST CASE ==================================================================
+===============================================================================
assertion_macros.cpp(0)
-REQUIRE level of asserts fail and abort the test case - 8
+TEST CASE: REQUIRE level of asserts fail and abort the test case - 8
assertion_macros.cpp(0) FATAL ERROR!
REQUIRE_UNARY( 0 )
with expansion:
REQUIRE_UNARY( 0 )
-== TEST CASE ==================================================================
+===============================================================================
assertion_macros.cpp(0)
-REQUIRE level of asserts fail and abort the test case - 9
+TEST CASE: REQUIRE level of asserts fail and abort the test case - 9
assertion_macros.cpp(0) FATAL ERROR!
REQUIRE_UNARY_FALSE( 1 )
with expansion:
REQUIRE_UNARY_FALSE( 1 )
-== TEST CASE ==================================================================
+===============================================================================
assertion_macros.cpp(0)
-REQUIRE level of asserts fail and abort the test case - 10
+TEST CASE: REQUIRE level of asserts fail and abort the test case - 10
assertion_macros.cpp(0) FATAL ERROR!
FAST_REQUIRE_EQ( 1, 0 )
with expansion:
FAST_REQUIRE_EQ( 1, 0 )
-== TEST CASE ==================================================================
+===============================================================================
assertion_macros.cpp(0)
-REQUIRE level of asserts fail and abort the test case - 11
+TEST CASE: REQUIRE level of asserts fail and abort the test case - 11
assertion_macros.cpp(0) FATAL ERROR!
FAST_REQUIRE_UNARY( 0 )
with expansion:
FAST_REQUIRE_UNARY( 0 )
-== TEST CASE ==================================================================
+===============================================================================
assertion_macros.cpp(0)
-REQUIRE level of asserts fail and abort the test case - 12
+TEST CASE: REQUIRE level of asserts fail and abort the test case - 12
assertion_macros.cpp(0) FATAL ERROR!
FAST_REQUIRE_UNARY_FALSE( 1 )
diff --git a/examples/all_features/test_output/header.h.txt b/examples/all_features/test_output/header.h.txt
index d096dca..dd79824 100644
--- a/examples/all_features/test_output/header.h.txt
+++ b/examples/all_features/test_output/header.h.txt
@@ -1,19 +1,20 @@
[doctest] run with "--help" for options
-== TEST CASE ==================================================================
+===============================================================================
header.h(0)
-in TS
+TEST SUITE: some TS
+TEST CASE: in TS
header.h(0) FATAL ERROR!
-== TEST CASE ==================================================================
+===============================================================================
header.h(0)
-template 1<char>
+TEST CASE: template 1<char>
header.h(0) FATAL ERROR!
-== TEST CASE ==================================================================
+===============================================================================
header.h(0)
-template 2<doctest::String>
+TEST CASE: template 2<doctest::String>
header.h(0) FATAL ERROR!
diff --git a/examples/all_features/test_output/logging.cpp.txt b/examples/all_features/test_output/logging.cpp.txt
index c6c02b6..5e2b391 100644
--- a/examples/all_features/test_output/logging.cpp.txt
+++ b/examples/all_features/test_output/logging.cpp.txt
@@ -1,7 +1,7 @@
[doctest] run with "--help" for options
-== TEST CASE ==================================================================
+===============================================================================
logging.cpp(0)
-logging the counter of a loop
+TEST CASE: logging the counter of a loop
logging.cpp(0) ERROR!
CHECK( vec[i] != (1 << i) )
@@ -43,9 +43,9 @@
current iteration of loop:
i := 4
-== TEST CASE ==================================================================
+===============================================================================
logging.cpp(0)
-a test case that will end from an exception
+TEST CASE: a test case that will end from an exception
logging.cpp(0) ERROR!
CHECK( some_var == 666 )
@@ -61,9 +61,9 @@
threw exception:
0
-== TEST CASE ==================================================================
+===============================================================================
logging.cpp(0)
-third party asserts can report failures to doctest
+TEST CASE: third party asserts can report failures to doctest
logging.cpp(0) ERROR!
MY_ASSERT(false)
@@ -71,9 +71,9 @@
logging.cpp(0) FATAL ERROR!
MY_ASSERT_FATAL(false)
-== TEST CASE ==================================================================
+===============================================================================
logging.cpp(0)
-explicit failures 1
+TEST CASE: explicit failures 1
logging.cpp(0) ERROR!
this should not end the test case, but mark it as failing
@@ -81,9 +81,9 @@
logging.cpp(0) MESSAGE!
reached!
-== TEST CASE ==================================================================
+===============================================================================
logging.cpp(0)
-explicit failures 2
+TEST CASE: explicit failures 2
logging.cpp(0) FATAL ERROR!
fail the test case and also end it
diff --git a/examples/all_features/test_output/stringification.cpp.txt b/examples/all_features/test_output/stringification.cpp.txt
index 058fc0f..4a8fb04 100644
--- a/examples/all_features/test_output/stringification.cpp.txt
+++ b/examples/all_features/test_output/stringification.cpp.txt
@@ -1,7 +1,7 @@
[doctest] run with "--help" for options
-== TEST CASE ==================================================================
+===============================================================================
stringification.cpp(0)
-all asserts should fail and show how the objects get stringified
+TEST CASE: all asserts should fail and show how the objects get stringified
stringification.cpp(0) ERROR!
CHECK( f1 == f2 )
@@ -27,9 +27,9 @@
threw exception:
MyTypeInherited<int>(5, 4.0f)
-== TEST CASE ==================================================================
+===============================================================================
stringification.cpp(0)
-a test case that registers an exception translator for int and then throws one
+TEST CASE: a test case that registers an exception translator for int and then throws one
TEST CASE FAILED!
threw exception:
diff --git a/examples/all_features/test_output/subcases.cpp.txt b/examples/all_features/test_output/subcases.cpp.txt
index b6997b1..97532ec 100644
--- a/examples/all_features/test_output/subcases.cpp.txt
+++ b/examples/all_features/test_output/subcases.cpp.txt
@@ -10,29 +10,29 @@
root
2
-== TEST CASE ==================================================================
+===============================================================================
subcases.cpp(0)
-lots of nested subcases
+TEST CASE: lots of nested subcases
subcases.cpp(0) FATAL ERROR!
-== TEST CASE ==================================================================
+===============================================================================
subcases.cpp(0)
-subcases can be used in a separate function as well
+TEST CASE: subcases can be used in a separate function as well
sc1
subcases.cpp(0) MESSAGE!
hello! from sc1
-== TEST CASE ==================================================================
+===============================================================================
subcases.cpp(0)
-subcases can be used in a separate function as well
+TEST CASE: subcases can be used in a separate function as well
sc2
subcases.cpp(0) MESSAGE!
hello! from sc2
-== TEST CASE ==================================================================
+===============================================================================
subcases.cpp(0)
Scenario: vectors can be sized and resized
Given: A vector with some items
@@ -44,7 +44,7 @@
with expansion:
CHECK( 10 == 20 )
-== TEST CASE ==================================================================
+===============================================================================
subcases.cpp(0)
Scenario: vectors can be sized and resized
Given: A vector with some items
diff --git a/examples/all_features/test_output/templated_test_cases.cpp.txt b/examples/all_features/test_output/templated_test_cases.cpp.txt
index 1a28b33..e8c2b4f 100644
--- a/examples/all_features/test_output/templated_test_cases.cpp.txt
+++ b/examples/all_features/test_output/templated_test_cases.cpp.txt
@@ -1,43 +1,43 @@
[doctest] run with "--help" for options
-== TEST CASE ==================================================================
+===============================================================================
templated_test_cases.cpp(0)
-vector stuff<std::vector<int>>
+TEST CASE: vector stuff<std::vector<int>>
templated_test_cases.cpp(0) ERROR!
CHECK( vec.size() == 20 )
with expansion:
CHECK( 10 == 20 )
-== TEST CASE ==================================================================
+===============================================================================
templated_test_cases.cpp(0)
-multiple types<>
+TEST CASE: multiple types<>
templated_test_cases.cpp(0) ERROR!
CHECK( t2 != T2() )
with expansion:
CHECK( 0 != 0 )
-== TEST CASE ==================================================================
+===============================================================================
templated_test_cases.cpp(0)
-multiple types<>
+TEST CASE: multiple types<>
templated_test_cases.cpp(0) ERROR!
CHECK( t2 != T2() )
with expansion:
CHECK( 0 != 0 )
-== TEST CASE ==================================================================
+===============================================================================
templated_test_cases.cpp(0)
-multiple types<>
+TEST CASE: multiple types<>
templated_test_cases.cpp(0) ERROR!
CHECK( t2 != T2() )
with expansion:
CHECK( 0 != 0 )
-== TEST CASE ==================================================================
+===============================================================================
templated_test_cases.cpp(0)
-bad stringification of type pair<int_pair>
+TEST CASE: bad stringification of type pair<int_pair>
templated_test_cases.cpp(0) ERROR!
CHECK( t2 != T2() )
diff --git a/examples/all_features/test_output/test_cases_and_suites.cpp.txt b/examples/all_features/test_output/test_cases_and_suites.cpp.txt
index b085079..9bd9c30 100644
--- a/examples/all_features/test_output/test_cases_and_suites.cpp.txt
+++ b/examples/all_features/test_output/test_cases_and_suites.cpp.txt
@@ -1,33 +1,36 @@
[doctest] run with "--help" for options
-== TEST CASE ==================================================================
+===============================================================================
test_cases_and_suites.cpp(0)
-should fail because of an exception
+TEST CASE: should fail because of an exception
TEST CASE FAILED!
threw exception:
0
-== TEST CASE ==================================================================
+===============================================================================
test_cases_and_suites.cpp(0)
-part of scoped
+TEST SUITE: scoped test suite
+TEST CASE: part of scoped
test_cases_and_suites.cpp(0) FATAL ERROR!
-== TEST CASE ==================================================================
+===============================================================================
test_cases_and_suites.cpp(0)
-part of scoped 2
+TEST SUITE: scoped test suite
+TEST CASE: part of scoped 2
test_cases_and_suites.cpp(0) FATAL ERROR!
-== TEST CASE ==================================================================
+===============================================================================
test_cases_and_suites.cpp(0)
-part of some TS
+TEST SUITE: some TS
+TEST CASE: part of some TS
test_cases_and_suites.cpp(0) FATAL ERROR!
-== TEST CASE ==================================================================
+===============================================================================
test_cases_and_suites.cpp(0)
-fixtured test - not part of a test suite
+TEST CASE: fixtured test - not part of a test suite
test_cases_and_suites.cpp(0) ERROR!
CHECK( data == 85 )