/example-bash

Codecov: Bash/Shell coverage example

Primary LanguageShell

Codecov Bash Example

FOSSA Status

Guide

Travis Setup

Add to your .travis.yml file.

language: generic

sudo: required

addons:
  apt:
    packages:
      - libcurl4-openssl-dev
      - libelf-dev
      - libdw-dev
      - cmake

after_success: |
  wget https://github.com/SimonKagstrom/kcov/archive/master.tar.gz &&
  tar xzf master.tar.gz &&
  cd kcov-master &&
  mkdir build &&
  cd build &&
  cmake .. &&
  make &&
  sudo make install &&
  cd ../.. &&
  rm -rf kcov-master &&
  mkdir -p coverage &&
  kcov coverage script.sh &&
  bash <(curl -s https://codecov.io/bash)

Additional apt packages are kcov build dependencies. Codecov is integrated by the following line in after_success:

Produce Coverage Reports

Run your tests with kcov in order to create the necessary coverage reports. For example:

kcov output_path script.sh

Caveats

Private Repo

Repository tokens are required for (a) all private repos, (b) public repos not using Travis-CI, CircleCI or AppVeyor. Find your repository token at Codecov and provide via appending -t <your upload token> to you where you upload reports.

Links

License

FOSSA Status