@@ -137,8 +137,14 @@ ${CXX} --coverage TEST.cpp
137
137
echo ` which gcov`
138
138
echo ` which lcov`
139
139
140
- echo lcov $LCOV_OPTS --capture --directory . --output-file baseline.info
141
- $COVER $LCOV_HOME /bin/lcov $LCOV_OPTS --capture --directory . --output-file baseline.info --no-external
140
+ # old gcc version generates inconsistent line/function data
141
+ IFS=' .' read -r -a VER <<< ` gcc -dumpversion`
142
+ if [ " ${VER[0]} " -lt 5 ] ; then
143
+ IGNORE=" --ignore inconsistent"
144
+ fi
145
+
146
+ echo lcov $LCOV_OPTS --capture --directory . --output-file baseline.info $IGNORE
147
+ $COVER $LCOV_HOME /bin/lcov $LCOV_OPTS --capture --directory . --output-file baseline.info --no-external $IGNORE
142
148
if [ 0 != $? ] ; then
143
149
echo " ERROR: lcov --capture failed"
144
150
if [ 0 == $KEEP_GOING ] ; then
@@ -200,8 +206,8 @@ rm -f TEST.cpp *.gcno *.gcda a.out
200
206
ln -s ../simple/simple2.cpp TeSt.cpp
201
207
${CXX} --coverage -DADD_CODE -DREMOVE_CODE TeSt.cpp
202
208
./a.out
203
- echo lcov $LCOV_OPTS --capture --directory . --output-file current.info
204
- $COVER $LCOV_HOME /bin/lcov $LCOV_OPTS --capture --directory . --output-file current.info
209
+ echo lcov $LCOV_OPTS --capture --directory . --output-file current.info $IGNORE
210
+ $COVER $LCOV_HOME /bin/lcov $LCOV_OPTS --capture --directory . --output-file current.info $IGNORE
205
211
if [ 0 != $? ] ; then
206
212
echo " ERROR: lcov --capture TeSt failed"
207
213
if [ 0 == $KEEP_GOING ] ; then
217
223
ln -s ../simple/simple2.cpp.annotated TEst.cpp.annotated
218
224
219
225
# check that this works with test names
220
- echo ${LCOV_HOME} /bin/genhtml $DIFFCOV_OPTS --baseline-file ./baseline.info --diff-file diff.txt --annotate-script ` pwd` /annotate.sh --show-owners all --show-noncode -o differential ./current.info --rc case_insensitive=1 --ignore-annotate,source
221
- $COVER ${LCOV_HOME} /bin/genhtml $DIFFCOV_OPTS --baseline-file ./baseline.info --diff-file diff.txt --annotate-script ` pwd` /annotate.sh --show-owners all --show-noncode -o differential ./current.info --rc case_insensitive=1 $GENHTML_PORT --ignore annotate,source
226
+ echo ${LCOV_HOME} /bin/genhtml $DIFFCOV_OPTS --baseline-file ./baseline.info --diff-file diff.txt --annotate-script ` pwd` /annotate.sh --show-owners all --show-noncode -o differential ./current.info --rc case_insensitive=1 --ignore-annotate,source $IGNORE
227
+ $COVER ${LCOV_HOME} /bin/genhtml $DIFFCOV_OPTS --baseline-file ./baseline.info --diff-file diff.txt --annotate-script ` pwd` /annotate.sh --show-owners all --show-noncode -o differential ./current.info --rc case_insensitive=1 $GENHTML_PORT --ignore annotate,source $IGNORE
222
228
if [ 0 != $? ] ; then
223
229
echo " ERROR: genhtml differential failed"
224
230
if [ 0 == $KEEP_GOING ] ; then
@@ -227,8 +233,8 @@ if [ 0 != $? ] ; then
227
233
fi
228
234
229
235
# check warning
230
- echo lcov $LCOV_OPTS --capture --directory . --output-file current.info --substitute ' s/test/TEST/g'
231
- $COVER $LCOV_HOME /bin/lcov $LCOV_OPTS --capture --directory . --output-file current.info --substitute ' s/test\b/TEST/' --rc case_insensitive=1 --ignore unused,source 2>&1 | tee warn.log
236
+ echo lcov $LCOV_OPTS --capture --directory . --output-file current.info --substitute ' s/test/TEST/g' $IGNORE
237
+ $COVER $LCOV_HOME /bin/lcov $LCOV_OPTS --capture --directory . --output-file current.info --substitute ' s/test\b/TEST/' --rc case_insensitive=1 --ignore unused,source $IGNORE 2>&1 | tee warn.log
232
238
if [ 0 != $? ] ; then
233
239
echo " ERROR: lcov --capture TeSt failed"
234
240
if [ 0 == $KEEP_GOING ] ; then
245
251
246
252
rm -f TeSt.cpp
247
253
248
- # check annotateion failure message...
254
+ # check annotation failure message...
249
255
# check that this works with test names
250
- echo ${LCOV_HOME} /bin/genhtml $DIFFCOV_OPTS --baseline-file ./baseline.info --diff-file diff.txt --annotate-script $ANNOTATATE --show-owners all --show-noncode -o differential ./current.info --ignore- source
251
- $COVER ${LCOV_HOME} /bin/genhtml $DIFFCOV_OPTS --baseline-file ./baseline.info --diff-file diff.txt --annotate-script $ANNOTATE --show-owners all --show-noncode -o differential ./current.info $GENHTML_PORT --ignore source 2>&1 | tee fail.log
256
+ echo ${LCOV_HOME} /bin/genhtml $DIFFCOV_OPTS --baseline-file ./baseline.info --diff-file diff.txt --annotate-script $ANNOTATATE --show-owners all --show-noncode -o differential ./current.info --ignore source $IGNORE
257
+ $COVER ${LCOV_HOME} /bin/genhtml $DIFFCOV_OPTS --baseline-file ./baseline.info --diff-file diff.txt --annotate-script $ANNOTATE --show-owners all --show-noncode -o differential ./current.info $GENHTML_PORT --ignore source $IGNORE 2>&1 | tee fail.log
252
258
if [ 0 == ${PIPESTATUS[0]} ] ; then
253
259
echo " ERROR: expected annotation error but didn't find"
254
260
if [ 0 == $KEEP_GOING ] ; then
@@ -261,8 +267,8 @@ if [ 0 != $? ] ; then
261
267
exit 1
262
268
fi
263
269
264
- echo ${LCOV_HOME} /bin/genhtml $DIFFCOV_OPTS --baseline-file ./baseline.info --diff-file diff.txt --annotate-script $ANNOTATATE --show-owners all --show-noncode -o differential ./current.info --ignore-source,annotate
265
- $COVER ${LCOV_HOME} /bin/genhtml $DIFFCOV_OPTS --baseline-file ./baseline.info --diff-file diff.txt --annotate-script $ANNOTATE --show-owners all --show-noncode -o differential ./current.info $GENHTML_PORT --ignore source,annotate 2>&1 | tee fail2.log
270
+ echo ${LCOV_HOME} /bin/genhtml $DIFFCOV_OPTS --baseline-file ./baseline.info --diff-file diff.txt --annotate-script $ANNOTATATE --show-owners all --show-noncode -o differential ./current.info --ignore-source,annotate $IGNORE
271
+ $COVER ${LCOV_HOME} /bin/genhtml $DIFFCOV_OPTS --baseline-file ./baseline.info --diff-file diff.txt --annotate-script $ANNOTATE --show-owners all --show-noncode -o differential ./current.info $GENHTML_PORT --ignore source,annotate $IGNORE 2>&1 | tee fail2.log
266
272
if [ 0 == ${PIPESTATUS[0]} ] ; then
267
273
echo " ERROR: expected synthesize error but didn't find"
268
274
if [ 0 == $KEEP_GOING ] ; then
@@ -280,8 +286,8 @@ if [ 0 != $? ] ; then
280
286
exit 1
281
287
fi
282
288
283
- echo ${LCOV_HOME} /bin/genhtml $DIFFCOV_OPTS --baseline-file ./baseline.info --diff-file diff.txt --annotate-script $ANNOTATATE --show-owners all --show-noncode -o differential ./current.info --ignore-source,annotate --synthesize
284
- $COVER ${LCOV_HOME} /bin/genhtml $DIFFCOV_OPTS --baseline-file ./baseline.info --diff-file diff.txt --annotate-script $ANNOTATE --show-owners all --show-noncode -o differential ./current.info $GENHTML_PORT --ignore source,annotate --synthesize 2>&1 | tee fail3.log
289
+ echo ${LCOV_HOME} /bin/genhtml $DIFFCOV_OPTS --baseline-file ./baseline.info --diff-file diff.txt --annotate-script $ANNOTATATE --show-owners all --show-noncode -o differential ./current.info --ignore-source,annotate --synthesize $IGNORE
290
+ $COVER ${LCOV_HOME} /bin/genhtml $DIFFCOV_OPTS --baseline-file ./baseline.info --diff-file diff.txt --annotate-script $ANNOTATE --show-owners all --show-noncode -o differential ./current.info $GENHTML_PORT --ignore source,annotate --synthesize $IGNORE 2>&1 | tee fail3.log
285
291
if [ 0 != ${PIPESTATUS[0]} ] ; then
286
292
echo " ERROR: unexpected synthesize error"
287
293
if [ 0 == $KEEP_GOING ] ; then
0 commit comments