From nobody Tue Apr 16 04:40:35 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1565711364; cv=none; d=zoho.com; s=zohoarc; b=Vn1OGa6OY/CCp2ZV+MjuyOIdRZMU+9Bm1sP5KSGvHIpV4S1Bqt00z79ML5h1mMEAGc/uzM7FW5b52/TogAZFaNxxazCqRP0243aWh9IAzsEnPiKnKgG/xgCtb10g5vz0oUIFTuWROpzwflPkrVFaKSRxDGMuS4K1zXuPNqB6J8I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565711364; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=7b5/bBcFtv1T8xeXHVsUHyy/drFH66RsjgLUU+bhwhU=; b=LGw0WAg10Tjskir+CZdKDvcvctkupsMzMgaLJlmHedUvNYBep8cM26Gk+dzcMFrrIw5676UtsF9uqoTuVzUxKUx/EYs/GyNzFkTHkcwHGtDppfsIXvHxRNWvZYtTFqenzK1nOI0T/zomJ7dhvZDCW9+KrOLRW/OlJp8kSB5bVUQ= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1565711364931483.30041517489553; Tue, 13 Aug 2019 08:49:24 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9ED9A30EA1AC; Tue, 13 Aug 2019 15:49:23 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6CE356E08D; Tue, 13 Aug 2019 15:49:23 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 0A23B180BA99; Tue, 13 Aug 2019 15:49:23 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x7DFnLL9010794 for ; Tue, 13 Aug 2019 11:49:21 -0400 Received: by smtp.corp.redhat.com (Postfix) id D14E44B5; Tue, 13 Aug 2019 15:49:21 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 01E1D4B4; Tue, 13 Aug 2019 15:49:17 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id AF239100100; Tue, 13 Aug 2019 17:49:15 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Tue, 13 Aug 2019 17:49:09 +0200 Message-Id: <918192d124ecb3b56912b227d03f9f1d55265828.1565711022.git.jdenemar@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 1/2] Revert "configure: Remove --enable-test-coverage" X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Tue, 13 Aug 2019 15:49:24 +0000 (UTC) Content-Type: text/plain; charset="utf-8" This reverts commit f38d553e2d6ec2f041cb7947b5eafcdd3b26ae65. Gnulib's make coverage (or init-coverage, build-coverage, gen-coverage) is not a 1-1 replacement for the original configure option. Our old --enable-test-coverage seems to be close to gnulib's make build-coverage except gnulib runs lcov in that phase and the build actually fails for me even before lcov is run. And since we want to be able to just build libvirt without running lcov, I suggest reverting to our own implementation. Signed-off-by: Jiri Denemark Reviewed-by: Michal Privoznik --- Notes: Version 2: - rebased Makefile.am | 20 +++++++++++++++++--- configure.ac | 18 ++++++++++++++++++ src/Makefile.am | 2 ++ src/remote/Makefile.inc.am | 2 ++ tests/Makefile.am | 2 ++ tools/Makefile.am | 6 ++++++ 6 files changed, 47 insertions(+), 3 deletions(-) diff --git a/Makefile.am b/Makefile.am index dedd8d2ff8..27c49280c4 100644 --- a/Makefile.am +++ b/Makefile.am @@ -16,15 +16,15 @@ ## License along with this library. If not, see ## . =20 +LCOV =3D lcov +GENHTML =3D genhtml + SUBDIRS =3D . gnulib/lib include/libvirt src tools docs gnulib/tests \ tests po examples =20 XZ_OPT ?=3D -v -T0 export XZ_OPT =20 -# have gnulib 'make coverage' output to 'cov' dir -COVERAGE_OUT =3D "cov" - ACLOCAL_AMFLAGS =3D -I m4 =20 EXTRA_DIST =3D \ @@ -87,6 +87,20 @@ check-local: all tests check-access: all @($(MAKE) $(AM_MAKEFLAGS) -C tests check-access) =20 +cov: clean-cov + $(MKDIR_P) $(top_builddir)/coverage + $(LCOV) -c -o $(top_builddir)/coverage/libvirt.info.tmp \ + -d $(top_builddir)/src \ + -d $(top_builddir)/tests + $(LCOV) -r $(top_builddir)/coverage/libvirt.info.tmp \ + -o $(top_builddir)/coverage/libvirt.info + rm $(top_builddir)/coverage/libvirt.info.tmp + $(GENHTML) --show-details -t "libvirt" -o $(top_builddir)/coverage \ + --legend $(top_builddir)/coverage/libvirt.info + +clean-cov: + rm -rf $(top_builddir)/coverage + MAINTAINERCLEANFILES =3D .git-module-status =20 dist-hook: gen-AUTHORS diff --git a/configure.ac b/configure.ac index ebb2e24e21..f41c6d5d86 100644 --- a/configure.ac +++ b/configure.ac @@ -726,6 +726,23 @@ fi AC_SUBST([VIR_TEST_EXPENSIVE_DEFAULT]) AM_CONDITIONAL([WITH_EXPENSIVE_TESTS], [test $VIR_TEST_EXPENSIVE_DEFAULT = =3D 1]) =20 +LIBVIRT_ARG_ENABLE([TEST_COVERAGE], [turn on code coverage instrumentation= ], [no]) +case "$enable_test_coverage" in + yes|no) ;; + *) AC_MSG_ERROR([bad value ${enable_test_coverga} for test-coverage opti= on]) ;; +esac + +if test "$enable_test_coverage" =3D yes; then + save_WARN_CFLAGS=3D$WARN_CFLAGS + WARN_CFLAGS=3D + gl_WARN_ADD([-fprofile-arcs]) + gl_WARN_ADD([-ftest-coverage]) + COVERAGE_FLAGS=3D$WARN_CFLAGS + AC_SUBST([COVERAGE_CFLAGS], [$COVERAGE_FLAGS]) + AC_SUBST([COVERAGE_LDFLAGS], [$COVERAGE_FLAGS]) + WARN_CFLAGS=3D$save_WARN_CFLAGS +fi + LIBVIRT_ARG_ENABLE([TEST_OOM], [memory allocation failure checking], [no]) case "$enable_test_oom" in yes|no) ;; @@ -1011,6 +1028,7 @@ LIBVIRT_WIN_RESULT_WINDRES AC_MSG_NOTICE([]) AC_MSG_NOTICE([Test suite]) AC_MSG_NOTICE([]) +AC_MSG_NOTICE([ Coverage: $enable_test_coverage]) AC_MSG_NOTICE([ Alloc OOM: $enable_test_oom]) AC_MSG_NOTICE([]) AC_MSG_NOTICE([Miscellaneous]) diff --git a/src/Makefile.am b/src/Makefile.am index d02d4deb6d..3ae4b87abb 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -37,8 +37,10 @@ AM_CFLAGS =3D $(LIBXML_CFLAGS) \ $(WARN_CFLAGS) \ $(LOCK_CHECKING_CFLAGS) \ $(WIN32_EXTRA_CFLAGS) \ + $(COVERAGE_CFLAGS) \ $(NULL) AM_LDFLAGS =3D $(DRIVER_MODULES_LDFLAGS) \ + $(COVERAGE_LDFLAGS) \ $(RELRO_LDFLAGS) \ $(NO_INDIRECT_LDFLAGS) \ $(CYGWIN_EXTRA_LDFLAGS) \ diff --git a/src/remote/Makefile.inc.am b/src/remote/Makefile.inc.am index 09535ee6bb..aca0b40140 100644 --- a/src/remote/Makefile.inc.am +++ b/src/remote/Makefile.inc.am @@ -45,6 +45,7 @@ REMOTE_DAEMON_CFLAGS =3D \ $(LIBNL_CFLAGS) \ $(WARN_CFLAGS) \ $(PIE_CFLAGS) \ + $(COVERAGE_CFLAGS) \ -I$(srcdir)/access \ -I$(srcdir)/conf \ -I$(srcdir)/rpc \ @@ -55,6 +56,7 @@ REMOTE_DAEMON_LD_FLAGS =3D \ $(PIE_LDFLAGS) \ $(NO_INDIRECT_LDFLAGS) \ $(NO_UNDEFINED_LDFLAGS) \ + $(COVERAGE_LDFLAGS) \ $(NULL) =20 REMOTE_DAEMON_LD_ADD =3D \ diff --git a/tests/Makefile.am b/tests/Makefile.am index 31a22ebefd..6b5d05bbed 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -41,6 +41,7 @@ AM_CFLAGS =3D \ $(SELINUX_CFLAGS) \ $(APPARMOR_CFLAGS) \ $(YAJL_CFLAGS) \ + $(COVERAGE_CFLAGS) \ $(XDR_CFLAGS) \ $(WARN_CFLAGS) =20 @@ -267,6 +268,7 @@ endif WITH_SECDRIVER_SELINUX =20 # This is a fake SSH we use from virnetsockettest ssh_SOURCES =3D ssh.c +ssh_LDADD =3D $(COVERAGE_LDFLAGS) =20 if WITH_LIBXL test_programs +=3D xlconfigtest \ diff --git a/tools/Makefile.am b/tools/Makefile.am index 35b442d975..29fdbfe846 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -33,6 +33,7 @@ WARN_CFLAGS +=3D $(STRICT_FRAME_LIMIT_CFLAGS) =20 AM_CFLAGS =3D \ $(WARN_CFLAGS) \ + $(COVERAGE_CFLAGS) \ $(PIE_CFLAGS) \ $(LIBXML_CFLAGS) \ $(NULL) @@ -143,6 +144,7 @@ libvirt_shell_la_CFLAGS =3D \ libvirt_shell_la_LDFLAGS =3D \ $(AM_LDFLAGS) \ $(PIE_LDFLAGS) \ + $(COVERAGE_LDFLAGS) \ $(NULL) libvirt_shell_la_LIBADD =3D \ ../src/libvirt.la \ @@ -188,6 +190,7 @@ endif ! WITH_BHYVE virt_host_validate_LDFLAGS =3D \ $(AM_LDFLAGS) \ $(PIE_LDFLAGS) \ + $(COVERAGE_LDFLAGS) \ $(NULL) =20 virt_host_validate_LDADD =3D \ @@ -213,6 +216,7 @@ virt_login_shell_helper_SOURCES =3D \ virt_login_shell_helper_LDFLAGS =3D \ $(AM_LDFLAGS) \ $(PIE_LDFLAGS) \ + $(COVERAGE_LDFLAGS) \ $(NULL) virt_login_shell_helper_LDADD =3D \ ../src/libvirt.la \ @@ -256,6 +260,7 @@ virsh_SOURCES =3D \ virsh_LDFLAGS =3D \ $(AM_LDFLAGS) \ $(PIE_LDFLAGS) \ + $(COVERAGE_LDFLAGS) \ $(NULL) virsh_LDADD =3D \ $(STATIC_BINARIES) \ @@ -273,6 +278,7 @@ virt_admin_SOURCES =3D \ =20 virt_admin_LDFLAGS =3D \ $(AM_LDFLAGS) \ + $(COVERAGE_LDFLAGS) \ $(STATIC_BINARIES) \ $(PIE_LDFLAGS) \ $(NULL) --=20 2.22.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 16 04:40:35 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1565711363; cv=none; d=zoho.com; s=zohoarc; b=ONyDpUNvZRiNo0g1iWRYaySmF2gBnLUW7cpM6s7Fhs70zB0eE77yLmw0wAO3uRCT0u67TiIbUHfhiucWRqyoklFm5zAtlxl0xHPd27vVCUajiB05CNaWef2b0Foe/hvl3PQEIkZphwYvEqPPYS5a47icnTxKgiebJbQgJzz5GOs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565711363; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=NfdjBk2tft7T2bCigyX3lK3kb+ZJc+jcr8bseJuHOAg=; b=bmr/jn0ddLdotaiFD6XFQZ3VsCxKAsuFApdOuyKanFjh/UvBuIdjK6zyIjPC4vOGjN1rgOCj1xsKiIKvpM0N4iFYtgK7NwXNbn68LemYXeF8pqD4JeHgIS3BJCHkquKRu5n0f3LuZEk+9Uz8Yc9qSi7n4i7U/X/2cfZO+8M1t4U= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1565711363920590.3934843219105; Tue, 13 Aug 2019 08:49:23 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 595067FDF9; Tue, 13 Aug 2019 15:49:22 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0439F3844; Tue, 13 Aug 2019 15:49:22 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id E4CDA24F30; Tue, 13 Aug 2019 15:49:20 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x7DFnJj9010779 for ; Tue, 13 Aug 2019 11:49:19 -0400 Received: by smtp.corp.redhat.com (Postfix) id D39F1821FC; Tue, 13 Aug 2019 15:49:19 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 062D9821EA; Tue, 13 Aug 2019 15:49:17 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id B2971104B9E; Tue, 13 Aug 2019 17:49:15 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Tue, 13 Aug 2019 17:49:10 +0200 Message-Id: <35213d9296ee92a54665ef30e487af90ce9a9f1b.1565711022.git.jdenemar@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 2/2] Revert "docs: hacking: Add 'Code coverage reports' section" X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 13 Aug 2019 15:49:23 +0000 (UTC) Content-Type: text/plain; charset="utf-8" This reverts commit 47cbc929870aaff6b01ba24cd028b8787a1ae9a4. The section is no longer correct when the patch switching to gnulib's make coverage was reverted. Signed-off-by: Jiri Denemark --- Notes: Version 2: - new patch docs/hacking.html.in | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/docs/hacking.html.in b/docs/hacking.html.in index 859e33a874..90376968c3 100644 --- a/docs/hacking.html.in +++ b/docs/hacking.html.in @@ -1473,34 +1473,5 @@ int foo() in the same way, but still make sure they get reviewed if non-triv= ial. -

Code coverage reports

- -

- Code coverage HTML reports can be generated with: -

- -
-  make coverage
-
- -

- Reports will be generated in the cov/ directory. Point a - web browser at cov/index.html for the full report. -

- -

- The make coverage target is provided by gnulib. - It is a convenience helper for calling the following 3 targets in or= der. - It may be useful to occasionally call these directly. - -

    -
  • make init-coverage: run make clean and - remove all code coverage counter files (*.gcno, etc.)
  • -
  • make build-coverage: run make and - make check with CFLAGS filled in with - necessary coverage flags
  • -
  • make gen-coverage: generate the HTML report
  • -
-

--=20 2.22.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list