From patchwork Fri Jun 29 20:52:17 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: 140645 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp1302531ljj; Fri, 29 Jun 2018 14:00:47 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeQpzzWwnt5UHUB+iMeYLJ/QlGtwuMVQXWAX5Ba4pKpxuZSofMvvzVkEvVcSyQh5AlyrSDF X-Received: by 2002:a0c:886d:: with SMTP id 42-v6mr2165002qvm.242.1530306047778; Fri, 29 Jun 2018 14:00:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530306047; cv=none; d=google.com; s=arc-20160816; b=ObqmLOcberjFOa+Y5NHKDfEr32SCdc6lCdcdV6bcp62XLxWKAm6tPVItZDETPfphX3 ginMvhauLo6h1iUTlxWgrz/Nz24kVMznKX+yXIQJj5BhiTyLLNYRS5W1tsh4f4I0wwMN JkmNMsskkvrmnJyixQX++qEaYK7R7/KDQKSXFYTVZKGGZ5fIaHs1CIYzCAtuyNhzeR5U tpewg/obZ0DIutb7qy2wamR16NGK+1UsXkZ9lXz0LHw+/vHTYVp+RIxbihVbT0R9bRnR kABqhqg8rthnBlDjweokaBzgJlWoy0NYsAFlhPKP8Mp/38ECrTQPahoedCcTmznU4b9I bdDg== 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=bRpbPm13lorLId8VksREIcnpDhBdJ4PsEKuVIqX5wv4=; b=SwtR2p0WgagrIcshxX/uU9/8JHe2VZVrvGkEsCSykYERJlsiMiUw4y74Q4OtYvEyMa wM2235BqwlrtFXv30BC15bvs+KiCYJ7Nni+Kg6GNqlx9zMtGWjEWRU0fFLX8Q5j/IYrD 9cYppLwi2LGX5lUvj7tK95mqW4o+feOx8gIzw9znMHdAA/2MCGYlJowAqNLwYr2tihE/ jW0nPcb0LFM13cVnypiFnFY9dmZM/ZYKeLW85dvRcwwobDPT2u1mWwaQYqj7WHecPMWa 1Y+5nf4jHowULdA8Id8AYszfeKz6IZyZmdR9zsdqZ9MeBoXEQb0OTCOU6zjn+HFBV3bI OI1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=dGNacW6i; 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 m70-v6si3804171qkl.389.2018.06.29.14.00.47 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 29 Jun 2018 14:00:47 -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=dGNacW6i; 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]:44447 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fZ0Vb-0005qM-40 for patch@linaro.org; Fri, 29 Jun 2018 17:00:47 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56218) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fZ0Nm-000846-02 for qemu-devel@nongnu.org; Fri, 29 Jun 2018 16:52:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fZ0Nk-0006QC-VB for qemu-devel@nongnu.org; Fri, 29 Jun 2018 16:52:42 -0400 Received: from mail-wm0-x233.google.com ([2a00:1450:400c:c09::233]:38857) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fZ0Nk-0006Ol-Ox for qemu-devel@nongnu.org; Fri, 29 Jun 2018 16:52:40 -0400 Received: by mail-wm0-x233.google.com with SMTP id 69-v6so3270707wmf.3 for ; Fri, 29 Jun 2018 13:52:40 -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=bRpbPm13lorLId8VksREIcnpDhBdJ4PsEKuVIqX5wv4=; b=dGNacW6iPkZ0NfkklOjsYfIzq5hZ8dToKP841C9JwrZzuvd4UgC7WwfFX444xrrQd9 XtK1YiIaeh+t7JazZ1TDScsb+unfBplEU+C9i5fmIRMK/aP/ZQrykMDj3lolBLUI274l 5JYhpqEs/75cHpOQy56FEUCMfT+CDV3QggmMI= 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=bRpbPm13lorLId8VksREIcnpDhBdJ4PsEKuVIqX5wv4=; b=gKvjvzDcLlEQlcEz/F590jkn0xYlG/HLnMm7pg5StkK9TnkwboalhPaLo3cua7GIka lanl8PwmSNwi5Z6ANYJQuZQw8RitoF9yCyYWt8GH3snu72oLC2siyEUM7LICnRwJiNew 0kvaoSZZDINEW9HXtfYWV33zkFL5LnNauZMlDbBoBF6rphswMjB37W4/+zjWvws7XeLq ZiA3jEtkvgNqqTk7fzDP6dYkqpp8t8WAuICXv58mar+dGqC5s/nURROmC1XDZWz1IDaX ty9DDFNab4pOCiXpNKKgPSv9+fGpGc88q8GRWTZr6uUOQyzRlh5CSt91zN3ywDlZA+a8 lpgQ== X-Gm-Message-State: APt69E1rv+7MeLV0DOFSTTGz4RzzmfgkKUX2wGbIpEAOYDh42221ozxW nkFDvAKYDtlgjrMf6E0WuXLuBw== X-Received: by 2002:a1c:7f95:: with SMTP id a143-v6mr2645930wmd.108.1530305559577; Fri, 29 Jun 2018 13:52:39 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id j7-v6sm4741591wrn.96.2018.06.29.13.52.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 29 Jun 2018 13:52:34 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 4265C3E0317; 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:17 +0100 Message-Id: <20180629205232.27190-7-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::233 Subject: [Qemu-devel] [PATCH v2 06/21] travis: add gcovr summary for GCOV build 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 gives a more useful summary, sorted by descending % coverage, after the tests have run. The final numbers will give an idea if our coverage is getting better or worse. To keep the width sane we need to post process the file that the old gcovr tool generates. This is done with a mix of sed, awk and column in the scripts/coverage-summary.sh script. As quite a lot of lines don't get covered at all we filter out all the 0% lines. If the file doesn't appear it is not being exercised. Signed-off-by: Alex Bennée Reviewed-by: Daniel P. Berrangé --- v2 - pushed finagling into scripts/coverage-summary.sh - dropped r-b as a big change --- .travis.yml | 3 +++ scripts/coverage-summary.sh | 27 +++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100755 scripts/coverage-summary.sh -- 2.17.1 diff --git a/.travis.yml b/.travis.yml index 32188d51f1..aa850c913c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -38,6 +38,7 @@ addons: - libvte-2.90-dev - sparse - uuid-dev + - gcovr # The channel name "irc.oftc.net#qemu" is encrypted against qemu/qemu # to prevent IRC notifications from forks. This was created using: @@ -86,6 +87,8 @@ matrix: compiler: clang # gprof/gcov are GCC features - env: CONFIG="--enable-gprof --enable-gcov --disable-pie --target-list=aarch64-softmmu,arm-softmmu,i386-softmmu,mips-softmmu,mips64-softmmu,ppc64-softmmu,riscv64-softmmu,s390x-softmmu,x86_64-softmmu" + after_success: + - ${SRC_DIR}/scripts/coverage-summary.sh compiler: gcc # We manually include builds which we disable "make check" for - env: CONFIG="--enable-debug --enable-tcg-interpreter" diff --git a/scripts/coverage-summary.sh b/scripts/coverage-summary.sh new file mode 100755 index 0000000000..d7086cf9ca --- /dev/null +++ b/scripts/coverage-summary.sh @@ -0,0 +1,27 @@ +#!/bin/sh +# +# Author: Alex Bennée +# +# Summerise the state of code coverage with gcovr and tweak the output +# to be more sane on Travis hosts. As we expect to be executed on a +# throw away CI instance we do spam temp files all over the shop. You +# most likely don't want to execute this script but just call gcovr +# directly. See also "make coverage-report" +# +# This code is licensed under the GPL version 2 or later. See +# the COPYING file in the top-level directory. + +# first generate the coverage report +gcovr -p -o raw-report.txt + +# strip the full-path and line markers +sed s@$PWD\/@@ raw-report.txt | sed s/[0-9]\*[,-]//g > simplified.txt + +# reflow lines that got split +awk '/.[ch]$/ { printf("%s", $0); next } 1' simplified.txt > rejoined.txt + +# columnify +column -t rejoined.txt > final.txt + +# and dump, stripping out 0% coverage +grep -v "0%" final.txt