From b69049da7b0083b84c51cf8d2c9f1ee11403672f Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Tue, 9 Oct 2007 17:12:45 +0200 Subject: [PATCH] Move the help-version test into misc/. * tests/help-version: Move to... * tests/misc/help-version: ...here. Source test-lib.sh, as usual. Use $abs_top_builddir, rather than ".." and "../..". --- ChangeLog | 6 ++++++ tests/Makefile.am | 1 - tests/misc/Makefile.am | 1 + tests/{ => misc}/help-version | 23 +++++++++++------------ 4 files changed, 18 insertions(+), 13 deletions(-) rename tests/{ => misc}/help-version (90%) diff --git a/ChangeLog b/ChangeLog index bb5ece9864..6b6d3f02db 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2007-10-09 Jim Meyering + Move the help-version test into misc/. + * tests/help-version: Move to... + * tests/misc/help-version: ...here. + Source test-lib.sh, as usual. + Use $abs_top_builddir, rather than ".." and "../..". + Make the runcon-no-reorder test slightly more general. * tests/misc/runcon-no-reorder: Don't hard-code "unconstrained_t". Use slightly more general "runcon $(id -Z)". diff --git a/tests/Makefile.am b/tests/Makefile.am index 25b77fce02..fa2ff29be1 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -7,7 +7,6 @@ ASSORT = LC_ALL=C sort built_programs = (cd ../src && MAKEFLAGS= $(MAKE) -s built_programs.list) -TESTS = help-version TESTS_ENVIRONMENT = \ built_programs="`$(built_programs)`" \ PACKAGE_BUGREPORT=$(PACKAGE_BUGREPORT) \ diff --git a/tests/misc/Makefile.am b/tests/misc/Makefile.am index 04f1315fee..7f5de44678 100644 --- a/tests/misc/Makefile.am +++ b/tests/misc/Makefile.am @@ -74,6 +74,7 @@ TESTS = \ groups-version \ head-c \ head-pos \ + help-version \ md5sum \ md5sum-newline \ mknod \ diff --git a/tests/help-version b/tests/misc/help-version similarity index 90% rename from tests/help-version rename to tests/misc/help-version index 00b879c216..d2eb04db55 100755 --- a/tests/help-version +++ b/tests/misc/help-version @@ -25,7 +25,8 @@ test "$VERBOSE" = yes && set -x test "x$SHELL" = x && SHELL=/bin/sh export SHELL -. $srcdir/envvar-check +. $srcdir/../envvar-check +. $srcdir/../test-lib.sh expected_failure_status_nohup=127 expected_failure_status_printenv=2 @@ -74,8 +75,10 @@ for lang in C fr da; do # false fails even when invoked with --help or --version. if test $i = false; then - env LC_MESSAGES=$lang ../src/$i --help >/dev/null && fail=1 - env LC_MESSAGES=$lang ../src/$i --version >/dev/null && fail=1 + env LC_MESSAGES=$lang $abs_top_builddir/src/$i --help \ + >/dev/null && fail=1 + env LC_MESSAGES=$lang $abs_top_builddir/src/$i --version \ + >/dev/null && fail=1 continue fi @@ -83,8 +86,8 @@ for lang in C fr da; do test $i = install && i=ginstall # Make sure they exit successfully, under normal conditions. - ../src/$i --help > h-$i || fail=1 - ../src/$i --version >/dev/null || fail=1 + $abs_top_builddir/src/$i --help > h-$i || fail=1 + $abs_top_builddir/src/$i --version >/dev/null || fail=1 # Make sure they mention the bug-reporting address in --help output. grep "$PACKAGE_BUGREPORT" h-$i > /dev/null || fail=1 @@ -92,8 +95,8 @@ for lang in C fr da; do # Make sure they fail upon `disk full' error. if test -w /dev/full && test -c /dev/full; then - ../src/$i --help >/dev/full 2>/dev/null && fail=1 - ../src/$i --version >/dev/full 2>/dev/null && fail=1 + $abs_top_builddir/src/$i --help >/dev/full 2>/dev/null && fail=1 + $abs_top_builddir/src/$i --version >/dev/full 2>/dev/null && fail=1 status=$? test $i = [ && prog=lbracket || prog=$i eval "expected=\$expected_failure_status_$prog" @@ -205,7 +208,7 @@ for i in $built_programs; do # echo ================== $i test $i = [ && prog=lbracket || prog=$i eval "args=\$${prog}_args" - if ../../src/$i $args < $tmp_in > $tmp_out; then + if $abs_top_builddir/src/$i $args < $tmp_in > $tmp_out; then : # ok else echo FAIL: $i @@ -214,8 +217,4 @@ for i in $built_programs; do rm -rf $tmp_in $tmp_in2 $tmp_out $tmp_dir done -# FIXME: trap -cd .. -rm -rf $tmp - exit $fail -- 2.47.2