From patchwork Tue Jul 3 10:14:32 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: 140939 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp982208ljj; Tue, 3 Jul 2018 03:23:26 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdiM/KJQ/FOhn4ui6jB2bZky+fiMvlk2OgQ0uGhnFEYBbBpV7nLK2ERdBXB/xLEnMacqk28 X-Received: by 2002:a0c:becb:: with SMTP id f11-v6mr18956645qvj.217.1530613406681; Tue, 03 Jul 2018 03:23:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530613406; cv=none; d=google.com; s=arc-20160816; b=uNV0hgGf8jQ+Nq9EgXFRE0mWVOG1rs5H8E7GGs/vEghRIr9KeiormjqD2olCnEbQqy lMmAxxMi/QSn5M2XJ4XQujvA+B//PC6uHxkIV01e9sCmJtGp+hm4EvCxyJVqleZRvmyp n9hrqshXjQuqcYwwbD0K5pjNMq1CqbA6i9vjzmotDAtGCru/bzllEfjs6FAyRMqEEN2e xlmA6i4MdlEocKpDYtTudQ9xl8NaJi4OSi/JKUZ6hyQNgsexQ8cjn23Ow8OcITRui17U NLFQrC5h2xnOLH+LNn6jZCUuMVpuCyFVEZ575mAnh1sqPstyWJz61yE5P3vkbogKaurc HH+Q== 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=gH9kwGR/d3n3ZZtMKFuV2Io0FY37dkTA4ZArazBX2eY=; b=JcqZLMFWaOmdv+pr2e+X/9fZALXzUEYoM24NIriLP25dNyOPI2HndEQT5QWH1A/GDy 7Bums6yQgqLaL0df3whVKb9Q5yZmBqYAKZ+yvTl1NUZvttfN430W0R81XEGhxVguM5fr zS2YWHliP9q9G7EdQGcvQ65loF5JDZSAtz0Ck6kG9LQBvGysnBBHWJ+0sh6r+J5cDSeb KLnAdOIDhi/BwjAU7ZTHIKkh6DV0E2PaJdZhFGkqolUJ4x/fa1lBDl640zNI3SIHschd HLRKnMI7mXtGRMTBzar60b/0aGLyd1i9FbENErzeLPYM7xy+pL81PS95+0Ie+b9wZeN0 ohgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=K+JnYA11; 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 s53-v6si749589qts.218.2018.07.03.03.23.26 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 03 Jul 2018 03:23:26 -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=K+JnYA11; 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]:39389 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1faIT0-0003lW-3A for patch@linaro.org; Tue, 03 Jul 2018 06:23:26 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43496) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1faIKm-0006nX-3I for qemu-devel@nongnu.org; Tue, 03 Jul 2018 06:14:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1faIKl-0008SJ-6U for qemu-devel@nongnu.org; Tue, 03 Jul 2018 06:14:56 -0400 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]:50715) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1faIKk-0008Rl-W3 for qemu-devel@nongnu.org; Tue, 03 Jul 2018 06:14:55 -0400 Received: by mail-wm0-x242.google.com with SMTP id v25-v6so1718104wmc.0 for ; Tue, 03 Jul 2018 03:14:54 -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=gH9kwGR/d3n3ZZtMKFuV2Io0FY37dkTA4ZArazBX2eY=; b=K+JnYA11+GnoMQe2fvTqf9Pega97OWhKg+wWs7lePpbEZBl0HOGyX02+Q0QkzCv46h QxHeUP/CoR4pzDRo4RUTPDm5DujI2venShGQ9wGfArOCdJ7riKb2DhqodyzbbjKQLU3m ULuwDAH4+hNYDGcIaZTr8gVKYx6Uf72YZQlWA= 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=gH9kwGR/d3n3ZZtMKFuV2Io0FY37dkTA4ZArazBX2eY=; b=aqAaXp0LWRxIxyUN1rGjsxp3iXPA4COqeNWIJ1sqaLbIda3WQ0ldoauoT48MiPL7VF WkvuLjJd+NszDiJz4pxbeQ4Psd/82Gu098cclK70DYYhWagDsH6oxd6yH6azV+XRtaaU 9wwhxtP4XVOLKZSCRpo9mYP5mmuIW8hrH/TLR4QfgJlStBBeB+yXRwdEmOxCW6D2fkz6 Dqs77rY/tJUNEEPnsf0xNj5Ihqo3kLb2xh2NRXnNDEcYr5COhwQrsQ4aJohEnx2FDMfh OqqkMbSeHqJMl51cMWHK4IJymyaYxcgO642cvkmzs0qxKIs51Ux+2AiXpcibi5Qb80gc wVYg== X-Gm-Message-State: APt69E10NqGAiqB41YFmNF3jizDRZnDnVSC6x3NGr65VRd0FGr7K6KB4 rGi4sZiwX2HbAQodh61f23iU9gqCeMM= X-Received: by 2002:a1c:9c0b:: with SMTP id f11-v6mr10380057wme.148.1530612893898; Tue, 03 Jul 2018 03:14:53 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id v9-v6sm1278459wrn.97.2018.07.03.03.14.46 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 03 Jul 2018 03:14:51 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 2C7A53E072E; Tue, 3 Jul 2018 11:14:45 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Tue, 3 Jul 2018 11:14:32 +0100 Message-Id: <20180703101444.23778-9-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180703101444.23778-1-alex.bennee@linaro.org> References: <20180703101444.23778-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::242 Subject: [Qemu-devel] [PULL 08/20] 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: agraf@suse.de, =?utf-8?q?Alex_Benn=C3=A9e?= , richard.henderson@linaro.org, qemu-devel@nongnu.org, f4bug@amsat.org, cota@braap.org, famz@redhat.com, aurelien@aurel32.net 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é -- 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 ============