Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 980fbdf

Browse files
lewissbakerLewis Baker
authored andcommitted
Make doctest output the name of the test before running it.
1 parent 0b68f6f commit 980fbdf

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

test/doctest/doctest.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5599,7 +5599,14 @@ namespace doctest
55995599
if ((p->last < p->numTestsPassingFilters && p->first <= p->last) ||
56005600
(p->first > p->numTestsPassingFilters))
56015601
continue;
5602-
5602+
5603+
// Print the test name before running it.
5604+
// This makes it easier to identify a which test a crash occurs in.
5605+
if (!p->success) {
5606+
std::printf("%s\n", data.m_name);
5607+
std::fflush(stdout);
5608+
}
5609+
56035610
// execute the test if it passes all the filtering
56045611
{
56055612
p->currentTest = &data;

0 commit comments

Comments
 (0)