forked from cbatten/ece2400-sec4-c-debug-coverage
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
60 lines (50 loc) · 2.08 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#=========================================================================
# Travis CI Configuration
#=========================================================================
language: c
#-------------------------------------------------------------------------
# addons
#-------------------------------------------------------------------------
# We are using lcov for coverage analysis, so we need to install lcov
# using apt. We also need to install the newer version of gcc/g++ since
# the default version is too old.
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- lcov
- g++-6
- cmake
- valgrind
#-------------------------------------------------------------------------
# install
#-------------------------------------------------------------------------
# We need to do a hack to make gcc default to
# gcc-6. Normally we would just set the CC/CXX environment variables, but
# we are not using them to simplify the Makefile we give students.
install:
- mkdir -p latest-gcc-symlinks
- ln -s /usr/bin/g++-6 latest-gcc-symlinks/g++
- ln -s /usr/bin/gcc-6 latest-gcc-symlinks/gcc
- export PATH=$PWD/latest-gcc-symlinks:$PATH
#-------------------------------------------------------------------------
# script
#-------------------------------------------------------------------------
# Build, test, and evaluate the project. We use make coverage instead of
# make check so that we generate the reports for code coverage analysis.
script:
- gcc -g -coverage -o avg-test avg-test.c
- ./avg-test
- gcc -g -coverage -o gcd-test gcd-test.c
- ./gcd-test
- lcov --capture --directory . --output-file coverage.info
- genhtml coverage.info --output-directory coverage-html
#-------------------------------------------------------------------------
# after_success
#-------------------------------------------------------------------------
# Assuming everything worked, we upload the coverage reports to
# codecov.io. We use -X gcov since we already ran lcov, so there is no
# need to rerun gcov.
after_success:
- bash <(curl -s https://codecov.io/bash)