[Fakeroot-commits] [SCM] fakeroot branch, master, updated. debian/1.11.3

Clint Adams schizo at debian.org
Sat Dec 13 00:07:50 UTC 2008


The following commit has been merged in the master branch:
commit e6e321eb2aa82a608d1c99f604f6cfb815cb4700
Author: Akim Demaille <demaille at gostai.com>
Date:   Thu Dec 11 16:52:39 2008 +0100

    Improve test suite.
    
    Use test/defs to factor the code, in particular to factor the creation of
    the tmp dir.  Do not use a constant file name so that make check -j does
    not fail because of collisions.
    
    Also, beware that LD_PRELOAD is not universal.

diff --git a/.gitignore b/.gitignore
index fc7e03b..826bbb8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,6 +2,7 @@ Makefile.in
 acinclude.m4
 aclocal.m4
 autom4te.cache/
+build-aux/
 config.guess
 config.h.in
 config.h.in~
diff --git a/configure.ac b/configure.ac
index 38f54ed..4be182e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -507,7 +507,11 @@ CPPFLAGS="$CPPFLAGS -I\$(srcdir)/statconv/glibc/linux/alpha"
         ;;
 esac
 
-AC_CONFIG_FILES([Makefile scripts/Makefile doc/Makefile doc/es/Makefile doc/fr/Makefile doc/nl/Makefile doc/sv/Makefile test/Makefile])
+AC_CONFIG_FILES([
+   Makefile
+   scripts/Makefile
+   doc/Makefile doc/es/Makefile doc/fr/Makefile doc/nl/Makefile doc/sv/Makefile
+   test/Makefile test/defs])
 AC_OUTPUT
 
 dnl Local variables:
diff --git a/test/Makefile.am b/test/Makefile.am
index ac9c01e..bf2490f 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -6,6 +6,7 @@ TESTS = t.echoarg t.mknod t.tar t.truereturn t.falsereturn t.option \
 suffix =
 TESTS_ENVIRONMENT =							\
   libfakeroot=libfakeroot-0.so						\
+  srcdir=$(srcdir)							\
   suffix=$(suffix)							\
   posixshell=$(SHELL)
 
diff --git a/test/defs.in b/test/defs.in
new file mode 100644
index 0000000..0b4b42b
--- /dev/null
+++ b/test/defs.in
@@ -0,0 +1,12 @@
+me=`basename $0`
+tmp=$me.dir
+rm -rf $tmp
+trap 'rm -rf $tmp' EXIT
+
+# The name of LD_PRELOAD on this platform.
+LDPRELOADVAR=@LDPRELOADVAR@
+
+run_fakeroot ()
+{
+  ../scripts/fakeroot${tcp} -f ../faked${tcp} -l ../.libs/${libfakeroot} "$@"
+}
diff --git a/test/t.chmod_dev b/test/t.chmod_dev
index 405e983..bd4f9e0 100755
--- a/test/t.chmod_dev
+++ b/test/t.chmod_dev
@@ -1,8 +1,8 @@
 #!/bin/sh
+. defs || exit 1
 
-trap 'rm -rf tmp' EXIT
-mkdir tmp
-../scripts/fakeroot${tcp} -f ../faked${tcp} -l ../.libs/${libfakeroot} -- \
- ${posixshell} -c 'mknod tmp/hda3 b 3 0 && chmod 644 tmp/hda3 && ls -ld tmp/hda3' | grep "^b"
+mkdir $tmp
+run_fakeroot -- \
+    ${posixshell} -c 'mknod $tmp/hda3 b 3 0 && chmod 644 $tmp/hda3 && ls -ld $tmp/hda3' | grep "^b"
 TEMP=$?
 exit $TEMP
diff --git a/test/t.echoarg b/test/t.echoarg
index bcceb5e..fe6fc91 100755
--- a/test/t.echoarg
+++ b/test/t.echoarg
@@ -1,4 +1,5 @@
 #!/bin/sh
+. defs || exit 1
 
-../scripts/fakeroot${tcp} -f ../faked${tcp} -l ../.libs/${libfakeroot} -- \
+run_fakeroot -- \
  ${posixshell} -c 'RET="$('"${srcdir}"'/echo_arg 3 a b c d e)"; echo RET=$RET; test "$RET" = "b"'
diff --git a/test/t.falsereturn b/test/t.falsereturn
index 0400b46..a76e5de 100755
--- a/test/t.falsereturn
+++ b/test/t.falsereturn
@@ -1,7 +1,7 @@
 #!/bin/sh
+. defs || exit 1
 
-if ../scripts/fakeroot${tcp} -f ../faked${tcp} -l ../.libs/${libfakeroot} -- \
- false
+if run_fakeroot -- false
 then
  false
 else
