
Show HN: Doctest – C++ single-header testing framework - onqtam
https://github.com/onqtam/doctest
======
optforfon
"You can just write the tests for a class or a piece of functionality at the
bottom of it's source file - or even header file!"

Woah.. this makes it so easy I might even use it. I'm really not a fan of TDD
b/c it explodes the number of things you have to maintain - but the way this
is rolled in with the documentation makes it quite appealing. Thank you so
much for you work. If I start to use this regularly, I'll make sure to donate

------
gravypod
I think this is great. The best part of this is that there has been an obvious
large amount of thought put into the programmer-interface to this library.

It just plain looks great. I'll have to give a try some time soon.

------
RossBencina
I would like to see benchmark that compares run-time performance with Catch.

~~~
e12e
That, and a motivation/design-comparison with catch. From the readme, and a
quick look - I couldn't really tell how this improves on catch, except for
compile times (presumably mostly in the case where the lib generates main, as
factoring this out is recommended for catch).

[ed: catch provides both bdd and tdd forms of tests, while this doesn't help
lift comments up to the level of tests, unlike its python inspiration - which
is understandable, but a bit confusing, given the name.]

[ed2: for an intro to catch, see eg: "CppCon 2015: Phil Nash “Test Driven C++
with Catch":
[https://m.youtube.com/watch?v=gdzP3pAC6UI](https://m.youtube.com/watch?v=gdzP3pAC6UI)
]

------
je42
weird they didn't compare with clang...

~~~
gravypod
I just gave it a test on my end. G++ and clang++ are both compiling without
warning it seems.

Has this been fixed?

~~~
onqtam
what should be fixed? You said there were no warnings...?

