Обсуждение: Error generating coverage report

Поиск
Список
Период
Сортировка

Error generating coverage report

От
David Steele
Дата:
I'm working on improving coverage and would like to generate some
reports (other than the text versions) to help me find uncovered code.
However, my source path and build path are not the same and I'm running
into problems.

This works fine and produces gcov output:

$ make -C test/build/src/bin/pg_basebackup check
$ ls -1 test/build/src/bin/pg_basebackup/*.gcno

test/build/src/bin/pg_basebackup/pg_basebackup.gcno
test/build/src/bin/pg_basebackup/pg_receivewal.gcno
test/build/src/bin/pg_basebackup/pg_recvlogical.gcno
test/build/src/bin/pg_basebackup/receivelog.gcno
test/build/src/bin/pg_basebackup/streamutil.gcno
test/build/src/bin/pg_basebackup/walmethods.gcno

But, when I try to generate the coverage report I get:

$ make -C test/build/src/bin/pg_basebackup coverage-html

make: Entering directory `/home/vagrant/test/build/src/bin/pg_basebackup'
/usr/bin/lcov --gcov-tool /usr/bin/gcov -q --no-external -c -i -d . -d
/postgres/src/bin/pg_basebackup -o lcov_base.info
geninfo: ERROR: no .gcno files found in /postgres/src/bin/pg_basebackup!
make: *** [lcov_base.info] Error 255
make: *** Deleting file `lcov_base.info'
make: Leaving directory `/home/vagrant/test/build/src/bin/pg_basebackup'

It's looking at my source directory rather than my build directory.
Here's how I'm calling configure:

$ cd /home/vagrant/test/build
$ /postgres/configure --prefix=/home/vagrant/test/pg \
    --docdir=/postgres-doc --enable-cassert --enable-tap-tests \
    --enable-coverage --with-openssl --enable-depend

I read docs/10/static/regress-coverage.html but didn't see anything that
helps.  Hopefully I'm missing something?

Thanks,
-- 
-David
david@pgmasters.net


Re: Error generating coverage report

От
Peter Eisentraut
Дата:
On 12/12/17 15:02, David Steele wrote:
> I'm working on improving coverage and would like to generate some
> reports (other than the text versions) to help me find uncovered code.
> However, my source path and build path are not the same and I'm running
> into problems.

Vpath builds were one of the things that was specifically tested for the
coverage tooling changes that went into PG11, so it should work in
principle, unless something has changed in the meantime.

> $ make -C test/build/src/bin/pg_basebackup coverage-html
> 
> make: Entering directory `/home/vagrant/test/build/src/bin/pg_basebackup'
> /usr/bin/lcov --gcov-tool /usr/bin/gcov -q --no-external -c -i -d . -d
> /postgres/src/bin/pg_basebackup -o lcov_base.info
> geninfo: ERROR: no .gcno files found in /postgres/src/bin/pg_basebackup!
> make: *** [lcov_base.info] Error 255
> make: *** Deleting file `lcov_base.info'
> make: Leaving directory `/home/vagrant/test/build/src/bin/pg_basebackup'

The -d options should accumulate, so that it should look in both places.

Wild guess: If the /postgres directory is some kind of vboxsf mount,
there might be problems if symlinks are involved.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


Re: Error generating coverage report

От
David Steele
Дата:
Hi Peter,

On 12/12/17 3:20 PM, Peter Eisentraut wrote:
>>
>> make: Entering directory `/home/vagrant/test/build/src/bin/pg_basebackup'
>> /usr/bin/lcov --gcov-tool /usr/bin/gcov -q --no-external -c -i -d . -d
>> /postgres/src/bin/pg_basebackup -o lcov_base.info
>> geninfo: ERROR: no .gcno files found in /postgres/src/bin/pg_basebackup!
>> make: *** [lcov_base.info] Error 255
>> make: *** Deleting file `lcov_base.info'
>> make: Leaving directory `/home/vagrant/test/build/src/bin/pg_basebackup'
> 
> The -d options should accumulate, so that it should look in both places.
> 
> Wild guess: If the /postgres directory is some kind of vboxsf mount,
> there might be problems if symlinks are involved.

/postgres is a vboxsf mount.  However, I copied /postgres to 
/home/vagrant/src and still see the same error:

$ make -C test/build/src/bin/pg_basebackup coverage-html
make: Entering directory `/home/vagrant/test/build/src/bin/pg_basebackup'
/usr/bin/lcov --gcov-tool /usr/bin/gcov -q --no-external -c -i -d . -d 
/home/vagrant/src/src/bin/pg_basebackup -o lcov_base.info
geninfo: ERROR: no .gcno files found in 
/home/vagrant/src/src/bin/pg_basebackup!
make: *** [lcov_base.info] Error 255
make: *** Deleting file `lcov_base.info'
make: Leaving directory `/home/vagrant/test/build/src/bin/pg_basebackup'

Thoughts?

-- 
-David
david@pgmasters.net


Re: Error generating coverage report

От
Peter Eisentraut
Дата:
On 12/12/17 15:39, David Steele wrote:
> $ make -C test/build/src/bin/pg_basebackup coverage-html
> make: Entering directory `/home/vagrant/test/build/src/bin/pg_basebackup'
> /usr/bin/lcov --gcov-tool /usr/bin/gcov -q --no-external -c -i -d . -d 
> /home/vagrant/src/src/bin/pg_basebackup -o lcov_base.info
> geninfo: ERROR: no .gcno files found in 
> /home/vagrant/src/src/bin/pg_basebackup!
> make: *** [lcov_base.info] Error 255
> make: *** Deleting file `lcov_base.info'
> make: Leaving directory `/home/vagrant/test/build/src/bin/pg_basebackup'

I tried a setup like this locally and it works fine.  So we might have
to be more precise.  Can you tell me the vagrant box you are using if
it's public, or the OS version, and the exact commands, then I can try
to reproduce it.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services