summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/check.mk1
-rwxr-xr-xtests/misc/help-version15
2 files changed, 15 insertions, 1 deletions
diff --git a/tests/check.mk b/tests/check.mk
index d3b08e095..df0c92467 100644
--- a/tests/check.mk
+++ b/tests/check.mk
@@ -69,6 +69,7 @@ TESTS_ENVIRONMENT = \
fi; \
}; \
export \
+ VERSION='$(VERSION)' \
LOCALE_FR='$(LOCALE_FR)' \
LOCALE_FR_UTF8='$(LOCALE_FR_UTF8)' \
abs_top_builddir='$(abs_top_builddir)' \
diff --git a/tests/misc/help-version b/tests/misc/help-version
index 976d18a31..ea16516c9 100755
--- a/tests/misc/help-version
+++ b/tests/misc/help-version
@@ -58,7 +58,20 @@ expected_failure_status_egrep=2
expected_failure_status_fgrep=2
test "$built_programs" \
- || { echo "$this_test: no programs built!?!" 1>&2; Exit 1; }
+ || fail_ "built_programs not specified!?!"
+
+test "$VERSION" \
+ || fail_ "set envvar VERSION; it is required for a PATH sanity-check"
+
+# Extract version from --version output of the first program
+for i in $built_programs; do
+ v=$(env $i --version | sed -n '1s/.* //p;q')
+ break
+done
+
+# Ensure that it matches $VERSION.
+test "x$v" = "x$VERSION" \
+ || fail_ "--version-\$VERSION mismatch"
for lang in C fr da; do
for i in $built_programs; do