From 0dec934024bf7c6d6e4e8fd28ed9a833083a0822 Mon Sep 17 00:00:00 2001 From: Henry Cox Date: Wed, 18 Dec 2024 11:05:19 -0500 Subject: [PATCH] Bug in 'gitversion' script. See #343. Signed-off-by: Henry Cox --- scripts/gitversion | 2 +- tests/gendiffcov/simple/script.sh | 15 ++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/scripts/gitversion b/scripts/gitversion index 8764d8c7..a295d854 100755 --- a/scripts/gitversion +++ b/scripts/gitversion @@ -57,7 +57,7 @@ if (!GetOptions("--compare" => \$compare, } if ($compare) { - print $class->compare_version(@ARGV) . "\n"; + exit $class->compare_version(@ARGV); } else { print $class->extract_version(@ARGV) . "\n"; } diff --git a/tests/gendiffcov/simple/script.sh b/tests/gendiffcov/simple/script.sh index d655afba..d3088352 100755 --- a/tests/gendiffcov/simple/script.sh +++ b/tests/gendiffcov/simple/script.sh @@ -275,7 +275,7 @@ fi # test filter with differing version $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 if [ 0 == $? ] ; then - echo "ERROR: filter with mismatched version did not fail" + echo "ERROR: filter with mismatched version did not fail 2" status=1 if [ 0 == $KEEP_GOING ] ; then exit 1 @@ -1598,8 +1598,9 @@ if [ 0 == $? ] ; then fi # skip both errors -echo genhtml $DIFFCOV_OPTS --output-directory ./usage --rc memory_percentage --rc -memory_percentage=50 baseline_orig.info --ignore usage -$COVER $GENHTML_TOOL $DIFFCOV_OPTS --output-directory ./usage --rc memory_percentage --rc percent=5 baseline_orig.info --ignore usage $IGNORE +# ignore version error which might happen if timestamp is included +echo genhtml $DIFFCOV_OPTS --output-directory ./usage --rc memory_percentage --rc -memory_percentage=50 baseline_orig.info --ignore usage,version +$COVER $GENHTML_TOOL $DIFFCOV_OPTS --output-directory ./usage --rc memory_percentage --rc percent=5 baseline_orig.info --ignore usage,version $IGNORE if [ 0 != $? ] ; then echo "ERROR: didn't ignore errors" status=1 @@ -1609,8 +1610,8 @@ if [ 0 != $? ] ; then fi # skip both errors - but check total message count -echo genhtml $DIFFCOV_OPTS --output-directory ./expect_err --rc memory_percentage --rc -memory_percentage=50 baseline_orig.info --ignore usage --expect usage:1 -$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 +echo genhtml $DIFFCOV_OPTS --output-directory ./expect_err --rc memory_percentage --rc -memory_percentage=50 baseline_orig.info --ignore usage,version --expect usage:1 +$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 if [ 0 == ${PIPESTATUS[0]} ] ; then echo "ERROR: didn't catch expect count error" status=1 @@ -1621,8 +1622,8 @@ fi grep -E "ERROR:.*count.*'usage' constraint .+ is not true" expect_err.log # now skip the count message too -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 -$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 +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 +$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 if [ 0 != ${PIPESTATUS[0]} ] ; then echo "ERROR: didn't skip expect count error" status=1