# testngpp-mockcpp-sample-src **Repository Path**: sinojelly/testngpp-mockcpp-sample-src ## Basic Information - **Project Name**: testngpp-mockcpp-sample-src - **Description**: This is a c++ sample project using testngpp and mockcpp with their source code. - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 2 - **Created**: 2021-03-16 - **Last Updated**: 2023-09-08 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # testngpp-with-mockcpp #### 介绍 Use testngpp as c++ test framework along with mockcpp. #### 编译说明 ``` cd tests .\build_test.ps1 ``` 它会自动先编译被测项目,再编译测试用例,最后运行用例。 #### testngpp vs catch2 1. 只修改一个测试用例文件,比较编译+运行用例的时间: - testngpp: 14 s - catch2: 70 s - 结果:testngpp 完胜。 2. 功能比较 - testngpp: 支持数据驱动的测试 (比如下面截图中的三组加法数据,自动生成三个测试用例, 对于被测方法不变,但是测试数据很多的情况下,可以极大减少工作量) - catch2: 支持 BDD 类型的用例编写 (与实例化需求分析的思路更一致。) - 结果:各有优势, testngpp 后面也可以加上 BDD 的支持 图1: testngpp 测试结果 ![](images/testngpp-13s-compile&run.PNG) 图2: catch2 测试结果 ![](images/catch2-70s-compile&run.PNG)