Cxxtest
CxxTest Unit Testing Framework
Install / Use
/learn @CxxTest/CxxtestREADME
Overview
CxxTest is a unit testing framework for C++ that is similar in spirit to JUnit, CppUnit, and xUnit. CxxTest is easy to use because it does not require precompiling a CxxTest testing library, it employs no advanced features of C++ (e.g. RTTI) and it supports a very flexible form of test discovery.
CxxTest is available under the GNU Lesser General Public Licence (LGPL).
A user guide can be downloaded from http://cxxtest.com.
A Simple Example
- Create a test suite header file:
MyTestSuite.h:
#include <cxxtest/TestSuite.h>
class MyTestSuite : public CxxTest::TestSuite { public: void testAddition( void ) { TS_ASSERT( 1 + 1 > 1 ); TS_ASSERT_EQUALS( 1 + 1, 2 ); } };
- Generate the tests file:
cxxtestgen --error-printer -o tests.cpp MyTestSuite.h
- Compile and run!
g++ -o main tests.cpp
./main
Running cxxtest tests (1 test).OK!
Related Skills
node-connect
347.9kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
108.7kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
347.9kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
347.9kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
