From patchwork Wed Mar 13 17:11:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 160258 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp14555764jad; Wed, 13 Mar 2019 10:11:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqzY/AbG4osLaunOSLnIHVU9aP74QlXO0lJrtO/aO8Zcc9QAz9pAYvuSwcOBAlZEy3YfRjoZ X-Received: by 2002:a0c:9919:: with SMTP id h25mr35250756qvd.26.1552497107400; Wed, 13 Mar 2019 10:11:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552497107; cv=none; d=google.com; s=arc-20160816; b=UvXrJrLRuM5nUuQ8SlF5DjQjUTGEx3AUssIdPxyIVvmMdSIDuEd9Ay6ZaVVSIh8JfW ULlYhvvNlIViCfhBHWzuc3+8SpmPP+M/Io/ESmaUoOAL4AnVBMhlksMLV8V09bBEFNiD iDnzmg+fb3EgoDE7eRpVJOe4VovH1Ie3Cn+bZlg3NcTtI5r9gVSyyDtiZ6lcoSTyPdp8 dGY5jSJRqiMv3gURWxTLr6ug4yu8P0fdhOxi7vWRUGp3h2JfvPcqAWhJyI5kZu66mwOm bN6RPBWcw2/aazUUKBbT5mbN0E2eRZ9aZ/OTtlmzKjX8a0r+JSy1dRJ8bNFy7+0LoNEA T75w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :delivered-to; bh=OHIpGnbODQ4neF+uPCF06XlKShjH+YLRJCcntJ9+XqQ=; b=Ip+bFwU4XA5S4wUkI2C0+pOZpg5oH9lpniX3ESiQsnXfohikd/Wdpj0H09ZBEY1Jqx PWndrN9tKOFWh0GkIYQxli3E96nkaIzi07raB5dnhqGrD5H6ErHhrdaO6CixExAxlyHy LTM2O49cjTBMWW7z+9EZPUunmVmtnFktrXkNIViVl8W1Q9gvBP//SHZoCRF7i0WdZ5Nz +2r22mURLkp21khY/xanU6NNEmVRZ2M2UsjFRQcY6mjMZbimY41XieYyCDNaCvEK7keO Y+eQUxfbdj7xB1lxeFHmvcL518kis29We1ZAz6eIjzmZ0/k0e/TURquFD5gIICunWtz/ WqMA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id 9si484027qty.11.2019.03.13.10.11.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Mar 2019 10:11:47 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 90EF211B77C; Wed, 13 Mar 2019 17:11:45 +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 B231B28577; Wed, 13 Mar 2019 17:11:44 +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 3AEBE3FB12; Wed, 13 Mar 2019 17:11:44 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x2DHBgaC016834 for ; Wed, 13 Mar 2019 13:11:42 -0400 Received: by smtp.corp.redhat.com (Postfix) id D966D605A8; Wed, 13 Mar 2019 17:11:42 +0000 (UTC) Delivered-To: libvirt-list@redhat.com Received: from worklaptop.redhat.com (ovpn-124-40.rdu2.redhat.com [10.10.124.40]) by smtp.corp.redhat.com (Postfix) with ESMTP id CEACC12A7D; Wed, 13 Mar 2019 17:11:39 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Wed, 13 Mar 2019 13:11:31 -0400 Message-Id: <6ff5f1a4ce09bd3efb88dd71d34641cc9bb09416.1552496850.git.crobinso@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/2] 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 13 Mar 2019 17:11:46 +0000 (UTC) We provide a custom configure option --enable-test-coverage and 'make cov' target to generate code coverage reports. However gnulib already provides a 'make coverage' which 'just works' and doesn't require a special configure option. This drops our custom implementation in favor of 'make coverage'. Reports are now output to cov/index.html Signed-off-by: Cole Robinson --- Makefile.am | 20 +++----------------- configure.ac | 18 ------------------ examples/Makefile.am | 2 +- src/Makefile.am | 3 +-- src/remote/Makefile.inc.am | 2 -- tests/Makefile.am | 2 -- tools/Makefile.am | 6 ------ 7 files changed, 5 insertions(+), 48 deletions(-) -- 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list Reviewed-by: Martin Kletzander diff --git a/Makefile.am b/Makefile.am index 709064c6a6..3c06e2619a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -16,15 +16,15 @@ ## License along with this library. If not, see ## . -LCOV = lcov -GENHTML = genhtml - SUBDIRS = . gnulib/lib include/libvirt src tools docs gnulib/tests \ tests po examples XZ_OPT ?= -v -T0 export XZ_OPT +# have gnulib 'make coverage' output to 'cov' dir +COVERAGE_OUT = "cov" + ACLOCAL_AMFLAGS = -I m4 EXTRA_DIST = \ @@ -77,20 +77,6 @@ check-local: all tests check-access: @($(MAKE) $(AM_MAKEFLAGS) -C tests check-access) -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 = .git-module-status dist-hook: gen-ChangeLog gen-AUTHORS diff --git a/configure.ac b/configure.ac index 197d9746b2..880a3a7e40 100644 --- a/configure.ac +++ b/configure.ac @@ -738,23 +738,6 @@ fi AC_SUBST([VIR_TEST_EXPENSIVE_DEFAULT]) AM_CONDITIONAL([WITH_EXPENSIVE_TESTS], [test $VIR_TEST_EXPENSIVE_DEFAULT = 1]) -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 option]) ;; -esac - -if test "$enable_test_coverage" = yes; then - save_WARN_CFLAGS=$WARN_CFLAGS - WARN_CFLAGS= - gl_WARN_ADD([-fprofile-arcs]) - gl_WARN_ADD([-ftest-coverage]) - COVERAGE_FLAGS=$WARN_CFLAGS - AC_SUBST([COVERAGE_CFLAGS], [$COVERAGE_FLAGS]) - AC_SUBST([COVERAGE_LDFLAGS], [$COVERAGE_FLAGS]) - WARN_CFLAGS=$save_WARN_CFLAGS -fi - LIBVIRT_ARG_ENABLE([TEST_OOM], [memory allocation failure checking], [no]) case "$enable_test_oom" in yes|no) ;; @@ -1041,7 +1024,6 @@ 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/examples/Makefile.am b/examples/Makefile.am index e2ec6e7fba..b590a148ce 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -29,7 +29,7 @@ EXTRA_DIST = \ AM_CPPFLAGS = \ -I$(top_builddir)/include -I$(top_srcdir)/include -I$(top_srcdir) -LDADD = $(STATIC_BINARIES) $(WARN_CFLAGS) $(COVERAGE_LDFLAGS) \ +LDADD = $(STATIC_BINARIES) $(WARN_CFLAGS) \ $(top_builddir)/src/libvirt.la \ $(top_builddir)/src/libvirt-admin.la diff --git a/src/Makefile.am b/src/Makefile.am index 8c8dfe3dcf..a880937705 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -43,9 +43,8 @@ AM_CFLAGS = $(LIBXML_CFLAGS) \ $(WARN_CFLAGS) \ $(LOCK_CHECKING_CFLAGS) \ $(WIN32_EXTRA_CFLAGS) \ - $(COVERAGE_CFLAGS) + $(NULL) AM_LDFLAGS = $(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 3d0ff29548..468a3f5d97 100644 --- a/src/remote/Makefile.inc.am +++ b/src/remote/Makefile.inc.am @@ -136,7 +136,6 @@ libvirtd_CFLAGS = \ $(LIBNL_CFLAGS) \ $(WARN_CFLAGS) \ $(PIE_CFLAGS) \ - $(COVERAGE_CFLAGS) \ -I$(srcdir)/access \ -I$(srcdir)/conf \ -I$(srcdir)/rpc \ @@ -145,7 +144,6 @@ libvirtd_CFLAGS = \ libvirtd_LDFLAGS = \ $(RELRO_LDFLAGS) \ $(PIE_LDFLAGS) \ - $(COVERAGE_LDFLAGS) \ $(NO_INDIRECT_LDFLAGS) \ $(NO_UNDEFINED_LDFLAGS) \ $(NULL) diff --git a/tests/Makefile.am b/tests/Makefile.am index a7f1b39a5e..c07a3866c6 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -47,7 +47,6 @@ AM_CFLAGS = \ $(SELINUX_CFLAGS) \ $(APPARMOR_CFLAGS) \ $(YAJL_CFLAGS) \ - $(COVERAGE_CFLAGS) \ $(XDR_CFLAGS) \ $(WARN_CFLAGS) @@ -275,7 +274,6 @@ endif WITH_SECDRIVER_SELINUX # This is a fake SSH we use from virnetsockettest ssh_SOURCES = ssh.c -ssh_LDADD = $(COVERAGE_LDFLAGS) if WITH_LIBXL test_programs += xlconfigtest xml2sexprtest sexpr2xmltest \ diff --git a/tools/Makefile.am b/tools/Makefile.am index f2f84f7852..95025ced43 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -27,7 +27,6 @@ WARN_CFLAGS += $(STRICT_FRAME_LIMIT_CFLAGS) AM_CFLAGS = \ $(WARN_CFLAGS) \ - $(COVERAGE_CFLAGS) \ $(PIE_CFLAGS) \ $(LIBXML_CFLAGS) \ $(NULL) @@ -137,7 +136,6 @@ libvirt_shell_la_CFLAGS = \ libvirt_shell_la_LDFLAGS = \ $(AM_LDFLAGS) \ $(PIE_LDFLAGS) \ - $(COVERAGE_LDFLAGS) \ $(NULL) libvirt_shell_la_LIBADD = \ ../src/libvirt.la \ @@ -183,7 +181,6 @@ endif ! WITH_BHYVE virt_host_validate_LDFLAGS = \ $(AM_LDFLAGS) \ $(PIE_LDFLAGS) \ - $(COVERAGE_LDFLAGS) \ $(NULL) virt_host_validate_LDADD = \ @@ -206,7 +203,6 @@ virt_login_shell_SOURCES = \ virt_login_shell_LDFLAGS = \ $(AM_LDFLAGS) \ $(PIE_LDFLAGS) \ - $(COVERAGE_LDFLAGS) \ $(NULL) virt_login_shell_LDADD = \ $(STATIC_BINARIES) \ @@ -239,7 +235,6 @@ virsh_SOURCES = \ virsh_LDFLAGS = \ $(AM_LDFLAGS) \ $(PIE_LDFLAGS) \ - $(COVERAGE_LDFLAGS) \ $(NULL) virsh_LDADD = \ $(STATIC_BINARIES) \ @@ -257,7 +252,6 @@ virt_admin_SOURCES = \ virt_admin_LDFLAGS = \ $(AM_LDFLAGS) \ - $(COVERAGE_LDFLAGS) \ $(STATIC_BINARIES) \ $(PIE_LDFLAGS) \ $(NULL) From patchwork Wed Mar 13 17:11:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 160259 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp14555870jad; Wed, 13 Mar 2019 10:11:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqwie8rIjwvqc6HItlXsFolHmO1lgwuGnRNiSm+QTRjgCoMAMAfs1idKyiBK8vgMVy7riZg4 X-Received: by 2002:a37:7e84:: with SMTP id z126mr32025720qkc.31.1552497114447; Wed, 13 Mar 2019 10:11:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552497114; cv=none; d=google.com; s=arc-20160816; b=uXl7K3yy15pBIqZY9l1okedIR2891KBRcYLH74GsspvcWcx7Oi9EPNzI2wwhLOb4Zc D1wOLEA9ss9+ZQznO5ruv23DicT16BRSRKobM+EJQVKMcrHrAlwLg/4MHWt8RQmIWfHy 9NdrS4YvuWVE86eDwQW1GK8C9QiaE9LbGC+e4aRpS/PwGdOYPeTf9i0ks7NZVWTqTJDf PbUXP6VdSka8joVEywHC6x9tIqqV7V/lyP/YQf+KGlO1GNE8ZUJjH8rH92eKY9U16xey bioBdIU9UbLObQl0uddNciDKJ8CXEwI7n0eifrAWdX5fB9+Y/+y8XDBvegDCW7Fu81Rc 7Uxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :delivered-to; bh=FXJwjP9nto8BpQLkHloAcBZYE6RU2DcMpoAlbgSTjDA=; b=CW3Xa0D0ymHTeEzVMJAIy1m+XTtGFurZMYClL7WvXcV/E+OBIrOoe4OCzvHSVHg0KT M7ndBlwWVlc9i3dldH/pjwX7d7eKM+97Ak87AX6317pnAF+MHGlpTZNiBYa68VmlYFWK dSV2tzpQs4KfNXxeqqPLrANtLD0GCqMbBpF96DBOwYNqQ4x6tySU0X8LbXGlc6Gk3TEe xkZy/TvdjNb2bTydfD4we1kWTeNcWWvfM0rQ9cy/E3yCgPk222Q7ClUlBcrIjIclEbqI 4BBfjIh8VYBSWiq7c1VixxXyoQGOc7QYDX1k7CF3hMqTIcjROHuc5lmhqDVqp8fObFaC wFVg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id t25si373832qtt.104.2019.03.13.10.11.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Mar 2019 10:11:54 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F0A1730EEF99; Wed, 13 Mar 2019 17:11:52 +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 C8A661024940; Wed, 13 Mar 2019 17:11:52 +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 768D9181A136; Wed, 13 Mar 2019 17:11:52 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x2DHBmmb016881 for ; Wed, 13 Mar 2019 13:11:48 -0400 Received: by smtp.corp.redhat.com (Postfix) id 184FB87A6; Wed, 13 Mar 2019 17:11:48 +0000 (UTC) Delivered-To: libvirt-list@redhat.com Received: from worklaptop.redhat.com (ovpn-124-40.rdu2.redhat.com [10.10.124.40]) by smtp.corp.redhat.com (Postfix) with ESMTP id 16FC0605A8; Wed, 13 Mar 2019 17:11:42 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Wed, 13 Mar 2019 13:11:32 -0400 Message-Id: <6a3cf5c22c9a83c33bf68cd8ab50643bab3c6ace.1552496850.git.crobinso@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/2] 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Wed, 13 Mar 2019 17:11:53 +0000 (UTC) Signed-off-by: Cole Robinson --- docs/hacking.html.in | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) -- 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list Reviewed-by: Martin Kletzander diff --git a/docs/hacking.html.in b/docs/hacking.html.in index f99d143b7b..56608fbc9e 100644 --- a/docs/hacking.html.in +++ b/docs/hacking.html.in @@ -1412,5 +1412,34 @@ int foo() in the same way, but still make sure they get reviewed if non-trivial. +

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 order. + 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
  • +
+