No description, website, or topics provided.
Perl C C++ Makefile
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
COPYING
Makefile
README
copper-internal.c
copper.c
copper.h
copper.pl
testexamples.c

README

Copper is a unit testing and debugging framework designed for new 
projects. It focuses on easy integration and extremely easy addition of 
tests. Other C unit testing frameworks require the developer to not only 
write the test but then also add the test to a test suite or a test list.  
This extra busywork discourages programmers from writing tests. With 
copper, the developer must only add a single line per test, a 
header include that also defines some very useful debugging macros and a 
few lines to the application's makefile.

Because Copper generates source code output that includes significant 
portions of the copper source code that has processes to fit in with your 
project, Copper's output is subject to the same licensing as the copper 
distribution, scripts, and sourcecode. See 
http://www.gnu.org/licenses/gpl-faq#GPLOutput for more information.

EXAMPLE
in some-c-module.c:

#include "copper/copper.h"

some_c_function() {
...
}

TEST((some_c_function(some_test_input) == some_expected_output));
TEST((some_c_function(another_test_input) == another_expected_output));

TEST({
  some_setup_code();
  A((some_c_function(some_more_test_input) == some_more_expected_output));
});

That's all it takes to define 3 tests.  some_c_function may even be 
declared static. It's that easy!

See also the Makefile included in the copper distribution for an example 
makefile.