Tag: boost test

CMake:unit testing的项目结构

我想构build我的项目,包括生产源(在src子文件夹)和testing(在test子文件夹)。 我正在使用CMake来build立这个。 作为一个最小的例子,我有以下文件: 的CMakeLists.txt: cmake_minimum_required (VERSION 2.8) project (TEST) add_subdirectory (src) add_subdirectory (test) SRC /的CMakeLists.txt: add_executable (demo main.cpp sqr.cpp) SRC / sqr.h #ifndef SQR_H #define SQR_H double sqr(double); #endif // SQR_H SRC / sqr.cpp #include "sqr.h" double sqr(double x) { return x*x; } src / main.cpp – 使用sqr,并不重要 testing/的CMakeLists.txt: find_package(Boost COMPONENTS system filesystem unit_test_framework REQUIRED) […]

c ++unit testing框架的比较

我知道关于c ++unit testing框架的推荐已经有几个问题,但是所有的答案都没有帮助,因为他们只是推荐一个框架,但是没有提供关于(function)比较的任何信息。 我认为最有趣的框架是CppUnit,Boost和新的Googletesting框架。 有没有人做过比较?