Skip to content

Commit 0dec934

Browse files
committed
Bug in 'gitversion' script.
See #343. Signed-off-by: Henry Cox <[email protected]>
1 parent 5ea2780 commit 0dec934

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

scripts/gitversion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ if (!GetOptions("--compare" => \$compare,
5757
}
5858

5959
if ($compare) {
60-
print $class->compare_version(@ARGV) . "\n";
60+
exit $class->compare_version(@ARGV);
6161
} else {
6262
print $class->extract_version(@ARGV) . "\n";
6363
}

tests/gendiffcov/simple/script.sh

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ fi
275275
# test filter with differing version
276276
$COVER $LCOV_TOOL $EXTRA_GCOV_OPTS $BASE_OPTS --version-script "$GET_VERSION_EXE --md5 --allow-missing" --output filt2.info --filter branch,line -a baseline2.info $IGNORE
277277
if [ 0 == $? ] ; then
278-
echo "ERROR: filter with mismatched version did not fail"
278+
echo "ERROR: filter with mismatched version did not fail 2"
279279
status=1
280280
if [ 0 == $KEEP_GOING ] ; then
281281
exit 1
@@ -1598,8 +1598,9 @@ if [ 0 == $? ] ; then
15981598
fi
15991599
16001600
# skip both errors
1601-
echo genhtml $DIFFCOV_OPTS --output-directory ./usage --rc memory_percentage --rc -memory_percentage=50 baseline_orig.info --ignore usage
1602-
$COVER $GENHTML_TOOL $DIFFCOV_OPTS --output-directory ./usage --rc memory_percentage --rc percent=5 baseline_orig.info --ignore usage $IGNORE
1601+
# ignore version error which might happen if timestamp is included
1602+
echo genhtml $DIFFCOV_OPTS --output-directory ./usage --rc memory_percentage --rc -memory_percentage=50 baseline_orig.info --ignore usage,version
1603+
$COVER $GENHTML_TOOL $DIFFCOV_OPTS --output-directory ./usage --rc memory_percentage --rc percent=5 baseline_orig.info --ignore usage,version $IGNORE
16031604
if [ 0 != $? ] ; then
16041605
echo "ERROR: didn't ignore errors"
16051606
status=1
@@ -1609,8 +1610,8 @@ if [ 0 != $? ] ; then
16091610
fi
16101611
16111612
# skip both errors - but check total message count
1612-
echo genhtml $DIFFCOV_OPTS --output-directory ./expect_err --rc memory_percentage --rc -memory_percentage=50 baseline_orig.info --ignore usage --expect usage:1
1613-
$COVER $GENHTML_TOOL $DIFFCOV_OPTS --output-directory ./expect_err --rc memory_percentage --rc percent=5 baseline_orig.info --ignore usage $IGNORE --expect usage:1 2>&1 | tee expect_err.log
1613+
echo genhtml $DIFFCOV_OPTS --output-directory ./expect_err --rc memory_percentage --rc -memory_percentage=50 baseline_orig.info --ignore usage,version --expect usage:1
1614+
$COVER $GENHTML_TOOL $DIFFCOV_OPTS --output-directory ./expect_err --rc memory_percentage --rc percent=5 baseline_orig.info --ignore usage,version $IGNORE --expect usage:1 2>&1 | tee expect_err.log
16141615
if [ 0 == ${PIPESTATUS[0]} ] ; then
16151616
echo "ERROR: didn't catch expect count error"
16161617
status=1
@@ -1621,8 +1622,8 @@ fi
16211622
grep -E "ERROR:.*count.*'usage' constraint .+ is not true" expect_err.log
16221623
16231624
# now skip the count message too
1624-
echo genhtml $DIFFCOV_OPTS --output-directory ./expect --rc memory_percentage --rc -memory_percentage=50 baseline_orig.info --ignore usage,count --rc expect_message_count=usage:1 --msg-log
1625-
$COVER $GENHTML_TOOL $DIFFCOV_OPTS --output-directory ./expect --rc memory_percentage --rc percent=5 baseline_orig.info --ignore usage,count $IGNORE --rc expect_message_count=usage:1 --msg-log 2>&1 | tee expect.log
1625+
echo genhtml $DIFFCOV_OPTS --output-directory ./expect --rc memory_percentage --rc -memory_percentage=50 baseline_orig.info --ignore usage,version,count --rc expect_message_count=usage:1 --msg-log
1626+
$COVER $GENHTML_TOOL $DIFFCOV_OPTS --output-directory ./expect --rc memory_percentage --rc percent=5 baseline_orig.info --ignore usage,version,count $IGNORE --rc expect_message_count=usage:1 --msg-log 2>&1 | tee expect.log
16261627
if [ 0 != ${PIPESTATUS[0]} ] ; then
16271628
echo "ERROR: didn't skip expect count error"
16281629
status=1

0 commit comments

Comments
 (0)