Changes between Version 2 and Version 3 of TravisCoverals


Ignore:
Timestamp:
Dec 18, 2014, 4:38:26 PM (8 years ago)
Author:
Antony Polukhin
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • TravisCoverals

    v2 v3  
    1 '''Travis and Coveralls integration'''
     1== Travis and Coveralls integration ==
     2
     3=== Setup ===
    24
    35We'll be adding TravisCI and Coveralls integration to a Boost library. Let's take a Boost.LexicalCast as an example. At the end we'll get [https://github.com/boostorg/variant#test-results something like this].
     
    2123* now add the `.travis.yml` file, tune the `README.md` and commit changes:
    2224{{{
    23 cp ../variant/.travis.yml ./                       # Copying .travis.yml from Boost.Variant
    24 git add .travis.yml                                # Adding .travis.yml for next commit
     25cp ../variant/.travis.yml ./                                 # Copying .travis.yml from Boost.Variant
     26sed -i 's/IGNORE_COVERAGE=.*/IGNORE_COVERAGE=/g' .travis.yml # Reseting files to ignore in coverage tests report
     27git add .travis.yml                                          # Adding .travis.yml for next commit
    2528
    26 cp ../variant/README.md ./                         # Copying README.md from Boost.Variant
    27 sed -i 's/variant/lexical_cast/g' README.md        # Replacing `variant` with `lexical_cast`
    28 sed -i 's/apolukhin/<your_login>/g' README.md      # Replace `apolukhin` login name wuth your own login name
    29 gedit README.md                                    # ... editing README.md in editor
    30 git add README.md                                  # Adding README.md for next commit
     29cp ../variant/README.md ./                                   # Copying README.md from Boost.Variant
     30sed -i 's/variant/lexical_cast/g' README.md                  # Replacing `variant` with `lexical_cast`
     31sed -i 's/apolukhin/<your_login>/g' README.md                # Replace `apolukhin` login name wuth your own login name
     32gedit README.md                                              # ... editing README.md in editor
     33git add README.md                                            # Adding README.md for next commit
    3134
    32 git commit -m "Travis and Coveralls integration"   # Committing changes to GIT
    33 git push                                           # push changes to boostorg and forked repo using one command
     35git commit -m "Travis and Coveralls integration"             # Committing changes to GIT
     36git push                                                     # push changes to boostorg and forked repo using one command
    3437}}}
    3538
    3639
    37 That's it! If everything is done right, you'll see the build process going on TravisCI and after ~20 minutes results will be visible in README.md view on github.
     40That's it! If everything is done right, you'll see the build process going on TravisCI and after ~20 minutes results will be visible in README.md view on github.
     41
     42
     43
     44=== Coveralls tuning ===
     45
     46==== Investigating the results ====
     47
     48After successful run of TravisCI and Coveralls we'll see tests coverage results displayed in README.md view on github. Time to investigate the results!
     49
     50* click on the results [https://coveralls.io/r/apolukhin/lexical_cast?branch=develop]
     51* click on the build number to see detailed coverage description
     52* click on the source file you wish to investigate
     53
     54==== Setting sources location ====
     55Chances are high, that Coveralls will fail to automatically detect source location. In that case you need to
     56* set "Git repo root directory:" to /home/travis/boost-local/
     57* set "Git repo sub directory: :" to include/ (or src/ in case of a source file in src/ folder)
     58
     59If everything is done right you'll see the source file with highlighted lines. Green lines are covered by tests, red lines are in binary file and '''are not''' covered by test, gray lines are not in a test's '''binary file''' (there's no code in tests that uses/compile that line).
     60
     61==== Ignoring specified files coverage ====
     62Sometimes files from other projects could appear in coverage reports. To disable those files edit `.travis.yml` file and set `IGNORE_COVERAGE=` to files that must be ignored. `IGNORE_COVERAGE` variable understands wildcards, so you could disable files just like this:
     63{{{
     64    - IGNORE_COVERAGE='*/boost/progress.hpp */filesystem/src/path.cpp */numeric/conversion/converter_policies.hpp'
     65}}}