From nobody Wed Nov 5 08:50:03 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 15305424328661016.1031433035265; Mon, 2 Jul 2018 07:40:32 -0700 (PDT) Received: from localhost ([::1]:33198 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fa00G-0004d3-7f for importer@patchew.org; Mon, 02 Jul 2018 10:40:32 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54353) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fZzqa-0005PI-Sc for qemu-devel@nongnu.org; Mon, 02 Jul 2018 10:30:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fZzqZ-0000Uq-V3 for qemu-devel@nongnu.org; Mon, 02 Jul 2018 10:30:32 -0400 Received: from mail-wr0-x243.google.com ([2a00:1450:400c:c0c::243]:42501) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fZzqZ-0000UQ-Nb for qemu-devel@nongnu.org; Mon, 02 Jul 2018 10:30:31 -0400 Received: by mail-wr0-x243.google.com with SMTP id p1-v6so15793403wrs.9 for ; Mon, 02 Jul 2018 07:30:31 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id 39-v6sm7772153wrv.79.2018.07.02.07.30.24 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 02 Jul 2018 07:30:28 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 5EECD3E07B9; Mon, 2 Jul 2018 15:30:22 +0100 (BST) 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=fh9BZZLgVZxQ3vjTudKSmJVVV2JmmiNrsEKSQjjQOv/z0Yt87GTtMjBLO13oGmQ/D4 CCXYCyYX1AS5D09h1fp06NG+C+OULdV7hbxfn7jOVfOQZmZW3+M59ZeQJ82JsaodKqbK pKdfmpW7+F/YWgpluWRT2TSajrRfjk66mMf+U= 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=b84jJUTfLE9OVkXftqWUuCk5Vqkx9WQa6HziOx/M+9fjJqzeFluup3V4PbgK7PO09y 6laYWjrkef3ZN6sUYm7k3kxRn+eoYPlUP5NAwNKV9ZSXNMJlXd0WrUx9yhsq9IDnAFai WvPdYLjnNpFraCU0vRR7/9KjulhBzVLg91r+Q6xeqHQBgBH8HQ3lLKxDZpFQFWpJmq/p jsNDZAJU+/Ysqq+ofJepJT5X6Lf4A3qXA4EiC4a6xX5UMaf1RvlzNBKr0Nemb6gaFZf6 LgfVs2z5Y0OknG4giIo5nDZ06X+/rWLGepkGT1VtuKXQ5rGaYliuAtVdacN/tBpJhcGR EFwQ== X-Gm-Message-State: APt69E2RBSJ5Ej0zyVoUbn5j0abXMQiQGCIkX7S1J3siqfpacBp3aNag UsvG24rONbma3p7au+USZwAmi7rqf3E= X-Google-Smtp-Source: AAOMgpeSjfJMllGfjvvohM+4Nf7VomHUa2avUiElIuAseHqNoj8OduoaIgAdKan9l25rhDzURnBVRQ== X-Received: by 2002:adf:a792:: with SMTP id j18-v6mr20456965wrc.187.1530541830604; Mon, 02 Jul 2018 07:30:30 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=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: Mon, 2 Jul 2018 15:30:09 +0100 Message-Id: <20180702143021.18864-9-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180702143021.18864-1-alex.bennee@linaro.org> References: <20180702143021.18864-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::243 Subject: [Qemu-devel] [PATCH v3 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: pbonzini@redhat.com, =?UTF-8?q?Alex=20Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 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=C3=A9e Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Daniel P. Berrang=C3=A9 --- v2 - s/generate/create/ --- Makefile | 13 +++++++++++++ docs/devel/testing.rst | 11 ++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) 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-re= f.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 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. =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 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. =20 QEMU iotests =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --=20 2.17.1