GitHunt
TO

togi/lemon

A simple, lightweight c++ unit-testing framework based on perl's Test::More.

~ lemon ~

lemon is a tiny, fast unit-testing framework designed to take almost no time
to set up.

~ philosophy ~

lemon is designed to be small, really small. That way you can worry less
about setting up the framework and more about writing tests.

~ installation ~

Just add lemon.h to your project or place it in a common directory for your
compiler (On Linux/Mac/Unix this might be /usr/local/include).

~ a not-so-bitter taste of lemon ~

To start writing tests in lemon:

  1. initialize lemon

lemon::test<> lemon(num_tests_which_you_plan_to_run);

  1. conduct tests

lemon.is(this_one_equal_to, that_one, descriptive_test_name);

  1. display results

lemon.done();

~ assertions ~

lemon provides a minimal but complete set of assertions:

  • ok(boolean_condition, descriptive_test_name)

  • not_ok(boolean_condition, descriptive_test_name)

  • is(this_one, that_one, descriptive_test_name)

  • isnt(this_one, that_one, descriptive_test_name)

  • pass(descriptive_test_name)

  • fail(descriptive_test_name)

  • skip(reason, num_to_skip)

  • todo(what)

Contributors

Created March 12, 2010
Updated December 14, 2012