copy-file: Try unit tests on more file systems.
authorBruno Haible <bruno@clisp.org>
Mon, 5 Sep 2011 09:25:09 +0000 (11:25 +0200)
committerBruno Haible <bruno@clisp.org>
Mon, 5 Sep 2011 09:25:09 +0000 (11:25 +0200)
* tests/test-copy-file-1.sh: New file.
* tests/test-copy-file-2.sh: New file.
* modules/copy-file-tests (Files): Add them.
(Makefile.am): Add them to TESTS.

ChangeLog
modules/copy-file-tests
tests/test-copy-file-1.sh [new file with mode: 0755]
tests/test-copy-file-2.sh [new file with mode: 0755]

index fcc419d..1a14152 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2011-09-05  Bruno Haible  <bruno@clisp.org>
 
+       copy-file: Try unit tests on more file systems.
+       * tests/test-copy-file-1.sh: New file.
+       * tests/test-copy-file-2.sh: New file.
+       * modules/copy-file-tests (Files): Add them.
+       (Makefile.am): Add them to TESTS.
+
        acl: Try unit tests on more file systems.
        * tests/test-file-has-acl-1.sh: New file.
        * tests/test-file-has-acl-2.sh: New file.
index ab7f632..cc06a0b 100644 (file)
@@ -1,5 +1,7 @@
 Files:
 tests/test-copy-file.sh
+tests/test-copy-file-1.sh
+tests/test-copy-file-2.sh
 tests/test-copy-file.c
 tests/macros.h
 
@@ -13,7 +15,7 @@ xalloc
 configure.ac:
 
 Makefile.am:
-TESTS += test-copy-file.sh
+TESTS += test-copy-file.sh test-copy-file-1.sh test-copy-file-2.sh
 TESTS_ENVIRONMENT += USE_ACL=$(USE_ACL)
 check_PROGRAMS += test-copy-file
 test_copy_file_LDADD = $(LDADD) $(LIB_ACL) @LIBINTL@
diff --git a/tests/test-copy-file-1.sh b/tests/test-copy-file-1.sh
new file mode 100755 (executable)
index 0000000..b38c821
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+# Test copy-file on the file system of /var/tmp, which usually is a local
+# file system.
+
+if test -d /var/tmp; then
+  TMPDIR=/var/tmp
+else
+  TMPDIR=/tmp
+fi
+export TMPDIR
+
+exec "${srcdir}/test-copy-file.sh"
diff --git a/tests/test-copy-file-2.sh b/tests/test-copy-file-2.sh
new file mode 100755 (executable)
index 0000000..d4d959f
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+# Test copy-file on the file system of the build directory, which may be
+# a local file system or NFS mounted.
+
+TMPDIR=`pwd`
+export TMPDIR
+
+exec "${srcdir}/test-copy-file.sh"