实例介绍
开源的UT框架 CPPUTest 3.6 用于单元测试 如何使用该框架可参考本人博客
【实例截图】
【核心代码】
4744300845378354515.zip
└── cpputest-3.6
├── aclocal.m4
├── AUTHORS
├── build
│ ├── alltests.mmp
│ ├── bld.inf
│ ├── ComponentMakefile
│ ├── ComponentMakefileExampleParameters
│ ├── cpputest.mmp
│ ├── MakefileWorker.mk
│ └── StaticLibMakefile
├── builds
│ └── make-gcc-macport.sh
├── ChangeLog
├── cmake
│ └── Modules
│ ├── CppUTestConfigurationOptions.cmake
│ ├── CppUTestWarningFlags.cmake
│ └── FindCXX11.cmake
├── CMakeLists.txt
├── compile
├── config.guess
├── config.h.cmake
├── config.h.in
├── config.sub
├── configure
├── configure.ac
├── COPYING
├── cpputest_doxy_gen.conf
├── CppUTest.dsw
├── cpputest-hist.txt
├── cpputest.pc.in
├── CppUTest.vcproj
├── CppUTest.vcxproj
├── CppUTest_VS2008.sln
├── CppUTest_VS2010.sln
├── depcomp
├── docs
│ └── WalkThrough_VS21010.docx
├── Doxyfile
├── examples
│ ├── AllTests
│ │ ├── AllTests.cpp
│ │ ├── CircularBufferTest.cpp
│ │ ├── EventDispatcherTest.cpp
│ │ ├── HelloTest.cpp
│ │ ├── MockDocumentationTest.cpp
│ │ ├── PrinterTest.cpp
│ │ └── RunAllTests.sh
│ ├── ApplicationLib
│ │ ├── AllTests.h
│ │ ├── CircularBuffer.cpp
│ │ ├── CircularBuffer.h
│ │ ├── EventDispatcher.cpp
│ │ ├── EventDispatcher.h
│ │ ├── ExamplesNewOverrides.h
│ │ ├── hello.c
│ │ ├── hello.h
│ │ ├── MockPrinter.h
│ │ ├── Printer.cpp
│ │ └── Printer.h
│ ├── CppUTestExample.dsw
│ ├── Makefile
│ └── README.txt
├── include
│ ├── CppUTest
│ │ ├── CommandLineArguments.h
│ │ ├── CommandLineTestRunner.h
│ │ ├── CppUTestConfig.h
│ │ ├── JUnitTestOutput.h
│ │ ├── MemoryLeakDetector.h
│ │ ├── MemoryLeakDetectorMallocMacros.h
│ │ ├── MemoryLeakDetectorNewMacros.h
│ │ ├── MemoryLeakWarningPlugin.h
│ │ ├── PlatformSpecificFunctions_c.h
│ │ ├── PlatformSpecificFunctions.h
│ │ ├── SimpleString.h
│ │ ├── StandardCLibrary.h
│ │ ├── TestFailure.h
│ │ ├── TestFilter.h
│ │ ├── TestHarness_c.h
│ │ ├── TestHarness.h
│ │ ├── TestMemoryAllocator.h
│ │ ├── TestOutput.h
│ │ ├── TestPlugin.h
│ │ ├── TestRegistry.h
│ │ ├── TestResult.h
│ │ ├── TestTestingFixture.h
│ │ ├── Utest.h
│ │ └── UtestMacros.h
│ ├── CppUTestExt
│ │ ├── CodeMemoryReportFormatter.h
│ │ ├── GMock.h
│ │ ├── GTestConvertor.h
│ │ ├── GTest.h
│ │ ├── MemoryReportAllocator.h
│ │ ├── MemoryReporterPlugin.h
│ │ ├── MemoryReportFormatter.h
│ │ ├── MockActualCall.h
│ │ ├── MockCheckedActualCall.h
│ │ ├── MockCheckedExpectedCall.h
│ │ ├── MockExpectedCall.h
│ │ ├── MockExpectedCallsList.h
│ │ ├── MockFailure.h
│ │ ├── MockNamedValue.h
│ │ ├── MockSupport_c.h
│ │ ├── MockSupport.h
│ │ ├── MockSupportPlugin.h
│ │ └── OrderedTest.h
│ └── Platforms
│ ├── armcc
│ │ └── Platform.h
│ ├── c2000
│ │ ├── Platform.h
│ │ └── stdint.h
│ ├── Gcc
│ │ └── Platform.h
│ ├── StarterKit
│ │ └── Platform.h
│ ├── Symbian
│ │ └── Platform.h
│ └── VisualCpp
│ ├── Platform.h
│ └── stdint.h
├── INSTALL
├── install-sh
├── lib
│ └── NoteOnVisualStudio.txt
├── ltmain.sh
├── m4
│ ├── acx_pthread.m4
│ ├── libtool.m4
│ ├── lt~obsolete.m4
│ ├── ltoptions.m4
│ ├── ltsugar.m4
│ └── ltversion.m4
├── Makefile.am
├── Makefile_CppUTestExt
├── Makefile.in
├── Makefile_using_MakefileWorker
├── makeVc6.bat
├── makeVS2008.bat
├── makeVS2010.bat
├── missing
├── NEWS
├── platforms
│ ├── armcc
│ │ ├── Makefile
│ │ ├── README
│ │ └── TODO
│ └── IAR-STR912.zip
├── platforms_examples
│ ├── armcc
│ │ ├── AT91SAM7A3
│ │ │ ├── AT91SAM7A3.jflash
│ │ │ ├── AT91SAM7A3.launch
│ │ │ ├── HEAP.txt
│ │ │ ├── jlink_gdb.cmd
│ │ │ ├── Makefile
│ │ │ ├── RAM.txt
│ │ │ ├── README
│ │ │ ├── ROM.sct
│ │ │ ├── STACK.txt
│ │ │ └── tests
│ │ │ └── main.cpp
│ │ └── LPC1768
│ │ ├── cpputest_example_Default.launch
│ │ ├── jlink_gdb.cmd
│ │ ├── LPC1768.jflash
│ │ ├── README
│ │ ├── ROM.sct
│ │ └── tests
│ │ └── main.cpp
│ └── README
├── platforms_startup
│ ├── armcc
│ │ ├── AT91SAM7A3
│ │ │ ├── AT91SAM7A3.h
│ │ │ ├── lib_AT91SAM7A3.h
│ │ │ ├── Makefile
│ │ │ ├── README
│ │ │ ├── Retarget.c
│ │ │ └── SAM7A3.asm
│ │ └── LPC1768
│ │ ├── core_cm3.h
│ │ ├── core_cmFunc.h
│ │ ├── core_cmInstr.h
│ │ ├── lpc17xx_clkpwr.c
│ │ ├── lpc17xx_clkpwr.h
│ │ ├── LPC17xx.h
│ │ ├── lpc17xx_libcfg_default.c
│ │ ├── lpc17xx_libcfg_default.h
│ │ ├── lpc17xx_pinsel.h
│ │ ├── lpc17xx_timer.c
│ │ ├── lpc17xx_timer.h
│ │ ├── lpc_types.h
│ │ ├── README
│ │ ├── Retarget.c
│ │ ├── Serial.c
│ │ ├── Serial.h
│ │ ├── startup_LPC17xx.asm
│ │ ├── system_LPC17xx.c
│ │ └── system_LPC17xx.h
│ └── README
├── project
│ └── CCStudio
│ ├── CppUTestExtRunAllTests.pjt
│ ├── CppUTest.pjt
│ ├── CppUTestRunAllTests.pjt
│ ├── sim28335.cmd
│ ├── sim28335.gel
│ ├── sim2833x.cfg
│ └── tests
│ ├── CppUTest
│ │ └── AllTestsForTarget.cpp
│ └── CppUTestExt
│ └── AllTestsForTarget.cpp
├── README
├── README_CppUTest_for_C.txt
├── README_InstallCppUTest.txt
├── README.md
├── README_UsersOfPriorVersions.txt
├── scripts
│ ├── checkForCppUTestEnvVariable.sh
│ ├── convertToUnity
│ │ ├── cpp_u_test_to_unity.rb
│ │ ├── cpp_u_test_to_unity_utils.rb
│ │ ├── cpp_u_test_to_unity_utils_tests.rb
│ │ ├── create_group_runner.rb
│ │ ├── create_unity_test_runner.rb
│ │ └── README.txt
│ ├── CppUnitTemplates
│ │ ├── ClassNameC.c
│ │ ├── ClassNameC.h
│ │ ├── ClassNameCMultipleInstance.c
│ │ ├── ClassNameCMultipleInstance.h
│ │ ├── ClassNameCMultipleInstanceTest.cpp
│ │ ├── ClassNameCPolymorphic.c
│ │ ├── ClassNameCPolymorphic.h
│ │ ├── ClassName.cpp
│ │ ├── ClassNameCTest.cpp
│ │ ├── ClassName.h
│ │ ├── ClassNameTest.cpp
│ │ ├── InterfaceCTest.cpp
│ │ ├── InterfaceTest.cpp
│ │ ├── MockClassNameC.c
│ │ ├── MockClassNameC.h
│ │ ├── MockClassName.h
│ │ └── ProjectTemplate
│ │ ├── include
│ │ │ └── util
│ │ │ └── ProjectBuildTime.h
│ │ ├── ProjectMakefile
│ │ ├── src
│ │ │ └── util
│ │ │ └── ProjectBuildTime.cpp
│ │ └── tests
│ │ ├── AllTests.cpp
│ │ └── util
│ │ └── ProjectBuildTimeTest.cpp
│ ├── filterGcov.sh
│ ├── generate_junit_report_ant.xml
│ ├── GenerateSrcFiles.sh
│ ├── InstallScripts.sh
│ ├── NewCBaseModule.sh
│ ├── NewCFunction.sh
│ ├── NewCInterface.sh
│ ├── NewCIoDriver.sh
│ ├── NewClass.sh
│ ├── NewCmiModule.sh
│ ├── NewCModule.sh
│ ├── NewHelp.sh
│ ├── NewInterface.sh
│ ├── NewLibrary.sh
│ ├── NewPackageDirs.sh
│ ├── NewProject.sh
│ ├── README.txt
│ ├── RefactorRenameIncludeFile.sh
│ ├── reformat.sh
│ ├── ReleaseCppUTest.sh
│ ├── squeeze.sh
│ ├── svnignore.txt
│ ├── templates
│ │ ├── ClassNameC.c
│ │ ├── ClassNameC.h
│ │ ├── ClassNameCIoDriver.c
│ │ ├── ClassNameCIoDriver.h
│ │ ├── ClassNameCIoDriverTest.cpp
│ │ ├── ClassNameCMultipleInstance.c
│ │ ├── ClassNameCMultipleInstance.h
│ │ ├── ClassNameCMultipleInstanceTest.cpp
│ │ ├── ClassNameCPolymorphic.c
│ │ ├── ClassNameCPolymorphic.h
│ │ ├── ClassName.cpp
│ │ ├── ClassNameCTest.cpp
│ │ ├── ClassName.h
│ │ ├── ClassNameTest.cpp
│ │ ├── FunctionNameC.c
│ │ ├── FunctionNameC.h
│ │ ├── FunctionNameCTest.cpp
│ │ ├── InterfaceCTest.cpp
│ │ ├── InterfaceTest.cpp
│ │ ├── MockClassNameC.c
│ │ ├── MockClassNameC.h
│ │ ├── MockClassName.h
│ │ └── ProjectTemplate
│ │ ├── include
│ │ │ └── util
│ │ │ └── ProjectBuildTime.h
│ │ ├── Project.cproject
│ │ ├── ProjectMakefile
│ │ ├── Project.project
│ │ ├── src
│ │ │ └── util
│ │ │ └── ProjectBuildTime.cpp
│ │ └── tests
│ │ ├── AllTests.cpp
│ │ └── util
│ │ └── ProjectBuildTimeTest.cpp
│ ├── travis_ci_build.sh
│ ├── UnityTemplates
│ │ ├── ClassNameCIoDriverTest.cpp
│ │ ├── ClassNameCMultipleInstanceTest.cpp
│ │ ├── ClassNameCTest.cpp
│ │ ├── FunctionNameCTest.cpp
│ │ └── InterfaceCTest.cpp
│ ├── VS2010Templates
│ │ ├── CppUTest_VS2010.props
│ │ └── README.txt
│ └── zipExclude.txt
├── src
│ ├── CppUTest
│ │ ├── CMakeLists.txt
│ │ ├── CommandLineArguments.cpp
│ │ ├── CommandLineTestRunner.cpp
│ │ ├── JUnitTestOutput.cpp
│ │ ├── MemoryLeakDetector.cpp
│ │ ├── MemoryLeakWarningPlugin.cpp
│ │ ├── SimpleString.cpp
│ │ ├── TestFailure.cpp
│ │ ├── TestFilter.cpp
│ │ ├── TestHarness_c.cpp
│ │ ├── TestMemoryAllocator.cpp
│ │ ├── TestOutput.cpp
│ │ ├── TestPlugin.cpp
│ │ ├── TestRegistry.cpp
│ │ ├── TestResult.cpp
│ │ └── Utest.cpp
│ ├── CppUTestExt
│ │ ├── CMakeLists.txt
│ │ ├── CodeMemoryReportFormatter.cpp
│ │ ├── MemoryReportAllocator.cpp
│ │ ├── MemoryReporterPlugin.cpp
│ │ ├── MemoryReportFormatter.cpp
│ │ ├── MockActualCall.cpp
│ │ ├── MockExpectedCall.cpp
│ │ ├── MockExpectedCallsList.cpp
│ │ ├── MockFailure.cpp
│ │ ├── MockNamedValue.cpp
│ │ ├── MockSupport_c.cpp
│ │ ├── MockSupport.cpp
│ │ ├── MockSupportPlugin.cpp
│ │ └── OrderedTest.cpp
│ └── Platforms
│ ├── armcc
│ │ └── UtestPlatform.cpp
│ ├── C2000
│ │ └── UtestPlatform.cpp
│ ├── Gcc
│ │ └── UtestPlatform.cpp
│ ├── GccNoStdC
│ │ └── UtestPlatform.cpp
│ ├── Iar
│ │ └── UtestPlatform.cpp
│ ├── StarterKit
│ │ ├── StarterMemoryLeakWarning.cpp
│ │ └── UtestPlatform.cpp
│ ├── Symbian
│ │ ├── README_Symbian.txt
│ │ ├── SymbianMemoryLeakWarning.cpp
│ │ └── UtestPlatform.cpp
│ └── VisualCpp
│ └── UtestPlatform.cpp
├── test-driver
├── tests
│ ├── AllocationInCFile.c
│ ├── AllocationInCFile.h
│ ├── AllocationInCppFile.cpp
│ ├── AllocationInCppFile.h
│ ├── AllocLetTestFree.c
│ ├── AllocLetTestFree.h
│ ├── AllocLetTestFreeTest.cpp
│ ├── AllTests.cpp
│ ├── AllTests.h
│ ├── AllTests.vcproj
│ ├── AllTests.vcxproj
│ ├── CheatSheetTest.cpp
│ ├── CMakeLists.txt
│ ├── CommandLineArgumentsTest.cpp
│ ├── CommandLineTestRunnerTest.cpp
│ ├── CppUTestExt
│ │ ├── AllTests.cpp
│ │ ├── CMakeLists.txt
│ │ ├── CodeMemoryReportFormatterTest.cpp
│ │ ├── GMockTest.cpp
│ │ ├── GTest1Test.cpp
│ │ ├── GTest2ConvertorTest.cpp
│ │ ├── MemoryReportAllocatorTest.cpp
│ │ ├── MemoryReporterPluginTest.cpp
│ │ ├── MemoryReportFormatterTest.cpp
│ │ ├── MockActualCallTest.cpp
│ │ ├── MockCheatSheetTest.cpp
│ │ ├── MockExpectedCallTest.cpp
│ │ ├── MockExpectedFunctionsListTest.cpp
│ │ ├── MockFailureTest.cpp
│ │ ├── MockFailureTest.h
│ │ ├── MockPluginTest.cpp
│ │ ├── MockSupport_cTestCFile.c
│ │ ├── MockSupport_cTestCFile.h
│ │ ├── MockSupport_cTest.cpp
│ │ ├── MockSupportTest.cpp
│ │ └── OrderedTestTest.cpp
│ ├── JUnitOutputTest.cpp
│ ├── MemoryLeakDetectorTest.cpp
│ ├── MemoryLeakOperatorOverloadsTest.cpp
│ ├── MemoryLeakWarningTest.cpp
│ ├── NullTestTest.cpp
│ ├── PluginTest.cpp
│ ├── PreprocessorTest.cpp
│ ├── RunAllTests.sh
│ ├── SetPluginTest.cpp
│ ├── SimpleStringTest.cpp
│ ├── TestFailureNaNTest.cpp
│ ├── TestFailureTest.cpp
│ ├── TestFilterTest.cpp
│ ├── TestHarness_cTestCFile.c
│ ├── TestHarness_cTest.cpp
│ ├── TestInstallerTest.cpp
│ ├── TestMemoryAllocatorTest.cpp
│ ├── TestOutputTest.cpp
│ ├── TestRegistryTest.cpp
│ ├── TestResultTest.cpp
│ ├── TestUTestMacro.cpp
│ └── UtestTest.cpp
└── valgrind.suppressions
72 directories, 373 files
标签:
小贴士
感谢您为本站写下的评论,您的评论对其它用户来说具有重要的参考价值,所以请认真填写。
- 类似“顶”、“沙发”之类没有营养的文字,对勤劳贡献的楼主来说是令人沮丧的反馈信息。
- 相信您也不想看到一排文字/表情墙,所以请不要反馈意义不大的重复字符,也请尽量不要纯表情的回复。
- 提问之前请再仔细看一遍楼主的说明,或许是您遗漏了。
- 请勿到处挖坑绊人、招贴广告。既占空间让人厌烦,又没人会搭理,于人于己都无利。
关于好例子网
本站旨在为广大IT学习爱好者提供一个非营利性互相学习交流分享平台。本站所有资源都可以被免费获取学习研究。本站资源来自网友分享,对搜索内容的合法性不具有预见性、识别性、控制性,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,平台无法对用户传输的作品、信息、内容的权属或合法性、安全性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论平台是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二与二十三条之规定,若资源存在侵权或相关问题请联系本站客服人员,点此联系我们。关于更多版权及免责申明参见 版权及免责申明
网友评论
我要评论