CategoryTesting: TestingFramework for the CeeLanguage * http://cutter.sourceforge.net/ * http://cutter.sourceforge.net/reference/readme.html * http://cutter.sourceforge.net/reference/tutorial.html Cutter is an Unit Testing Framework for C. Cutter uses GLib as base utility library. Features: * Easy to write tests. ** TestCollector''''''s. Registering TestCase''''''s isn't required; they are detected automatically. * Outputs result with useful format for debugging. (e.g.: diff support) * Supports DataDrivenTesting. * Tests are built as shared libraries. * Console and GTK+ UserInterface. See http://cutter.sourceforge.net/reference/features.html for more details. An example test for stack from tutorial: #include #include void test_new_stack (void); void test_push (void); void test_pop (void); static Stack *stack; void setup (void) { stack = NULL; } void teardown (void) { if (stack) stack_free(stack); } void test_new_stack (void) { stack = stack_new(); cut_assert(stack_is_empty(stack)); } void test_push (void) { stack = stack_new(); cut_assert_equal_int(0, stack_get_size(stack)); stack_push(stack, 100); cut_assert_equal_int(1, stack_get_size(stack)); cut_assert(!stack_is_empty(stack)); } void test_pop (void) { stack = stack_new(); stack_push(stack, 10); stack_push(stack, 20); stack_push(stack, 30); cut_assert_equal_int(3, stack_get_size(stack)); cut_assert_equal_int(30, stack_pop(stack)); cut_assert_equal_int(2, stack_get_size(stack)); cut_assert_equal_int(20, stack_pop(stack)); cut_assert_equal_int(1, stack_get_size(stack)); stack_push(stack, 40); cut_assert_equal_int(2, stack_get_size(stack)); cut_assert_equal_int(40, stack_pop(stack)); cut_assert_equal_int(1, stack_get_size(stack)); cut_assert_equal_int(10, stack_pop(stack)); cut_assert_equal_int(0, stack_get_size(stack)); cut_assert(stack_is_empty(stack)); } * Self test: http://cutter.svn.sourceforge.net/viewvc/cutter/trunk/test/ * Sample tests: http://cutter.svn.sourceforge.net/viewvc/cutter/trunk/sample/ ** GLib test: http://cutter.svn.sourceforge.net/viewvc/cutter/trunk/sample/glib/ ** Stack test for tutorial: http://cutter.svn.sourceforge.net/viewvc/cutter/trunk/sample/stack/