Skip to content
Kang Minchul edited this page Oct 19, 2019 · 2 revisions

This document is written by Minchul Kang

1. Download lcov

$ sudo apt-get install lcov

or

$ git clone https://github.com/linux-test-project/lcov.git

2. Build lcov

$ make clean
$ make COVERAGE=1

if you want to reset coverage, you can use command below:

$ make reset-coverage

3. Test lcov

4. compile test code with -pgoption

$ gcc -pg -o t-abc tests/s-abc.c

5. record the object data with uftrace

record t-abc file with uftrace.

$ ./uftrace record -L. t-abc

Note that as we want to load necessary internal libraries from this path for testing purpose, -L option is given.

6. run script for lcov

Command below will generate coverage.html file.

./misc/run-lcov.sh

7. Check the generated html

$ cd coverage.html

8. Run a web server

In this case, we used SimpleHTTPServer as a simple web server with port number 18080.

$ python -m SimpleHTTPServer 18080