Download presentation
Presentation is loading. Please wait.
Published byBritney Powell Modified over 9 years ago
1
Jul 1, 20101 CUnit & Coverage Larry Shi
2
Jul 1, 20102 Agenda Aim CUnit Screenshots(Automated) Demo TO-DO list
3
Aim Unit test Test C code automatically Find bugs in time to improve quality Coverage How often each line of code executes What lines of code are actually executed Suggestion CUnit for unit test GCOV, LCOV for coverage Jul 1, 20103
4
4 CUnit CUnit is a lightweight system for writing, administering, and running unit tests in C. Several different interfaces are provided for running tests and reporting results TypeDes.Interactive ※ Automated Output to xml fileNO BasicFlexible programming interfaceNO ConsoleConsole interface (ansi C)YES CursesGraphical interface (Unix)YES
5
Screenshots-Listing tests Jul 1, 20105
6
Screenshots-Tests result Jul 1, 20106
7
Screenshots-Coverage Jul 1, 20107
8
Screenshots-Coverage Jul 1, 20108
9
Demo ※ Please see it in the test machine Several steps below: Write test cases Compile with -ftest-coverage -fprofile-arcs Run Generated files: xx.gcda, xx.gcno for coverage LCOV Generated files: covinfo for coverage genhtml (generate html format coverage report) Confirm test report(xx.xml) Confirm coverage report (./result) Jul 1, 20109
10
TO-DO list Team discuss if CUnit & LCOV can satisfy our requirement for C code quality Framework design Unit test framework via CUnit One example about framework proposal Support for automated test Support for modular test Integrate the framework with existed source code Integrate the framework with other test frameworks Test cases Suggest that developers handle it Jul 1, 201010
11
Jul 1, 201011 Thank you!!
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.