From patchwork Wed Jun 20 13:20: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: 139342 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp796453lji; Wed, 20 Jun 2018 06:30:56 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJ6D4GB0LHWNnYbqQGGeOYZKPFBK3++Xd41Mt8jyYYGI8+ZeWQHqXstgArkbMcKuGFu4Ie4 X-Received: by 2002:a0c:964e:: with SMTP id 14-v6mr18347227qvy.98.1529501456296; Wed, 20 Jun 2018 06:30:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529501456; cv=none; d=google.com; s=arc-20160816; b=Ky6U55bKt4w2hXpfvWUXFf4apr88EAOxUZhwQVYkAoW+uzApLFozR4U3PYvqR8YJPz nzo1P1s8pQo5SeRgbU+bPP3SAGqxDWVJt0Md3iBbwVV67XTcT+fIx8MiMA1BsK7fmRNz HnIszMjQv20bSVL2kWpy5x/T48PBb+GQmyZ1WQgVYwboxF0aiPcZyzhWu6g3t9sr/9gK 1nfCE+UTyQ/d6UJt6YDprXZRtwlqalZmC2C9KAy01bzpmMHfBTcrtZWTI3ZpZQjGQyso XS9gpTZcwMYGLw5KY5jsEKZZbAhgBVTtBad6pKpTFrfywM0HsJRlWddBJafT2LCiRDw2 ulTw== 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=pAwjhM+QKaOn/D5Q7G6m80xibAAi7GmM7LxpKJMtf9Y=; b=gn2neIxJfnBUJajtAT49whVlEn/z3qBn5InXPNsSbRE6m1pGqRV5VugE5eOgQNiW5x tDLwtPF9gd5PLH4nsFbuJZ7u32mhBNLZiiCZHch4AlJ8Z+9NDIYEe7nxIzD4SzbYowOn 7Rt7NSEsNVhy3bYCTFt03gmC5BHnYRVuLJxNX9VkYSYm1PL0snipDxHH4P1SluziVXEl E92ldzvNYKe/BfVjz0RxYBsWd8bmOMAEUxusi25Zon/sUqc33yoxthwOVK479R/Emu0y VywAoG+GG+HnkoBLfr6Mufm5xapcrfTk3Xzj/Fp8dYD9hzZeN8rx9lRrtgTlXQiDUDCW s+ew== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Ai3D1Rgh; 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 p6-v6si2425431qvk.246.2018.06.20.06.30.56 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 20 Jun 2018 06:30:56 -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=Ai3D1Rgh; 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]:49688 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fVdCJ-0008Sp-PO for patch@linaro.org; Wed, 20 Jun 2018 09:30:55 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55063) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fVd2P-000809-A2 for qemu-devel@nongnu.org; Wed, 20 Jun 2018 09:20:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fVd2N-0002mI-GY for qemu-devel@nongnu.org; Wed, 20 Jun 2018 09:20:41 -0400 Received: from mail-wr0-x244.google.com ([2a00:1450:400c:c0c::244]:34551) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fVd2N-0002ld-4w for qemu-devel@nongnu.org; Wed, 20 Jun 2018 09:20:39 -0400 Received: by mail-wr0-x244.google.com with SMTP id a12-v6so3306000wro.1 for ; Wed, 20 Jun 2018 06:20:39 -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=pAwjhM+QKaOn/D5Q7G6m80xibAAi7GmM7LxpKJMtf9Y=; b=Ai3D1Rghi7dRZNwQNJAwN+tgrdqVV6anoE17mDbc9UFETb476D5LdAE0QXwA9k93J+ brIcnOd0oBj/eoVeWbrB0mOKn9L4gHPAQzs4NrX7kNPp+/gevnU6n5lpUtAwC5Q5zkyI Pm6AYa7v3x4sNM84JNWPDd/k3xPYRR7e5l1og= 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=pAwjhM+QKaOn/D5Q7G6m80xibAAi7GmM7LxpKJMtf9Y=; b=Mc00fWYqXPAZsuHquot0Tt1pv4rD5NXoh5e68CLIr+3N/WlWiQynivMw7j1M02rRIW 7zbCSYqOMJJbp+p19FVNa4h5DyyfkLk0630kk4959Eu9K+njeDgQab9oOxeKVzvmq4S/ RtY92rvjcLde0jk4v4SBZrhwgvienxhhtacxUvGrkpOiLJBxwAROXmniugu3pWEeADKu DWH3qtgVYDpm0OcBWGxBAeds6kT0XfDLyI+8Cmlg5lRzGVvns1UxPqjElLu0bumZKcsm 8vg43aTvMgaZobawhvBpPiSZOf31LmbfyN+WJMuMiwh7ifvpb1jteclnPMBv34tqq8Nv LMvQ== X-Gm-Message-State: APt69E1sjtZES83bXcJhczgwfFNXFfX1tmUlfMCwPr/QBgGXcCkDsS/p p6IFpABFAX1CBDxDf06fKFgtxg== X-Received: by 2002:adf:a35b:: with SMTP id d27-v6mr1763804wrb.189.1529500838179; Wed, 20 Jun 2018 06:20:38 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id w24-v6sm1970475wmc.15.2018.06.20.06.20.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 20 Jun 2018 06:20:37 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id A4A8C3E08E8; Wed, 20 Jun 2018 14:20: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: Wed, 20 Jun 2018 14:20:32 +0100 Message-Id: <20180620132032.12952-6-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180620132032.12952-1-alex.bennee@linaro.org> References: <20180620132032.12952-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:c0c::244 Subject: [Qemu-devel] [RFC PATCH 5/5] 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: =?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 --- Makefile | 13 +++++++++++++ docs/devel/testing.rst | 11 ++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) -- 2.17.1 Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé diff --git a/Makefile b/Makefile index cb4af8bf80..7450e0b7b5 100644 --- a/Makefile +++ b/Makefile @@ -988,6 +988,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 @@ -1097,6 +1107,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 a3652aea14..9dcdd19260 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 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 generate into +./reports/coverage/coverage-report.html. If you want to generate 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 ============