Hi,

On Mon, Dec 28, 2015 at 3:32 AM, Ken Takata <[email protected]> wrote:
> Hi Yegappan,
>
> 2015/12/28 Mon 12:45:32 UTC+9 [email protected] wrote:
>> Hi all,
>>
>> Just in case anyone is looking for getting the code coverage information
>> for Vim, I used the following steps to get this.
>>
>> 1. Modify src/Makefile and add the following two lines:
>>
>>         CFLAGS=-g -O0 -fprofile-arcs -ftest-coverage
>>         LDFLAGS=--coverage
>>
>> 2. Run configure and build Vim as usual.
>> 3. Run "make test" to run the unit tests.
>> 4. The code coverage information will be generated in the src/objects 
>> directory.
>> 5. Use the following command to get the code coverage information for a
>>     particular source file:
>>
>>         $ cd src
>>         $ gcov -o objects <filename.c>
>>
>> The code coverage information will be in the <filename.c>.gcov file.
>
> If you have installed lcov, you may want to try the following as step 5:
>
>   $ cd src
>   $ lcov -c -d objects/ -b . -o coverage.info
>   $ genthml coverage.info -o output/
>
> You can see the results on a web browser opening output/index.html.
>

Thanks for the suggestion to use lcov. The new set of instructions for
getting the code
coverage using lcov is below.

1. Edit src/Makefile and add the following two lines:

     CFLAGS=-g -O0 -fprofile-arcs -ftest-coverage
     LDFLAGS=--coverage

2. Run configure and build Vim as usual.
3. Generate the baseline code coverage information:

     $ cd src
     $ lcov -c -i -b . -d objects -o objects/coverage_base.info

3. Run "make test" to execute the Vim functional tests.
4. Generate the code coverage information from the tests:

     $ lcov -c -b . -d objects/ -o objects/coverage_test.info

5. Combine the baseline and test code coverage data:

     $ lcov -a objects/coverage_base.info -a
objects/coverage_test.info -o objects/coverage_total.info

4. Process the test coverage data and generate a report in html:

     $ genhtml objects/coverage_total.info -o objects

5. Open the objects/index.html file in a web browser to view the
coverage information.


Regards,
Yegappan

>
> We can also check the coverage on the Web:
> https://coveralls.io/github/vim/vim
>
> Regards,
> Ken Takata
>

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui