123
123
elif [ "$1" = 'travis-ci' ]; then
124
124
apt-get install -q --no-install-recommends $(sed -n -e '/^Build-Depends: /,/^Build-Depends-Indep: / {p}' debian/control | sed -e 's#([^)]*)##g' -e 's#^Build-Depends\(-Indep\)\?: ##' | tr -d ',')
125
125
apt-get install -q --no-install-recommends $(sed -n 's#^Depends: .*@, \(.*\)$#\1#p' debian/tests/control | tr -d ',')
126
elif [ "$1" = 'coverage' ]; then
127
DIR="${2:-./coverage}"
128
git clean -dfX # remove ignored build artefacts for a clean start
129
make CFLAGS+='--coverage' CXXFLAGS+='--coverage'
130
LCOVRC='--rc geninfo_checksum=1 --rc lcov_branch_coverage=1'
132
lcov --no-external --directory . --capture --initial --output-file "${DIR}/apt.coverage.init" ${LCOVRC}
134
./test/integration/run-tests -q
135
lcov --no-external --directory . --capture --output-file "${DIR}/apt.coverage.run" ${LCOVRC}
136
lcov -a "${DIR}/apt.coverage.init" -a "${DIR}/apt.coverage.run" -o "${DIR}/apt.coverage.total" ${LCOVRC}
137
cp "${DIR}/apt.coverage.total" "${DIR}/apt.coverage.fixed"
141
name="$(basename "$file")"
142
while [ -n "$1" ]; do
143
if [ -r "$1/$name" ]; then
144
sed -i "s#$file#$1/$name#" "${DIR}/apt.coverage.fixed"
150
echo >&2 "Coverage data captured for unknown file $file"
153
grep 'build/include/' "${DIR}/apt.coverage.fixed" | sed "s#^SF:$(pwd)/##" | while read file; do
154
rewritefile "$file" 'apt-pkg' 'apt-pkg/deb' 'apt-pkg/edsp' 'apt-pkg/contrib' \
155
'apt-inst' 'apt-inst/deb' 'apt-inst/contrib' 'apt-private'
157
genhtml --output-directory "${DIR}" "${DIR}/apt.coverage.fixed" ${LCOVRC}
127
159
echo >&1 "Usage:\t$0 pre-export
131
If you use »git buildpackage« you can leave this script alone as it will
162
If you use »git buildpackage« you can leave these alone as they will
132
163
be run at the right places auto-magically. Otherwise you should use
133
164
»pre-export« to update po and pot files as well as version numbering.
134
165
»post-build« can be used to run some more or less useful checks later on.
136
»library« isn't run automatically but can be useful for maintaining the
137
(more or less experimental) symbols files we provide"
168
\t$0 buildlog filename…
170
»library« and »buildlog« aren't run automatically but can be useful for
171
maintaining the (more or less experimental) symbols files we provide.
172
»library« displays the diff between advertised symbols and the once provided
173
by the libraries, while »buildlog« extracts this diff from the buildlogs.
174
Both will format the diff properly.
177
\t$0 coverage [output-dir]
179
»travis-ci« is a shortcut to install all build- as well as test-dependencies
181
»coverage« does a clean build with the right flags for coverage reporting,
182
runs all tests and generates a html report in the end.