Giter Site home page Giter Site logo

gs1's People

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

gs1's Issues

Add compile script and code coverage display

Hello xtofpic !

I would suggest adding a script to automatically build this library + launch your test + have a code coverage (using your test).
There are travis and codecov.io which are free for open source projects.
Only requirement: create an account on those websites and add a .travis.yml file on project root folder. A build will then be launched at every commit (or with a manual trigger directly on the travis website)!
The build result and % of code coverage can then be directly displayed on the readme of your project if you want to (travis 'badge' and codecov 'badge') !

A potential example of the .travis.yml file (not tested) :

language: cpp
matrix:
  include:
  - name: Linux
    os: linux
    dist: xenial
    before_install:
    - sudo apt update -qq
    - sudo apt install build-essential
    # Dependency for test coverage
    - sudo apt install python3-pip
    - sudo pip3 install codecov
    # Dependency for Datamatrix library
    - sudo pip3 install conan
    compiler:
    - g++
    script:
    - cmake -G "Eclipse CDT4 - Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug -DCMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT=TRUE -DCMAKE_ECLIPSE_MAKE_ARGUMENTS=-j12 -DCMAKE_ECLIPSE_VERSION=4.17 ..
    - make
    - env CTEST_OUTPUT_ON_FAILURE=1 make test
    - coverage run -p ./test
    # Prepare results before sending them back  codecov
    - coverage combineto
    after_success:
    # Push code coverage result into codecov.io
    - bash <(curl -s https://codecov.io/bash)

You can also add a codecov.yml file if you want to add specific requirements for the code coverage:

codecov:
  require_ci_to_pass: yes

coverage:
  ignore:
    - "CMake/**"
    - "tests/**"

Example of a project with build and code coverage (lib tested with multiple OS if you want to be sure your library is usable everywhere) :
https://github.com/QuentinCG/QDhcpDiscovery/blob/master/.travis.yml

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.