1
目录
目录.................................................................................................................................................................................................1
1. 序言.........................................................................................................................................................................................3
1) [引言] ..............................................................................................................................................................................3
2) [CppUnit 的简单身世].................................................................................................................................................... 3
3) [CppUnit 的总体构成].................................................................................................................................................... 3
4) [几点说明] ......................................................................................................................................................................4
2. 核心部分(Core)——基本测试类 .....................................................................................................................................4
1) [Test] ............................................................................................................................................................................... 4
2) [TestFixture]....................................................................................................................................................................5
3) [TestCase]........................................................................................................................................................................5
4) [TestSuite].......................................................................................................................................................................7
3. 核心部分(Core)——测试结果记录 .................................................................................................................................8
1) [SynchronizedObject]......................................................................................................................................................9
2) [TestListener] ................................................................................................................................................................10
3) [TestResult] ................................................................................................................................................................... 11
4. 核心部分(Core)——错误处理 .......................................................................................................................................13
1) [TestFailure]..................................................................................................................................................................13
2) [SourceLine]..................................................................................................................................................................15
3) [Exception]....................................................................................................................................................................16
4) [NotEqualException].....................................................................................................................................................18
5. 核心部分(Core)——断言 ...............................................................................................................................................19
1) [Asserter].......................................................................................................................................................................19
2) [TestAssert] ................................................................................................................................................................... 20
6. 输出部分(Output)——基础部件 ....................................................................................................................................23
1) [Outputter].....................................................................................................................................................................23
2) [TestResultCollector] ....................................................................................................................................................24
7. 输出部分(Output)——衍生类 ........................................................................................................................................26
1) [TextOutputter]..............................................................................................................................................................26
2) [CompilerOutputter]...................................................................................................................................................... 27
3) [XmlOutputter]..............................................................................................................................................................29
8. 辅助部分(Helper)——创建机制 ....................................................................................................................................35
1) [TypeInfoHelper]...........................................................................................................................................................36
2) [TestFactory] .................................................................................................................................................................36
3) [TestFactoryRegistry,NamedRegistries] ....................................................................................................................36
4) [TestSuiteFactory].........................................................................................................................................................41
5) [TestSuiteBuilder] .........................................................................................................................................................42
6) [TestCaller]....................................................................................................................................................................44
7) [AutoRegisterSuite].......................................................................................................................................................47
9. 辅助部分(Helper)——HelperMacros .............................................................................................................................48
1) [HelperMacros] .............................................................................................................................................................48
10. 扩展部分(Extension) ...................................................................................................................................................55
1) [TestDecorator] .............................................................................................................................................................56
2) [RepeatedTest]...............................................................................................................................................................56