* tests/misc/help-version: Sync from gzip's version.
* tests/check.mk (TESTS_ENVIRONMENT): Export VERSION, as required
for new help-version test.
fi; \
}; \
export \
+ VERSION='$(VERSION)' \
LOCALE_FR='$(LOCALE_FR)' \
LOCALE_FR_UTF8='$(LOCALE_FR_UTF8)' \
abs_top_builddir='$(abs_top_builddir)' \
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