From nobody Tue Feb 10 07:01:31 2026 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 1529926081894667.2175634104025; Mon, 25 Jun 2018 04:28:01 -0700 (PDT) Received: from localhost ([::1]:45577 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXPf7-0002R0-4w for importer@patchew.org; Mon, 25 Jun 2018 07:28:01 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56800) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXPX6-0004y1-CW for qemu-devel@nongnu.org; Mon, 25 Jun 2018 07:19:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fXPX5-0008DY-8d for qemu-devel@nongnu.org; Mon, 25 Jun 2018 07:19:44 -0400 Received: from mail-wr0-x229.google.com ([2a00:1450:400c:c0c::229]:38944) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fXPX5-0008Cz-1Z for qemu-devel@nongnu.org; Mon, 25 Jun 2018 07:19:43 -0400 Received: by mail-wr0-x229.google.com with SMTP id b8-v6so7833347wro.6 for ; Mon, 25 Jun 2018 04:19:42 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id r2-v6sm12453780wmb.39.2018.06.25.04.19.37 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 25 Jun 2018 04:19:40 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 5D00A3E0930; Mon, 25 Jun 2018 12:19:36 +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=yTn5APyxCbjkgEmg6gKUhpchO+isbR681XgDS3c8VS0=; b=PtEjpB1G9yQgf2IrlhgKHmb2H2yB1U7gHLO2zU2SfkE1XVRDDBopheBSUMDldH4Qas C6KDEvMEAtJhCGj+t6Q0VeAZN2OFsOcoRBMxm7RxnPWdZ453QnLc5U2Qaadmd2CfMU2T otxxBmFx3+XJBpCa0ja8krt090MPH1awGGrcw= 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=yTn5APyxCbjkgEmg6gKUhpchO+isbR681XgDS3c8VS0=; b=OZ9PXdi+PRc0ZhSE2LSasY+ax17ROD0Amq4DoVimPcqpm5zdxifBtmebM1BytEsvds qwINCKWI1/ejyzxf8oIdcm2GC3On2GecZZ9s+BYjG0Z0Gorug7bKWbokGMXJlJhoE9hM pvLoJYD/D8CHhys5FWsxOicXtfPitYzgmtM0MFPXqHAeLMsfOkzRnAKdRZuIfnWEYa+7 eryPuRqh4XJT8ZUOFgW2nIoBntrLBe6o0Wp1iJTammaVwz9mBSh7A5szkwSOD4U0ZGmB a+OGs4oduqxlW8Qxnsbj8Rh6QPHrwpVn+EIhsFSctMevXvxvMRHjInQpmAvEITCV1LN2 Xi1w== X-Gm-Message-State: APt69E0Jgz4Wrlj4fTgmwzgtT5957uDae/l0taV04WfPJu3eUMCs7quL Qfcc3z6BAvb2HdxFxEtaX07sAw== X-Google-Smtp-Source: AAOMgpfy2lYvSEpF879KlZhtgpaFgL1pPZTyxOFYuZ2BSYO3zXAh4SfZg7DrbYImMpjm5TxrirwCHw== X-Received: by 2002:adf:8307:: with SMTP id 7-v6mr1502920wrd.243.1529925581936; Mon, 25 Jun 2018 04:19:41 -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, 25 Jun 2018 12:19:31 +0100 Message-Id: <20180625111935.26108-7-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180625111935.26108-1-alex.bennee@linaro.org> References: <20180625111935.26108-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::229 Subject: [Qemu-devel] [PATCH v1 06/10] 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: =?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 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=C3=A9e Reviewed-by: Daniel P. Berrang=C3=A9 --- 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 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 =20 # 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=3D"--enable-gprof --enable-gcov --disable-pie --target-l= ist=3Daarch64-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=3D"--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=C3=A9e +# +# 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 --=20 2.17.1