still run tests on exported sources if QGIS_TEST_ACCEPT_GITSTATUS_CHECK_FAILURE is set even if git is present

This commit is contained in:
Juergen E. Fischer 2023-01-31 09:48:25 +01:00
parent 00037bda49
commit b4b91a75fd

View File

@ -7,7 +7,13 @@ command -v git > /dev/null || {
exit 2 # considered a "skip"
}
git -C ${srcdir} status -uno > .gitstatus-full || exit 1
if test "${QGIS_TEST_ACCEPT_GITSTATUS_CHECK_FAILURE}" = "1"; then
exit=2
else
exit=1
fi
git -C ${srcdir} status -uno > .gitstatus-full || exit $exit
if test "$1" = "log"; then
grep 'modified: ' .gitstatus-full | sort -u > .gitstatus
@ -18,10 +24,7 @@ elif test "$1" = "check"; then
else
echo "Source files (printed above) were modified. Diff follows:"
git -C ${srcdir} diff
if test "${QGIS_TEST_ACCEPT_GITSTATUS_CHECK_FAILURE}" = "1"; then
exit 2 # considered a "skip" by CMake
fi
exit 1
exit $exit
fi
else
echo "Usage: $0 [log|check]" >&2