Git Product home page Git Product logo

cpp-coveralls's Introduction

Upload C/C++ coverage report to coveralls.io

PyPI version Build Status Code Quality

Inspired from z4r/python-coveralls, it uploads the coverage report of C/C++ project to coveralls.io

Instructions

  • Build your project with gcov support
  • Run tests
  • Run coveralls

Environment variables

cpp-coveralls recognizes the following environment variables:

  • COVERALLS_REPO_TOKEN
  • COVERALLS_ENDPOINT
  • COVERALLS_PARALLEL
  • COVERALLS_SERVICE_NAME

Usage:

$ coveralls -h
usage: coveralls [-h] [--verbose] [--dryrun] [--gcov FILE]
                 [--gcov-options GCOV_OPTS] [-r DIR] [-b DIR] [-e DIR|FILE]
                 [-i DIR|FILE] [-E REGEXP] [-x EXT] [-y FILE] [-n] [-t TOKEN]
                 [--encodings ENCODINGS [ENCODINGS ...]] [--dump [FILE]]
                 [--skip-ssl-verify]

optional arguments:
  -h, --help            show this help message and exit
  --verbose             print verbose messages
  --dryrun              run coveralls without uploading report
  --gcov FILE           set the location of gcov
  --gcov-options GCOV_OPTS
                        set the options given to gcov
  -r DIR, --root DIR    set the root directory
  -b DIR, --build-root DIR
                        set the directory from which gcov will be called; by
                        default gcov is run in the directory of the .o files;
                        however the paths of the sources are often relative to
                        the directory from which the compiler was run and
                        these relative paths are saved in the .o file; when
                        this happens, gcov needs to run in the same directory
                        as the compiler in order to find the source files
  -e DIR|FILE, --exclude DIR|FILE
                        set exclude file or directory
  -i DIR|FILE, --include DIR|FILE
                        set include file or directory
  -E REGEXP, --exclude-pattern REGEXP
                        set exclude file/directory pattern
  --exclude-lines-pattern REGEXP
                        set exclude lines pattern
  -x EXT, --extension EXT
                        set extension of files to process
  -y FILE, --coveralls-yaml FILE
                        coveralls yaml file name (default: .coveralls.yml)
  -n, --no-gcov         do not run gcov
  -t TOKEN, --repo-token TOKEN, --repo_token TOKEN
                        set the repo_token of this project, alternatively you
                        can set the environmental variable
                        COVERALLS_REPO_TOKEN
  --encodings ENCODINGS [ENCODINGS ...]
                        source encodings to try in order of preference
                        (default: ['utf-8', 'latin-1'])
  --dump [FILE]         dump JSON payload to a file
  --skip-ssl-verify     skip ssl certificate verification when communicating with the coveralls server

Example .travis.yml

Linux

Install cpp-coveralls with pip, add gcov to your compilation option, compile, run your test and send the result to http://coveralls.io :

language: cpp
compiler:
  - gcc
before_install:
  - pip install --user cpp-coveralls
script:
  - ./configure --enable-gcov && make && make check
after_success:
  - coveralls --exclude lib --exclude tests --gcov-options '\-lp'

OS X

Python on OS X can be a bit of a hassle so you need to install to set up your custom environment:

language: objective-c
compiler:
  - gcc
before_install:
  - brew update
  - brew install pyenv
  - eval "$(pyenv init -)"
  - pyenv install 2.7.6
  - pyenv global 2.7.6
  - pyenv rehash
  - pip install cpp-coveralls
  - pyenv rehash
script:
  - ./configure --enable-gcov && make && make check
after_success:
  - coveralls --exclude lib --exclude tests --gcov-options '\-lp'

cpp-coveralls's People

Contributors

0xced avatar anjos avatar bchretien avatar blueyed avatar chrisosaurus avatar czchen avatar d-frey avatar dmakarov avatar eddyxu avatar jbenden avatar jrfonseca avatar jtbandes avatar martindelille avatar meshell avatar mousius avatar myint avatar neonichu avatar nharraud avatar nickmerwin avatar nitnelave avatar nomis52 avatar remram44 avatar sjaeckel avatar smspillaz avatar sumedhghaisas avatar tbonfort avatar thomas-bc avatar ueno avatar worktycho avatar xav83 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.