summaryrefslogtreecommitdiff
path: root/tests/misc/help-version
diff options
context:
space:
mode:
Diffstat (limited to 'tests/misc/help-version')
-rwxr-xr-xtests/misc/help-version15
1 files changed, 14 insertions, 1 deletions
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