CppCutter

CppCutter — Cutter with C++ support.

Synopsis

#define             CPPCUTTER_ENABLED
#define             CPPCUT_BEGIN_TEST_DECLS
#define             CPPCUT_END_TEST_DECLS

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.

Details

CPPCUTTER_ENABLED

#define CPPCUTTER_ENABLED 1

Defined when CppCutter is enabled.

Since 1.0.9


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


CPPCUT_END_TEST_DECLS

#define CPPCUT_END_TEST_DECLS }

See CPPCUT_BEGIN_TEST_DECLS.

Since 1.0.9

See Also

Assertions with C++ support