diff --git a/test/t.mknod b/test/t.mknod
index 749e1f8..6ce889c 100755
--- a/test/t.mknod
+++ b/test/t.mknod
@@ -1,4 +1,5 @@
 #!/bin/sh
+. defs || exit 1
 
-../scripts/fakeroot${tcp} -f ../faked${tcp} -l ../.libs/${libfakeroot} -- \
- ${posixshell} -c 'mknod hda3 b 3 1; ls -l hda3' | grep "^b"
+run_fakeroot -- \
+  ${posixshell} -c 'mknod hda3 b 3 1; ls -l hda3' | grep "^b"
diff --git a/test/t.no_ld_preload b/test/t.no_ld_preload
index 1b19e01..5e1c589 100755
--- a/test/t.no_ld_preload
+++ b/test/t.no_ld_preload
@@ -1,8 +1,11 @@
 #!/bin/sh
+. defs || exit 1
 
-trap 'rm -rf tmp' EXIT
-mkdir tmp
-../scripts/fakeroot${tcp} -f ../faked${tcp} -l ../.libs/${libfakeroot} -- \
- ${posixshell} -c 'touch tmp/justafile && LD_PRELOAD= rm tmp/justafile && mkdir tmp/justafile && ls -ld tmp/justafile' | grep "^d"
+mkdir $tmp
+run_fakeroot -- \
+ ${posixshell} -c "touch $tmp/justafile &&
+                   $LDPRELOADVAR= rm $tmp/justafile &&
+                   mkdir $tmp/justafile &&
+                   ls -ld $tmp/justafile" | grep "^d"
 TEMP=$?
 exit $TEMP
diff --git a/test/t.no_ld_preload_link b/test/t.no_ld_preload_link
index 0b29460..a489a40 100755
--- a/test/t.no_ld_preload_link
+++ b/test/t.no_ld_preload_link
@@ -1,8 +1,11 @@
 #!/bin/sh
-
-trap 'rm -rf tmp' EXIT
-mkdir tmp
-../scripts/fakeroot${tcp} -f ../faked${tcp} -l ../.libs/${libfakeroot} -- \
- ${posixshell} -c 'touch tmp/justafile && ln -s justafile tmp/alink && LD_PRELOAD= rm tmp/alink && touch tmp/alink && ls -ld tmp/alink' | grep "^-"
+. defs || exit 1
+mkdir $tmp
+run_fakeroot -- \
+ ${posixshell} -c "touch $tmp/justafile &&
+                   ln -s justafile $tmp/alink &&
+                   $LDPRELOADVAR= rm $tmp/alink &&
+                   touch $tmp/alink &&
+                   ls -ld $tmp/alink" | grep "^-"
 TEMP=$?
 exit $TEMP
diff --git a/test/t.option b/test/t.option
index f2b5c39..b150116 100755
--- a/test/t.option
+++ b/test/t.option
@@ -1,4 +1,4 @@
 #!/bin/sh
+. defs || exit 1
 
-../scripts/fakeroot${tcp} -f ../faked${tcp} -l ../.libs/${libfakeroot} -- \
- echo -1 -2 | grep -- -1
+run_fakeroot -- echo -1 -2 | grep -- -1
diff --git a/test/t.tar b/test/t.tar
index 62c05eb..5d92c75 100755
--- a/test/t.tar
+++ b/test/t.tar
@@ -1,6 +1,4 @@
 #!/bin/sh
+. defs || exit 1
 
-tdir=`cd ..; pwd -P`
-
-../scripts/fakeroot${tcp} -f ${tdir}/faked${tcp} -l ${tdir}/.libs/${libfakeroot} -- \
- ${srcdir}/tartest
+run_fakeroot -- ${srcdir}/tartest
diff --git a/test/t.touchinstall b/test/t.touchinstall
index c66eb32..ed72c09 100755
--- a/test/t.touchinstall
+++ b/test/t.touchinstall
@@ -1,8 +1,7 @@
 #!/bin/sh
+. defs || exit 1
 
-trap 'rm -rf tmp' EXIT
-mkdir tmp
-../scripts/fakeroot${tcp} -f ../faked${tcp} -l ../.libs/${libfakeroot} -- \
+run_fakeroot -- \
  ${posixshell} -c "touch tmp/iamnotuser; ls -al tmp/iamnotuser" | grep root
 TEMP=$?
 exit $TEMP
diff --git a/test/t.truereturn b/test/t.truereturn
index ebf0012..aa1ea9f 100755
--- a/test/t.truereturn
+++ b/test/t.truereturn
@@ -1,7 +1,7 @@
 #!/bin/sh
+. defs || exit 1
 
-if ../scripts/fakeroot${tcp} -f ../faked${tcp} -l ../.libs/${libfakeroot} -- \
- true
+if run_fakeroot -- true
 then
  true
 else

-- 
fakeroot



More information about the Fakeroot-commits mailing list