File tree Expand file tree Collapse file tree 16 files changed +107
-50
lines changed
Expand file tree Collapse file tree 16 files changed +107
-50
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ pip-log.txt
2525.coverage
2626.tox
2727nosetests.xml
28- * _test_output
28+ * _test_output *
2929* .gcov
3030output.json
3131* .gcno
Original file line number Diff line number Diff line change @@ -9,12 +9,25 @@ python:
99
1010addons :
1111 apt :
12+ sources :
13+ - ubuntu-toolchain-r-test
1214 packages :
1315 - lcov
16+ - g++-4.8
17+ - g++-5
18+ - g++-6
19+ - g++-7
20+ - g++-8
21+ - g++-9
22+ - g++-9
23+ # Required for latest lcov build - TODO: remove the need for this...
24+ - libperlio-gzip-perl
25+ - libjson-perl
1426
1527install :
1628 - python setup.py --quiet install
1729
1830script :
1931 - nosetests
20- - ./test.bash
32+ - git clone https://github.com/linux-test-project/lcov.git
33+ - PATH="$PWD/lcov/bin:$PATH" ./test.bash --gcc-version 4.8 --gcc-version 5 --gcc-version 6 --gcc-version 7 --gcc-version 8 --gcc-version 9
Original file line number Diff line number Diff line change 11part_unused.o : part_unused.h part_unused.cpp
2- g++ --coverage -c -o part_unused.o part_unused.cpp
2+ $( CXX ) --coverage -c -o part_unused.o part_unused.cpp
33
44toy.o : extra_lib/toy.cpp extra_lib/toy.h
5- g++ --coverage -c -o toy.o extra_lib/toy.cpp
5+ $( CXX ) --coverage -c -o toy.o extra_lib/toy.cpp
66
77a_toy.o : another_extra_lib/another_toy.cpp another_extra_lib/another_toy.h
8- g++ --coverage -c -o a_toy.o another_extra_lib/another_toy.cpp
8+ $( CXX ) --coverage -c -o a_toy.o another_extra_lib/another_toy.cpp
99
1010foo : foo.cpp part_unused.o toy.o a_toy.o extra_lib/toy.h another_extra_lib/another_toy.h
11- g++ --coverage -o foo foo.cpp part_unused.o toy.o a_toy.o
11+ $( CXX ) --coverage -o foo foo.cpp part_unused.o toy.o a_toy.o
1212
1313clean :
1414 rm -f foo * .gcno * .gcda output * .gcov output.json part_unused.o toy.o a_toy.o
Original file line number Diff line number Diff line change 11part_unused.o : part_unused.h part_unused.cpp
2- g++ --coverage -c -o part_unused.o part_unused.cpp
2+ $( CXX ) --coverage -c -o part_unused.o part_unused.cpp
33
44toy.o : extra_lib/toy.cpp extra_lib/toy.h
5- g++ --coverage -c -o toy.o extra_lib/toy.cpp
5+ $( CXX ) --coverage -c -o toy.o extra_lib/toy.cpp
66
77a_toy.o : another_extra_lib/another_toy.cpp another_extra_lib/another_toy.h
8- g++ --coverage -c -o a_toy.o another_extra_lib/another_toy.cpp
8+ $( CXX ) --coverage -c -o a_toy.o another_extra_lib/another_toy.cpp
99
1010foo : foo.cpp part_unused.o toy.o a_toy.o extra_lib/toy.h another_extra_lib/another_toy.h
11- g++ --coverage -o foo foo.cpp part_unused.o toy.o a_toy.o
11+ $( CXX ) --coverage -o foo foo.cpp part_unused.o toy.o a_toy.o
1212
1313clean :
1414 rm -f foo * .gcno * .gcda output * .gcov output.json part_unused.o toy.o a_toy.o
Original file line number Diff line number Diff line change 11unused.o : unused.h unused.cpp
2- gcc --coverage -c -o unused.o unused.cpp
2+ $( CXX ) --coverage -c -o unused.o unused.cpp
33foo : foo.c unused.o
4- gcc --coverage -o foo foo.c
4+ $( CXX ) --coverage -o foo foo.c
55
66clean :
77 rm -f foo * .gcno * .gcda output * .gcov output.json unused.o
Original file line number Diff line number Diff line change @@ -6,9 +6,9 @@ gcov_expected_output="expected_gcov.json"
66# Override to change the file that contains the expected output for the lcov run
77lcov_expected_output=" expected_lcov.json"
88
9- gcc_version=$( g++ -v 2>&1 | awk ' /gcc version/ {print $3}' )
9+ gcc_version=$( $CXX -v 2>&1 | awk ' /gcc version/ {print $3}' )
1010if [[ " $gcc_version " < " 5.5" ]]; then
11- echo " LEGACY G++ detected: skipping GCOV missing files test"
11+ echo " LEGACY G++ detected ( $gcc_version : $CXX ) : skipping GCOV missing files test"
1212 modes=" lcov"
1313else
1414 modes=" gcov lcov"
Original file line number Diff line number Diff line change @@ -2,16 +2,16 @@ SOURCE_TREE=../source_tree
22INCLUDE_FLAGS =-I$(SOURCE_TREE ) /llib
33
44lib.o : $(SOURCE_TREE ) /llib/lib.cpp $(SOURCE_TREE ) /llib/lib.h
5- g++ --coverage -c -o $@ $(SOURCE_TREE ) /llib/lib.cpp
5+ $( CXX ) --coverage -c -o $@ $(SOURCE_TREE ) /llib/lib.cpp
66
77lib.a : lib.o
88 ar cr $@ $+
99
1010a : $(SOURCE_TREE ) /A/a.cpp lib.a
11- g++ --coverage $(INCLUDE_FLAGS ) -o a $+
11+ $( CXX ) --coverage $(INCLUDE_FLAGS ) -o a $+
1212
1313b : $(SOURCE_TREE ) /B/b.cpp lib.a
14- g++ --coverage $(INCLUDE_FLAGS ) -o b $+
14+ $( CXX ) --coverage $(INCLUDE_FLAGS ) -o b $+
1515
1616prepare_test : a b
1717
Original file line number Diff line number Diff line change 11foo : foo.c
2- gcc --coverage -o foo foo.c
2+ $( CXX ) --coverage -o foo foo.c
33
44clean :
55 rm -f foo * .gcno * .gcda output * .gcov output.json
Original file line number Diff line number Diff line change 11llib/lib.o : llib/lib.cpp llib/lib.h
2- g++ --coverage -c -o $@ llib/lib.cpp
2+ $( CXX ) --coverage -c -o $@ llib/lib.cpp
33
44llib/lib.a : llib/lib.o
55 ar cr $@ $+
66
77A/a : A/a.cpp llib/lib.a
8- cd A && g++ --coverage -I../llib -o a a.cpp ../llib/lib.a
8+ cd A && $( CXX ) --coverage -I../llib -o a a.cpp ../llib/lib.a
99
1010B/b : B/b.cpp llib/lib.a
11- cd B && g++ --coverage -I../llib -o b b.cpp ../llib/lib.a
11+ cd B && $( CXX ) --coverage -I../llib -o b b.cpp ../llib/lib.a
1212
1313prepare_test : A/a B/b
1414
Original file line number Diff line number Diff line change 11#! /bin/bash
2+ gcc_version=$( $CXX -v 2>&1 | awk ' /gcc version/ {print $3}' )
3+ if [[ " $gcc_version " < " 8" ]]; then
4+ gcov_fail_reason=" "
5+ else
6+ gcov_fail_reason=" cpp-coveralls parser does not support modern gcov's output"
7+ fi
You can’t perform that action at this time.
0 commit comments