From patchwork Fri Jun 29 20:52:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 140643 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp1300486ljj; Fri, 29 Jun 2018 13:58:38 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeSFKF2FGPDElU+YrOTxM66V++Y2C2iZPZcWTRWW3JJ5phoMuTXi80M2FMTDIip+s6fjlZm X-Received: by 2002:ae9:e848:: with SMTP id a69-v6mr14622217qkg.161.1530305918360; Fri, 29 Jun 2018 13:58:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530305918; cv=none; d=google.com; s=arc-20160816; b=DO31oTtLRIBjIStmig07rK/Gr1diFcoXX2JEbgYSZx334SO3XuSramTCUSMwtVSCWj uMmCDBF/PU/3wznZxIBAtGdwzopgijkfVewvhTq2OcO/wxqjhkKu3/tCYkyf/q0QaT6w EwQOSUf0ZZ/+Rixdj6EwSngN9MO/BKiuQjyhIRs11OebV46b7iq/cXzQeKwsrbh07VOW hovEgaMp88GRw+XpkNGS2NWoH2l7dFfeIKPr9+hAGM4mEVTS/GPtDD9TBm0spaF59aVg P8J35nAmsfRuHylU/ttyN9EowCFF6Rk7q64vevswYjpOgcodJK5g467DHsglXDAK+drO MvLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=bDIq0TKu4RbDKYBliAPOg2srULSqrJVbQbfPc/vEsuU=; b=Xe9XLbYaz14CA8MB8/1tf6524o653GvEdUjwrt1Ja+gLyB8RlI2tLA1QN8tu5mLdkb 6+1T0pU6I94/8pqtKJu2s72NfJ3bX8/Ujp8A/VKesyTSNoNQyJGTbHx7Lrol9nZpY7iG +Pf8Yd6ekJ0kM75GyisSN1xsI321TZ647HnrX7N0ksOzfVLKFNrus1fs76/ppjqPrNHT q8zlpQ0zft9U8e+kVlHiiDDlZeuUrNCGWQqOC2O9tA84+8MD7GiK+YLe/5K5mYUtzk+G Hxe4urf/+G5au7drYFUpvIriEP4fVBYWEtSk/5d3VztRCotAtyyJa1V7r8lq7Ma/ELhy /jzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="gWMPi/8x"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id z202-v6si489306qka.185.2018.06.29.13.58.38 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 29 Jun 2018 13:58:38 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="gWMPi/8x"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:44439 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fZ0TV-0004dw-Q9 for patch@linaro.org; Fri, 29 Jun 2018 16:58:37 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56248) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fZ0Np-00086n-3z for qemu-devel@nongnu.org; Fri, 29 Jun 2018 16:52:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fZ0No-0006UG-43 for qemu-devel@nongnu.org; Fri, 29 Jun 2018 16:52:45 -0400 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]:39594) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fZ0Nn-0006T5-Ti for qemu-devel@nongnu.org; Fri, 29 Jun 2018 16:52:44 -0400 Received: by mail-wm0-x241.google.com with SMTP id p11-v6so3271278wmc.4 for ; Fri, 29 Jun 2018 13:52:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=bDIq0TKu4RbDKYBliAPOg2srULSqrJVbQbfPc/vEsuU=; b=gWMPi/8xiCKnKzbX35ncEd3ZgDBs0o4Uiq/QmdZXOfumv+/ZA27eK0rLuO0IWbLKRT 8AE/GqPPZxEDfhWrMcrHBBOEeQmLIFkj/+dNoHJ9Wh3629pSx0+NgvySLOiCe56xBZPE XRSulruCI2+r2pG/GMcXpm3LyXewsEz3hUHgE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=bDIq0TKu4RbDKYBliAPOg2srULSqrJVbQbfPc/vEsuU=; b=YFYBdizvgrDwJfaAImgthjumtGLFGpTvV2b5+BgDl+rDN+nh9XsZNRLWFPWX1KFxEH JUISpaN8+a+8H8YhNGqu1J1WzoO/iwd49exbtDtDM1Z9sfXLc2FXiQPBvdT7E4EKN1Uj lQpk6KTSCAJ+It6/xQj4tMHBqli6LLX+Qo78wN6AH3koNy7wBrR4F4rrEX49gGuzrvf4 lPBOQLSHDC3eFwDjX/uIFM9YXnXK1tocNzAqqOyZgchLSIerIz43SlcmX/IWxcwcsu4K x1OlBHPhPNFyu2CbECViJh/POO7kx+k+1lr67YoJQzY7+vz3Dd25WSK7TEnhm+PKnn6A 0zmg== X-Gm-Message-State: APt69E0BFGKWNiq53hCN4Sl0u2LyWjDS5PbZD0uUT3hIIhL4jiP9PkLO 3yVu6r1kXqrHla5O6QSZh177PA== X-Received: by 2002:a1c:d7c3:: with SMTP id o186-v6mr2666411wmg.67.1530305562699; Fri, 29 Jun 2018 13:52:42 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id m58-v6sm19985884wrf.61.2018.06.29.13.52.35 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 29 Jun 2018 13:52:39 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 69D023E072E; Fri, 29 Jun 2018 21:52:33 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: cota@braap.org, famz@redhat.com, berrange@redhat.com, f4bug@amsat.org, richard.henderson@linaro.org, balrogg@gmail.com, aurelien@aurel32.net, agraf@suse.de Date: Fri, 29 Jun 2018 21:52:19 +0100 Message-Id: <20180629205232.27190-9-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180629205232.27190-1-alex.bennee@linaro.org> References: <20180629205232.27190-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::241 Subject: [Qemu-devel] [PATCH v2 08/21] build-system: add coverage-report target X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: pbonzini@redhat.com, =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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: make foo/bar/coverage-report.html Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Reviewed-by: Daniel P. Berrangé --- v2 - s/generate/create/ --- Makefile | 13 +++++++++++++ docs/devel/testing.rst | 11 ++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) -- 2.17.1 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-qmp-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 +# 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 ifdef CONFIG_WIN32 @@ -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 7f04ca104e..5e19cd50da 100644 --- a/docs/devel/testing.rst +++ b/docs/devel/testing.rst @@ -166,9 +166,14 @@ If you want to gather coverage information on a single test the ``make clean-coverage`` target can be used to delete any existing coverage information before running a single test. -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 create +./reports/coverage/coverage-report.html. If you want to create it +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. QEMU iotests ============