From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44327) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fYrsr-0001o4-4k for qemu-devel@nongnu.org; Fri, 29 Jun 2018 07:48:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fYrsp-0003ds-T3 for qemu-devel@nongnu.org; Fri, 29 Jun 2018 07:48:13 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:47362 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fYrsp-0003ch-NR for qemu-devel@nongnu.org; Fri, 29 Jun 2018 07:48:11 -0400 Date: Fri, 29 Jun 2018 12:48:03 +0100 From: Daniel =?utf-8?B?UC4gQmVycmFuZ8Op?= Message-ID: <20180629114803.GO27016@redhat.com> Reply-To: Daniel =?utf-8?B?UC4gQmVycmFuZ8Op?= References: <20180625111935.26108-1-alex.bennee@linaro.org> <20180625111935.26108-9-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20180625111935.26108-9-alex.bennee@linaro.org> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v1 08/10] build-system: add coverage-report target List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alex =?utf-8?Q?Benn=C3=A9e?= Cc: cota@braap.org, famz@redhat.com, f4bug@amsat.org, richard.henderson@linaro.org, balrogg@gmail.com, aurelien@aurel32.net, agraf@suse.de, qemu-devel@nongnu.org On Mon, Jun 25, 2018 at 12:19:33PM +0100, Alex Benn=C3=A9e wrote: > This will build a coverage report under the current directory in > reports/coverage. At the users option a report can be generated by > directly invoking something like: >=20 > make foo/bar/coverage-report.html >=20 > Signed-off-by: Alex Benn=C3=A9e > Reviewed-by: Philippe Mathieu-Daud=C3=A9 > Tested-by: Philippe Mathieu-Daud=C3=A9 > --- > Makefile | 13 +++++++++++++ > docs/devel/testing.rst | 11 ++++++++--- > 2 files changed, 21 insertions(+), 3 deletions(-) >=20 > diff --git a/Makefile b/Makefile > index 2b3413a5ba..68af7b5d7c 100644 > --- a/Makefile > +++ b/Makefile > @@ -986,6 +986,16 @@ docs/interop/qemu-qmp-ref.dvi docs/interop/qemu-qm= p-ref.html \ > docs/interop/qemu-qmp-ref.txt docs/interop/qemu-qmp-ref.7: \ > docs/interop/qemu-qmp-ref.texi docs/interop/qemu-qmp-qapi.texi > =20 > +# Reports/Analysis > + > +%/coverage-report.html: > + @mkdir -p $* > + $(call quiet-command,\ > + gcovr -p --html --html-details -o $@, \ > + "GEN", "coverage-report.html") > + > +.PHONY: coverage-report > +coverage-report: $(CURDIR)/reports/coverage/coverage-report.html > =20 > ifdef CONFIG_WIN32 > =20 > @@ -1095,6 +1105,9 @@ endif > @echo 'Documentation targets:' > @echo ' html info pdf txt' > @echo ' - Build documentation in specified format' > +ifdef CONFIG_GCOV > + @echo ' coverage-report - Create code coverage report' > +endif > @echo '' > ifdef CONFIG_WIN32 > @echo 'Windows targets:' > diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst > index a3652aea14..9dcdd19260 100644 > --- a/docs/devel/testing.rst > +++ b/docs/devel/testing.rst > @@ -166,9 +166,14 @@ If you want to gather coverage information on a si= ngle test the ``make > clean-coverage`` target can be used to any existing coverage > information before running a single test. > =20 > -Reports can be obtained by running ``gcov`` command > -on the output files under ``$build_dir/tests/``, please read the > -``gcov`` documentation for more information. > +You can generate a HTML coverage report by executing ``make > +coverage-report`` which will generate into I think it reads slightly better with s/generate into/create/ > +./reports/coverage/coverage-report.html. If you want to generate it s/generate/create/ > +elsewhere simply execute ``make /foo/bar/baz/coverage-report.html``. > + > +Further analysis can be conducted by running the ``gcov`` command > +directly on the various .gcda output files. Please read the ``gcov`` > +documentation for more information. Reviewed-by: Daniel P. Berrang=C3=A9 Regards, Daniel --=20 |: https://berrange.com -o- https://www.flickr.com/photos/dberran= ge :| |: https://libvirt.org -o- https://fstop138.berrange.c= om :| |: https://entangle-photo.org -o- https://www.instagram.com/dberran= ge :|