From patchwork Tue Feb 7 13:48:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 93567 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp2206095qgi; Tue, 7 Feb 2017 05:48:39 -0800 (PST) X-Received: by 10.36.196.8 with SMTP id v8mr11404012itf.115.1486475319126; Tue, 07 Feb 2017 05:48:39 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id h191si11804969iof.17.2017.02.07.05.48.38; Tue, 07 Feb 2017 05:48:39 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 8B12E60E72; Tue, 7 Feb 2017 13:48:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 343856094C; Tue, 7 Feb 2017 13:48:33 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 4C6C5609A9; Tue, 7 Feb 2017 13:48:30 +0000 (UTC) Received: from mail-lf0-f45.google.com (mail-lf0-f45.google.com [209.85.215.45]) by lists.linaro.org (Postfix) with ESMTPS id E92C56093A for ; Tue, 7 Feb 2017 13:48:28 +0000 (UTC) Received: by mail-lf0-f45.google.com with SMTP id z134so63206363lff.3 for ; Tue, 07 Feb 2017 05:48:28 -0800 (PST) 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; bh=18jDXsSFGhwI5/H9wycZgK7ddZhvmvXsPmWRDvMvFn8=; b=HFv8daM8NNNewPPV/9KSNkkBcAO3eDR2/cnb5ZSTUc9w4Omr/Vm0rX8nfxQSZnbo2H TDzTyuwzn7lJERZQeoO7Bq5DStZGoFUZFf7OEeXdLtz2epYiZD1fdZPHQG9C+qF9hM2z jM9+VdaqpG3K6a1Ohj+laVIQCnNhGE++o63qPahgiTYehmmLGvVUkRRAKWb6dJbOQYV+ nPPueAKlZaffDUy++UAIOSzZiPZbXuKYeLIArpuCY57hvTrw0vmlvM3DPL+DHXSuM82b Eq0aDVUZdbDrIVye6LklziBRgFHQ4hSvZ8aembdB6pPkTldfdmz2gyFyy+nout8OGFrF zoDQ== X-Gm-Message-State: AIkVDXIp2tMqpWQwBMV6nEujIBt9VkX4lwsWsG0Kk5F7SB1AKIazMQuOfYZt/2mYele5tzAl83w= X-Received: by 10.25.193.3 with SMTP id r3mr5682831lff.54.1486475307470; Tue, 07 Feb 2017 05:48:27 -0800 (PST) Received: from localhost.localdomain (ppp109-252-7-40.pppoe.spdop.ru. [109.252.7.40]) by smtp.gmail.com with ESMTPSA id 9sm1355850ljn.1.2017.02.07.05.48.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 07 Feb 2017 05:48:26 -0800 (PST) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Tue, 7 Feb 2017 16:48:12 +0300 Message-Id: <20170207134812.13012-1-maxim.uvarov@linaro.org> X-Mailer: git-send-email 2.11.0.295.gd7dffce Subject: [lng-odp] [PATCHv3] codecov: add code coverage integrated to github X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" Results for code coverage will be available in https://codecov.io. On each successful run in github automatic code coverage will be run under travis ci. And at the end of travis log there will be link to code coverage for specific commit which you push. Also github merge requests will post automatically status of code coverage and update it if you changed merge request to new version. This patch also adds matrix to test both gcc and clang due to gcov is broken Travis CI shipment. Coverage done only for gcc tests. Signed-off-by: Maxim Uvarov --- .codecov.yml | 25 +++++++++++++++++++++++++ .travis.yml | 45 +++++++++++++++++++++++++++++++++++---------- 2 files changed, 60 insertions(+), 10 deletions(-) create mode 100644 .codecov.yml -- 2.11.0.295.gd7dffce Reviewed-by: Mike Holmes diff --git a/.codecov.yml b/.codecov.yml new file mode 100644 index 00000000..86bcd1dc --- /dev/null +++ b/.codecov.yml @@ -0,0 +1,25 @@ +codecov: + notify: + require_ci_to_pass: yes + +coverage: + precision: 3 + round: down + range: "50...75" + status: + project: yes + patch: yes + changes: yes + +parsers: + gcov: + branch_detection: + conditional: yes + loop: yes + method: no + macro: no + +comment: + layout: "header, diff, files" + behavior: default + require_changes: no diff --git a/.travis.yml b/.travis.yml index f12242ce..5b9a29a6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,6 +7,8 @@ # pushing to github/coverity_scan will also launch a static analysis # See https://scan.coverity.com/travis_ci +language: c +sudo: required env: global: # COVERITY_SCAN_TOKEN @@ -24,10 +26,27 @@ env: # copy the secure: below # - secure: "xxxx" + # + # By default Linaro CODECOV_TOKEN token is used. It's ok to use it to see + # for individual commit validation. But you you want to track tests history + # you need generated new one at https://codecov.io specific for your repo. + - CODECOV_TOKEN=8e1c0fd8-62ff-411e-a79f-5839f6662c11 -language: c -compiler: clang -sudo: required +matrix: + include: + - compiler: gcc-4.8 + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - gcc-4.8 + env: MY_CF="-O0 -coverage" MY_LDF="--coverage" DOCOV=1 + - compiler: clang + addons: + apt: + packages: + - clang before_install: - echo 1000 | sudo tee /proc/sys/vm/nr_hugepages @@ -37,7 +56,9 @@ before_install: - sudo apt-get -qq update - sudo apt-get install automake autoconf libtool libssl-dev graphviz mscgen doxygen - sudo apt-get install libpcap-dev linux-headers-`uname -r` + - sudo pip install coverage - gem install asciidoctor + - PATH=${PATH//:\.\/node_modules\/\.bin/} # Install cunit for the validation tests because distro version is too old and fails C99 compile - export CUNIT_VERSION=2.1-3 @@ -74,18 +95,22 @@ before_install: - popd script: - - - ./bootstrap - - ./configure --enable-test-cpp --enable-test-vald --enable-test-helper --enable-test-perf --enable-user-guides --enable-test-perf-proc --enable-test-example --with-dpdk-path=`pwd`/dpdk/${TARGET} --with-netmap-path=`pwd`/netmap - - make -j 4 - - sudo LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH" make check - - sudo git clean -f -d -x && rm -rf dpdk && rm -rf netmap && rm -rf $KSRC - - ./bootstrap - ./configure - make doxygen-doc - make distcheck + - ./bootstrap + - ./configure --enable-test-cpp --enable-test-vald --enable-test-helper --enable-test-perf --enable-user-guides --enable-test-perf-proc --enable-test-example --with-dpdk-path=`pwd`/dpdk/${TARGET} --with-netmap-path=`pwd`/netmap CFLAGS="$MY_CF" CXXFLAGS="$MY_CF" LDFLAGS="$MY_LDF" + - make -j 4 + - sudo LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH" make check + - sudo rm -rf dpdk + - sudo rm -rf netmap + - sudo rm -rf $KSRC + +after_success: + - if [ -n "$DOCOV" ]; then find . -type f -iname '*.[ch]' -not -path ".git/*" -execdir gcov-4.8 {} \; ; bash <(curl -s https://codecov.io/bash) -X coveragepy; fi + addons: coverity_scan: project: