Live data from Hacker News

Catch: A modern, C++-native, header-only, framework for unit tests

github.com

1–10 of 31 posts

Re: Catch: A modern, C++-native, header-only, framework for unit tests

#3
post #2

This looks hella good, I particularly am intrigued by the nested setup/teardown system. The natural assert syntax is interesting, too, amazing what macros can accomplish. Appropriately, the first question that came to mind was, "what's the catch?" :)

Yup. I found it interesting after a co-worker pointed it out to me because it looks and works kind of like RSpec. We are currently considering using it for a new project and it seems mature enough to give it a go.

I'm currently toying with writing a JSONReporter so we can use that as an additional test result output format and I agree, so far it seems to be a really well done project.

Re: Catch: A modern, C++-native, header-only, framework for unit tests

#7
I don't really see the advantage of Catch over http://unittest-cpp.sourceforge.net/

UnitTest++ was written by Noel Llopis, is small, tasteful, fast, and supports fixtures (and nested fixtures) via structs and struct inheritance.

Honest question: Why would I use Catch instead?

Re: Catch: A modern, C++-native, header-only, framework for unit tests

#8

I don't really see the advantage of Catch over http://unittest-cpp.sourceforge.net/ UnitTest++ was written by Noel Llopis, is small, tasteful, fast, and supports fixtures (and nested fixtures) via structs and struct inheritance. Honest question: Why would I use Catch instead?

I'm in the same boat (having used UnitTest++ for years) and I wonder the same, though I do see some points already:

- adding a custom main() to unittest++ was pretty messy

- unittest++ is not single-header, meaning you have to recompile all flavours everytime you switch toolsets

- that nested sections stuff looks good and readable, so even though it might be doable with unittest++, this really attracts me more

That being said, I would like to hear from the author or anyone else who can compare them. But likely I'm going to use this for the next project just to check it out.

Re: Catch: A modern, C++-native, header-only, framework for unit tests

#9

I don't really see the advantage of Catch over http://unittest-cpp.sourceforge.net/ UnitTest++ was written by Noel Llopis, is small, tasteful, fast, and supports fixtures (and nested fixtures) via structs and struct inheritance. Honest question: Why would I use Catch instead?

I'm a big fan of UnitTest++, but one thing that would tempt me about Catch is the single header file.
Post reply on HN