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.
Catch: A modern, C++-native, header-only, framework for unit tests
11–20 of 31 posts
Re: Catch: A modern, C++-native, header-only, framework for unit tests
#12This 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?" :)
Re: Catch: A modern, C++-native, header-only, framework for unit tests
#13I started working on something similar[1] a few days ago just as a proof of concept.
Re: Catch: A modern, C++-native, header-only, framework for unit tests
#14Re: Catch: A modern, C++-native, header-only, framework for unit tests
#15Re: Catch: A modern, C++-native, header-only, framework for unit tests
#16Definitely gonna give this a try.
Any recommended test runner to go with it?
Re: Catch: A modern, C++-native, header-only, framework for unit tests
#17This 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?" :)
The macro trick is at https://github.com/philsquared/Catch/blob/785db43bb2cd64bfe7... : planting the tested expression to the right of an operator ->*, which is overloadable and allows for changing the type of the left hand side in the comparison. The rest is a "simple matter of programming". Clever but probably a bit cute - errors would look weird if the expression isn't set up as expected.
https://github.com/philsquared/Catch/blob/785db43bb2cd64bfe7...
Re: Catch: A modern, C++-native, header-only, framework for unit tests
#18Great work. I love the fact that this encourages writing tests that are readable/documenting. Definitely gonna give this a try. Any recommended test runner to go with it?
Re: Catch: A modern, C++-native, header-only, framework for unit tests
#19Earlier quoted context omitted.
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.
FWIW I've been using Catch for a few years now, and I find it mature enough for real world usage.
Re: Catch: A modern, C++-native, header-only, framework for unit tests
#20I loved the project logo