Convert tests/install/, too.
authorJim Meyering <jim@meyering.net>
Sat, 8 Sep 2007 07:22:49 +0000 (09:22 +0200)
committerJim Meyering <jim@meyering.net>
Sat, 15 Sep 2007 06:40:38 +0000 (08:40 +0200)
tests/install/Makefile.am
tests/install/basic-1
tests/install/create-leading
tests/install/d-slashdot
tests/install/trap

index 5544d7d..c97252d 100644 (file)
@@ -5,3 +5,5 @@ TESTS_ENVIRONMENT = \
   EXEEXT='$(EXEEXT)' \
   CU_TEST_NAME=`basename $(abs_srcdir)`,$$tst \
   PATH="$(VG_PATH_PREFIX)`pwd`/../../src$(PATH_SEPARATOR)$$PATH"
+
+include $(top_srcdir)/tests/check.mk
index f413567..89d14d2 100755 (executable)
@@ -21,37 +21,16 @@ if test "$VERBOSE" = yes; then
   ginstall --version
 fi
 
-# Make sure we get English translations.
-LANGUAGE=C
-export LANGUAGE
-LC_ALL=C
-export LC_ALL
-LANG=C
-export LANG
-
-. $srcdir/../envvar-check
 PRIV_CHECK_ARG=require-non-root . $srcdir/../priv-check
+. $srcdir/../lang-default
+. $srcdir/../test-lib.sh
 
 dir=dir
 file=file
 
-pwd=`pwd`
-t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
-trap 'status=$?; cd "$pwd" && chmod -R u+rwx $t0 && rm -rf $t0 && exit $status' 0
-trap '(exit $?); exit $?' 1 2 13 15
-
-framework_failure=0
-mkdir -p $tmp || framework_failure=1
-cd $tmp || framework_failure=1
-
-rm -rf $dir $file || framework_failure=1
-mkdir -p $dir || framework_failure=1
-echo foo > $file || framework_failure=1
-
-if test $framework_failure = 1; then
-  echo 'failure in testing framework'
-  exit 1
-fi
+rm -rf $dir $file || framework_failure
+mkdir -p $dir || framework_failure
+echo foo > $file || framework_failure
 
 fail=0
 ginstall $file $dir || fail=1
@@ -64,7 +43,7 @@ test -f $dir/$file || fail=1
 dd=dd$EXEEXT
 dd2=dd2$EXEEXT
 
-just_built_dd=$pwd/../../src/$dd
+just_built_dd=$abs_top_builddir/src/$dd
 
 test -r "$just_built_dd" || \
   {
@@ -109,11 +88,11 @@ test -d newdir2 || fail=1
 test -d newdir3 || fail=1
 
 # This fails because mkdir-p.c's make_dir_parents fails to return to its
-# initial working directory ($abs) after creating the first argument, and
+# initial working directory ($iwd) after creating the first argument, and
 # hence cannot do anything meaningful with the following relative-named dirs.
-abs=$pwd/$tmp
+iwd=`pwd`
 mkdir sub || fail=1
-(cd sub && chmod 0 . && ginstall -d "$abs/xx/yy" rel/sub1 rel/sub2 2> /dev/null) && fail=1
+(cd sub && chmod 0 . && ginstall -d "$iwd/xx/yy" rel/sub1 rel/sub2 2> /dev/null) && fail=1
 chmod 755 sub
 
 # Ensure that the first argument-dir has been created.
@@ -131,7 +110,7 @@ test -d xx/rel && fail=1
 if df --local . >/dev/null 2>&1; then
   mkdir -p sub1/d || fail=1
   (cd sub1/d && chmod a-r . && chmod a-rx .. &&
-   ginstall -d "$abs/xx/zz" rel/a rel/b) || fail=1
+   ginstall -d "$iwd/xx/zz" rel/a rel/b) || fail=1
   chmod 755 sub1 sub1/d || fail=1
   test -d xx/zz || fail=1
   test -d sub1/d/rel/a || fail=1
index e444168..c639dc5 100755 (executable)
@@ -1,7 +1,7 @@
 #! /bin/sh
 # Test -D option.
 
-# Copyright (C) 2000, 2001, 2006 Free Software Foundation, Inc.
+# Copyright (C) 2000, 2001, 2006, 2007 Free Software Foundation, Inc.
 
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -24,17 +24,10 @@ if test "$VERBOSE" = yes; then
   ginstall --version
 fi
 
-. $srcdir/../envvar-check
-
-pwd=`pwd`
-dir=install-D$$
-
-trap 'cd "$pwd" && rm -rf $dir' 0 1 2 3 15
-
-mkdir $dir
+. $srcdir/../test-lib.sh
 
 fail=0
-cd $dir
+
 file=file
 echo foo > $file
 
index 1e3ef24..eb2a914 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 # Ensure that ginstall -d works with arguments specified with a trailing "/.".
 
-# Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+# Copyright (C) 2005-2007 Free Software Foundation, Inc.
 
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -21,19 +21,7 @@ if test "$VERBOSE" = yes; then
   install --version
 fi
 
-pwd=`pwd`
-tmp=`echo "$0"|sed 's,.*/,,'`.tmp
-trap 'status=$?; cd "$pwd" && rm -rf $tmp && exit $status' 0
-trap '(exit $?); exit' 1 2 13 15
-
-framework_failure=0
-mkdir $tmp || framework_failure=1
-cd $tmp || framework_failure=1
-
-if test $framework_failure = 1; then
-  echo 'failure in testing framework'
-  (exit 1); exit 1
-fi
+. $srcdir/../test-lib.sh
 
 fail=0
 
index 12e3b5f..a4f9fa8 100755 (executable)
@@ -2,7 +2,7 @@
 # Ensure that `install -s' doesn't infloop when its parent
 # process traps CHLD signal.
 
-# Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
+# Copyright (C) 2004-2007 Free Software Foundation, Inc.
 
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -22,29 +22,17 @@ if test "$VERBOSE" = yes; then
   ginstall --version
 fi
 
-pwd=`pwd`
-t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
-trap 'status=$?; cd "$pwd" && chmod -R u+rwx $t0 && rm -rf $t0 && exit $status' 0
-trap '(exit $?); exit $?' 1 2 13 15
-
-framework_failure=0
-mkdir -p $tmp || framework_failure=1
-cd $tmp || framework_failure=1
-
-if test $framework_failure = 1; then
-  echo "$0: failure in testing framework" 1>&2
-  (exit 1); exit 1
-fi
+. $srcdir/../test-lib.sh
 
 fail=0
 
 # Use a subshell and an exec to work around a bug in FreeBSD 5.0 /bin/sh.
 (
   # ash doesn't support "trap '' CHLD"; it knows only signal numbers.
-  sig=`"$pwd/../../src/kill" -l CHLD 2>/dev/null` && trap '' $sig
+  sig=`"$abs_top_builddir/src/kill" -l CHLD 2>/dev/null` && trap '' $sig
 
   # Before 2004-04-21, install would infloop, in the `while (wait...' loop:
-  exec ginstall -s "$pwd/../../src/ginstall$EXEEXT" .
+  exec ginstall -s "$abs_top_builddir/src/ginstall$EXEEXT" .
 )
 
 (exit $fail); exit $fail