Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: Doctest – C++ single-header testing framework (github.com/onqtam)
55 points by onqtam on May 23, 2016 | hide | past | favorite | 8 comments



"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


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.


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


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 ]


weird they didn't compare with clang...


no access to a linux machine - otherwise I might have tested with clang too. Also you may try the bench.py script yourself :)

But this is not a benchmark of compilers but a benchmark between doctest and the other such library - and this comparison should be compiler-neutral

And if on some compiler the difference is not 50 but 20 times - it would still be amazing!


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

Has this been fixed?


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




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: