File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,22 @@ Compile and run as follows to use `gprof` to profile the library:
4545 cd ../unittest
4646 gcc -g -O0 unittest.c -lm -lpthread -o unittest ../mapcodelib/mapcoder.o -pg
4747
48+ ## Using ` gcov ` to Show Test Coverage
49+
50+ Compile and run as follows to use ` gcov ` to show test coverage for the libray:
51+
52+ cd ../mapcodelib
53+ gcc -fprofile-arcs -ftest-coverage -O0 -c mapcoder.c
54+ cd ../unittest
55+ gcc -fprofile-arcs -ftest-coverage -O0 unittest.c -lm -lpthread -o unittest ../mapcodelib/mapcoder.o -pg
56+ ./unittest
57+ cd ../mapcodelib
58+ gcov mapcoder.c
59+ cd ../unittest
60+ gcov unittest.c
61+
62+ The test coverage reports are the ` *.gcov ` text files.
63+
4864## Using Microsoft Visual C++
4965
5066If you use ** Microsoft Visual C++** , you may need to add the following defines to your preprocessor
You can’t perform that action at this time.
0 commit comments