Your SlideShare is downloading. ×
0
Using gcov and lcov
Using gcov and lcov
Using gcov and lcov
Using gcov and lcov
Using gcov and lcov
Using gcov and lcov
Using gcov and lcov
Using gcov and lcov
Using gcov and lcov
Using gcov and lcov
Using gcov and lcov
Using gcov and lcov
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Using gcov and lcov

22,778

Published on

introduction to gcov and lcov

introduction to gcov and lcov

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
22,778
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
186
Comments
0
Likes
2
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Using gcov and lcov<br />Magus Chen<br />maguschen@hotmail.com<br />http://magustest.com/blog/<br />
  • 2. Agenda<br />gcov<br />lcov<br />How to apply gcov on ads<br />Using lcov generate report<br />Example<br />2<br />
  • 3. Introduction to gcov<br />A test coverage program<br />Works only on code compiled with GCC<br />Collect code coverage data and generate plain text coverage report<br />3<br />
  • 4. Introduction to lcov<br />LCOV is a graphical front-end for GCC's coverage testing tool gcov. It collects gcov data for multiple source files and creates HTML pages containing the source code annotated with coverage information. It also adds overview pages for easy navigation within the file structure. LCOV supports statement, function and branch coverage measurement.<br />4<br />
  • 5. How to apply gcov on ads<br />Build adserver with option “--coverage”<br />This option is used to compile and link code instrumented for coverage analysis. The option is a synonym for -fprofile-arcs-ftest-coverage (when compiling) and -lgcov (when linking).<br />5<br />
  • 6. How to apply gcov on ads<br />Copy ads binary to your own environment <br />Export two envGCOV_PREFIX and GCOV_PREFIX_STRIP <br />Run ads<br />Send request<br />To generate code coverage data, exit the program normally (using kill, not kill -9)<br />Some .gcda file is generated<br />6<br />
  • 7. How to generate html report<br />Copy all source files and .gcno files from build server to your own environment<br />Copy all .gcda file to your own environment<br />lcov -t 'Adserver regression' -o ads_test.info -c -d .<br />-t title<br />-o output file name<br />-c capture coverage data<br />-d use data files in DIR<br />7<br />
  • 8. How to generate html report<br />genhtml -o result ads_test.info <br />-o output folder of the all html contents<br />ads_test.info INFO FILE name<br />8<br />
  • 9. How to view the HTML report<br />Apache httpd<br />/etc/init.d/httpd start<br />Copy or link the result folder under /var/www/html/<br />Lighttpd<br />/usr/local/sbin/lighttpd -f lighttpd_jchen.conf<br />Copy or link the result folder under server.document-root<br />9<br />
  • 10. Example<br />10<br />
  • 11. Q & A<br />11<br />
  • 12. Thank you<br />

×