Skip to content

Commit c21c05f

Browse files
committed
Portability: fixes for gcc/4.8
Signed-off-by: Henry Cox <[email protected]>
1 parent b1cbb6d commit c21c05f

File tree

6 files changed

+26
-9
lines changed

6 files changed

+26
-9
lines changed

bin/geninfo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1123,7 +1123,7 @@ sub _process_one_chunk($$$$)
11231123
"geninfo_XXXXX",
11241124
DIR => $tempFileDir,
11251125
CLEANUP => !defined($lcovutil::preserve_intermediates)
1126-
) if ($intermediate || !defined($gcda_file));
1126+
) if ($intermediate || defined($gcda_file));
11271127

11281128
# keep track of order - so we can estimate which files were processed
11291129
# at same time

lib/lcovutil.pm

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6298,9 +6298,20 @@ sub applyFilters
62986298
$func->name() . "\n");
62996299
$func->set_end_line($currentLine);
63006300
}
6301-
die('failed to set end line for ' .
6302-
$func->name() . ' in file ' . $func->filename())
6303-
unless defined($func->end_line());
6301+
# we may not have set the end line above due to inconsistency
6302+
# but we also might not have line data
6303+
# - see .../tests/lcov/extract with gcc/4.8
6304+
if (!defined($func->end_line())) {
6305+
lcovutil::ignorable_error(
6306+
$lcovutil::ERROR_INCONSISTENT_DATA,
6307+
'"' . $func->filename() . '":' . $func->line() .
6308+
': failed to set end line for function ' .
6309+
$func->name() .
6310+
". See lcovrc man entry for 'derive_function_end_line'."
6311+
);
6312+
next FUNC;
6313+
}
6314+
63046315
# now look for this function in each testcase -
63056316
# set the same endline (if not already set)
63066317
my $key = $func->file() . ':' . $first;

tests/gendiffcov/simple/script.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -899,8 +899,8 @@ fi
899899
900900
901901
# check select script
902-
echo ${LCOV_HOME}/bin/genhtml $DIFFCOV_OPTS --baseline-file ./baseline.info.gz --diff-file diff.txt --annotate-script `pwd`/annotate.sh --show-owners all --ignore-errors source --select "$SELECT" --select --owner --select stanley.ukeridge current.info -o select
903-
$COVER ${GENHTML_TOOL} $DIFFCOV_OPTS --baseline-file ./baseline.info.gz --diff-file diff.txt --annotate-script `pwd`/annotate.sh --show-owners all --ignore-errors source --select "$SELECT" --select --owner --select stanley.ukeridge current.info -o select
902+
echo ${LCOV_HOME}/bin/genhtml $DIFFCOV_OPTS --baseline-file ./baseline.info.gz --diff-file diff.txt --annotate-script `pwd`/annotate.sh --show-owners all --ignore-errors source --select "$SELECT" --select --owner --select stanley.ukeridge current.info -o select $IGNORE
903+
$COVER ${GENHTML_TOOL} $DIFFCOV_OPTS --baseline-file ./baseline.info.gz --diff-file diff.txt --annotate-script `pwd`/annotate.sh --show-owners all --ignore-errors source --select "$SELECT" --select --owner --select stanley.ukeridge current.info -o select $IGNORE
904904
if [ 0 != $? ] ; then
905905
echo "ERROR: genhtml select did not pass"
906906
status=1
@@ -937,8 +937,8 @@ fi
937937
938938
939939
# check select script
940-
echo ${LCOV_HOME}/bin/genhtml $DIFFCOV_OPTS --baseline-file ./baseline.info.gz --diff-file diff.txt --annotate-script `pwd`/annotate.sh --show-owners all --ignore-errors source --select "$SELECT" --select --owner --select not.there current.info -o select2
941-
$COVER ${GENHTML_TOOL} $DIFFCOV_OPTS --baseline-file ./baseline.info.gz --diff-file diff.txt --annotate-script `pwd`/annotate.sh --show-owners all --ignore-errors source --select "$SELECT" --select --owner --select not.there current.info -o select2
940+
echo ${LCOV_HOME}/bin/genhtml $DIFFCOV_OPTS --baseline-file ./baseline.info.gz --diff-file diff.txt --annotate-script `pwd`/annotate.sh --show-owners all --ignore-errors source --select "$SELECT" --select --owner --select not.there current.info -o select2 $IGNORE
941+
$COVER ${GENHTML_TOOL} $DIFFCOV_OPTS --baseline-file ./baseline.info.gz --diff-file diff.txt --annotate-script `pwd`/annotate.sh --show-owners all --ignore-errors source --select "$SELECT" --select --owner --select not.there current.info -o select2 $IGNORE
942942
if [ 0 != $? ] ; then
943943
echo "ERROR: genhtml select did not pass"
944944
status=1

tests/gendiffcov/synthesize/synthesize.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ if [ 0 != ${PIPESTATUS[0]} ] ; then
217217
fi
218218
COUNT1=`grep -c -i "warning: .*range.* unknown line .* there are only" range.log`
219219
if [ 1 != $COUNT1 ] ; then
220-
echo "Missing expected warning"
220+
echo "Missing expected warning: expected 1 found $COUNT1"
221221
if [ 0 == $KEEP_GOING ] ; then
222222
exit 1
223223
fi

tests/genhtml/lambda/lambda.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,10 @@ if [ "${VER[0]}" -lt 5 ] ; then
9696
IGNORE="--ignore inconsistent"
9797
# and filter exception branches to avoid spurious differences for old compiler
9898
FILTER='--filter branch'
99+
100+
# gcc older than 5 doesn't support lambda
101+
echo "Compiler version it too old - skipping lambda test"
102+
exit 0
99103
fi
100104
101105
rm -rf *.txt* *.json dumper* report lambda *.gcda *.gcno *.info

tests/lcov/gcov-tool/run.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
set -ex
77

8+
rm -f test *.gcno *.gcda
9+
810
echo "Build test program"
911
"$CC" test.c -o test --coverage
1012

0 commit comments

Comments
 (0)