Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation: Why write it? #12

Open
DarrenCook opened this issue May 5, 2015 · 1 comment
Open

Documentation: Why write it? #12

DarrenCook opened this issue May 5, 2015 · 1 comment

Comments

@DarrenCook
Copy link

I started using Catch recently, and then saw this library mentioned somewhere. In the Readme you describe it as based on the ideas of Catch. It would be useful to see some kind of comparison with Catch, such as "it is like Catch (as of version 1.1) but adds XXX and YYY. On the downside it doesn't have ZZZ of Catch, and Catch compiles more quickly".

Unless it was a personal exercise in writing a unit test framework, I assume there is an XXX and YYY? :-)

@martinmoene
Copy link
Owner

Hi Darren,

That's a nice angle to provide more context to lest. To answer some of it now/here:

It started as a personal exercise with C++11 lambda-based tests when I encountered the tests for optional by Andrzej Krzemieński. I already had been following the development of C++98 Catch, had been porting it to VC6 and wondered how C++11 would affect writing a tiny test framework that incorporates ideas from Kevlin Henney found in Catch such as the expression-decomposing assertion macros.

So C++11, lambdas and tiny where the drivers to write lest. I wanted lest to be small enough to be read in a few minutes to show how a simple test framework may look like and to make it easy to grasp how expression-decomposition may work.

Test failure reporting of lest is also different from the one Catch uses at default: I preferred a compiler-like reporting on a single line. In line with this, I contributed the compact reporter to Catch.

During lest's lifetime, focus has shifted to making it more usable, e.g. by including several commandline options that Catch provides.

As I'm also still working with VC6, creating a (less capable) version of lest for C++98/C++03 followed. Further I added automatic test registration to C++11 lest as found in Catch and C++98/03 lest for 1) compatibility and 2) quicker compilation.

As with Catch, I like to use (uppercase) macros instead of C++11 constructs as that visually separates test framework code from code of the actual test.

Hopefully this answers your question. I'll think about how I can incorporate some of this into the lest's Readme.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants