![]() |
![]() |
![]() |
Cutter Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
CppCutter provides C++ friendly interface of Cutter. If you want to write tests with C++, it's good idea that you consider CppCutter to be used too.
It's easy to use CppCutter. You just include <cppcutter.h> instead of <cutter.h> and use cppcutter.pc instead of cutter.pc:
test-xxx.cpp:
-#include <cutter.h> +#include <cppcutter.h>
configure.ac:
-AC_CHECK_CUTTER +AC_CHECK_CPPCUTTER
Makefile.am:
-XXX_CFLAGS = $(CUTTER_CFLAGS) -XXX_LIBS = $(CUTTER_LIBS) +XXX_CFLAGS = $(CPPCUTTER_CFLAGS) +XXX_LIBS = $(CPPCUTTER_LIBS)
NOTE: You need to extern test functions in C scope. See
CPPCUT_BEGIN_TEST_DECLS
.
#define CPPCUT_BEGIN_TEST_DECLS extern "C" {
Use CPPCUT_BEGIN_TEST_DECLS
and CPPCUT_END_TEST_DECLS
pair for prototype declarations for test functions:
CPPCUT_BEGIN_TEST_DECLS void test_add (); void test_remove (); CPPCUT_END_TEST_DECLS
Those macros just surround prototype declarations for test functions with 'extern "C" {...}'.
Since 1.0.9