From patchwork Tue Jul 3 10:14:30 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: 140935 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp977921ljj; Tue, 3 Jul 2018 03:18:39 -0700 (PDT) X-Google-Smtp-Source: AAOMgpehGMj4CPdfpho+873+bhXYs5SFGtByZyU0cUIYywawsBtfddOjk2YSO7FtLKUkIzRrvDmg X-Received: by 2002:ac8:1b0e:: with SMTP id y14-v6mr26793927qtj.349.1530613119796; Tue, 03 Jul 2018 03:18:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530613119; cv=none; d=google.com; s=arc-20160816; b=YNSa//NLnj4hq7HtP3Ki1CGMWu/fsbb5Ei7wle9MQXEGpdogylXfzCYoGymx1c78xg NmYxrD/cxbuvPYci1YJPgFFLTOhvEPZGyJMTJvldXn0/8y36NC5bFQIbWzmWGwGI5bAl C0nqY8SGtlpVwKYaNKnqt0lWEJfEjpYHTF0J5mHp4MDpvw6ZCL18B46XIdsFQSDuewfc 19xk0yVB1WiQ+8EF7dFyevXGty9FZWycKQ6WIxkaPmCfQB0qyvYHcZ8nNlVJSKXvfruE VoK3J8fdiuuMUA2MbiGx36LeiA4vqA9LWp4nOHKepeLuDLoUt+h3qxEcG05CcBJ2/fKZ Bxug== 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=/ajiyM6W2S6tJAn/1lUSMSycGS8GwJG/ZBTtG/HLQ+4=; b=edt+ViFJmSEuPSzEo/urO+kvgDomXxHuSym4kVuHNa3Cj3EtMl8mXrAF+t85+u6ZUr 8/iXHEXvzNaABBhvsVDiClSGnpelH7IiSAfijG/+teGeN6ZA1Sn3XewN0mTG3/0tM/uQ LibtnFd+JHZd8AnlIKtEbFgPd7t11PgtiQg5cLeET9bFnzPMZOCZYl3icOMX6RRaKHCX 8MxzeGFOhb6/dU04C9uRlytIuwNNLyyPYFwQHmoHtfmCHoukVTrr7pydiSyOqlopsiSc eqB77hTfp0+FjCNd3NKx8A+p/k5eeol/0sLF8J7oEp34sJlV5IJ4909ayWCZ0iLWQWaC 0lVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=arn5ZCtj; 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 z127-v6si766861qkz.199.2018.07.03.03.18.39 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 03 Jul 2018 03:18:39 -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=arn5ZCtj; 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]:39370 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1faION-0000nF-85 for patch@linaro.org; Tue, 03 Jul 2018 06:18:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43460) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1faIKi-0006lh-Mm for qemu-devel@nongnu.org; Tue, 03 Jul 2018 06:14:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1faIKh-0008Qc-Kb for qemu-devel@nongnu.org; Tue, 03 Jul 2018 06:14:52 -0400 Received: from mail-wr0-x22a.google.com ([2a00:1450:400c:c0c::22a]:38665) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1faIKh-0008Q4-De for qemu-devel@nongnu.org; Tue, 03 Jul 2018 06:14:51 -0400 Received: by mail-wr0-x22a.google.com with SMTP id j33-v6so1363669wrj.5 for ; Tue, 03 Jul 2018 03:14:51 -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=/ajiyM6W2S6tJAn/1lUSMSycGS8GwJG/ZBTtG/HLQ+4=; b=arn5ZCtj5FOEINodn9+Cx0hAGe+kMFkjB12iqbPZKyPgEPUzAF19g9N6rCB3vkIHDE 2f4MiAbgHVAaRBYVJvXF/R0eDzkeFBCZsHxR0SWdcbRFdgsMwanJWBCBtmoWZiv3Nd1S Qota/DhDa0VFgELxtBOD0lgG2IVz6DqjcS6Z0= 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=/ajiyM6W2S6tJAn/1lUSMSycGS8GwJG/ZBTtG/HLQ+4=; b=mCwffahJFhVZpXirUr6i695gLWke7YJxTGlF1g0J297qhYTlIjTzodKyfjETxOf/12 VDWcvxFFkDiWUmWqbqYbG1vgRQzrYV9fC/TcO6OpQznbcUrUghxQAHHh1B8AE2WoqH27 g5KBPtrz53xzIjVmc/jUFR9jastVIR6BneNpIXEXtmPvirjS/I3tmdGaGv7T9EV2uptN EYmJbwW3pEXdcFKcjTcaG3cS2tMuwF50x8rLptKC4OtfyrIXSvXoJbfoeWaPSkXgEouc NT0o7Uwywnr1uKEwCGDiuOFgPGkSuYCoLXvYyUiSafo0X+nJjRpto9eFSN6NtDo6NqJk bQaA== X-Gm-Message-State: APt69E1e4Bv0/RMBrPcfIIsUnTeK9FH3L0ONLkO+OZ+XuMhTB66lKyP8 +dXLkZ1T25sHBZMoH89WXS5rVQ== X-Received: by 2002:adf:d181:: with SMTP id h1-v6mr21877866wri.198.1530612890409; Tue, 03 Jul 2018 03:14:50 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id c128-v6sm1171208wma.17.2018.07.03.03.14.46 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 03 Jul 2018 03:14:46 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 055C73E06DE; 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:30 +0100 Message-Id: <20180703101444.23778-7-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:c0c::22a Subject: [Qemu-devel] [PULL 06/20] 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: 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 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é -- 2.17.1 diff --git a/.travis.yml b/.travis.yml index 32188d51f1..95be6ec59f 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/travis/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/MAINTAINERS b/MAINTAINERS index 42a1892d6a..4917b8e48d 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2165,6 +2165,7 @@ R: Philippe Mathieu-Daudé L: qemu-devel@nongnu.org S: Maintained F: .travis.yml +F: scripts/travis/ F: .shippable.yml F: tests/docker/ F: tests/vm/ diff --git a/scripts/travis/coverage-summary.sh b/scripts/travis/coverage-summary.sh new file mode 100755 index 0000000000..d7086cf9ca --- /dev/null +++ b/scripts/travis/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