]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
Move the help-version test into misc/.
authorJim Meyering <meyering@redhat.com>
Tue, 9 Oct 2007 15:12:45 +0000 (17:12 +0200)
committerJim Meyering <meyering@redhat.com>
Tue, 9 Oct 2007 15:13:09 +0000 (17:13 +0200)
* tests/help-version: Move to...
* tests/misc/help-version: ...here.
Source test-lib.sh, as usual.
Use $abs_top_builddir, rather than ".." and "../..".

ChangeLog
tests/Makefile.am
tests/misc/Makefile.am
tests/misc/help-version [moved from tests/help-version with 90% similarity]

index bb5ece9864c6fe8adde57cd503c053aabbdcdd6b..6b6d3f02db454c4b9af749a6f56a83e66e0967b0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2007-10-09  Jim Meyering  <meyering@redhat.com>
 
+       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)".
index 25b77fce02aef10a3404d12adec585b247f84ceb..fa2ff29be1fb11d1f283fee6d57cce253f2fb10a 100644 (file)
@@ -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) \
index 04f1315feec695d3c13c034c3259fb61819b0ec7..7f5de4467846272adc33e34f242a4341effec2ab 100644 (file)
@@ -74,6 +74,7 @@ TESTS = \
   groups-version \
   head-c \
   head-pos \
+  help-version \
   md5sum \
   md5sum-newline \
   mknod \
similarity index 90%
rename from tests/help-version
rename to tests/misc/help-version
index 00b879c216e3de6d827e529f15f4f42aeb35a508..d2eb04db55cb8c9fe6b4f6e9b1f70f68a9221878 100755 (executable)
@@ -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