summaryrefslogtreecommitdiff
path: root/tests/mkdir
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2008-04-17 23:34:45 +0200
committerJim Meyering <meyering@redhat.com>2008-04-21 00:01:51 +0200
commit512e111a926fedbd7dc7b0875ab837dbb7d2a7a6 (patch)
treef77cdb2c6bfc71f0560cf073324365c0a3e65526 /tests/mkdir
parentd25bf9dceb90dcb91f8af57aff433273c7145ff7 (diff)
downloadcoreutils-512e111a926fedbd7dc7b0875ab837dbb7d2a7a6.tar.xz
Revamp test-related Makefiles.
One side-effect of this change is that "make check" now works even if you put "." early in your shell's search PATH (don't do that!). Remove all test-related Makefile.am files, except those generated by mk-script. Instead, tests/Makefile.am now lists not only the tests directly under tests/, but also those in tests/*/ that are not generated by mk-script, e.g., cp/abuse, cp/acl, mv/i-1, etc. A lot of these changes are like this: -. $srcdir/../lang-default +. $top_srcdir/tests/lang-default -. $srcdir/../test-lib.sh +. $top_srcdir/tests/test-lib.sh * configure.ac (AC_CONFIG_FILES): Remove corresponding Makefiles. * tests/check.mk (vc_exe_in_TESTS): Relax syntax requirements. * tests/rwx-to-mode: Remove file. Rewritten as... * tests/test-lib.sh (rwx_to_mode_): ...this new function. * tests/Makefile.am (EXTRA_DIST): Remove rwx-to-mode. (SUBDIRS): Remove each dir with a removed Makefile.am. (EXTRA_DIST): Add $(TESTS). (TESTS): Add over 300 entries.
Diffstat (limited to 'tests/mkdir')
-rw-r--r--tests/mkdir/Makefile.am18
-rwxr-xr-xtests/mkdir/p-12
-rwxr-xr-xtests/mkdir/p-22
-rwxr-xr-xtests/mkdir/p-32
-rwxr-xr-xtests/mkdir/p-slashdot4
-rwxr-xr-xtests/mkdir/p-thru-slink4
-rwxr-xr-xtests/mkdir/p-v4
-rwxr-xr-xtests/mkdir/parents8
-rwxr-xr-xtests/mkdir/perm4
-rwxr-xr-xtests/mkdir/selinux6
-rwxr-xr-xtests/mkdir/special-12
-rwxr-xr-xtests/mkdir/t-slash4
-rwxr-xr-xtests/mkdir/writable-under-readonly2
13 files changed, 22 insertions, 40 deletions
diff --git a/tests/mkdir/Makefile.am b/tests/mkdir/Makefile.am
deleted file mode 100644
index ee8bfb84f..000000000
--- a/tests/mkdir/Makefile.am
+++ /dev/null
@@ -1,18 +0,0 @@
-## Process this file with automake to produce Makefile.in -*-Makefile-*-.
-TESTS = \
- selinux \
- p-1 \
- p-2 \
- p-3 \
- p-slashdot \
- p-thru-slink \
- p-v \
- parents \
- perm \
- special-1 \
- t-slash \
- writable-under-readonly
-
-EXTRA_DIST = $(TESTS)
-
-include $(top_srcdir)/tests/check.mk
diff --git a/tests/mkdir/p-1 b/tests/mkdir/p-1
index a5672743a..95b26be8a 100755
--- a/tests/mkdir/p-1
+++ b/tests/mkdir/p-1
@@ -21,7 +21,7 @@ if test "$VERBOSE" = yes; then
mkdir --version
fi
-. $srcdir/../test-lib.sh
+. $top_srcdir/tests/test-lib.sh
fail=0
mkdir --parents "`pwd`/t" || fail=1
diff --git a/tests/mkdir/p-2 b/tests/mkdir/p-2
index 0659a8e35..bbf391304 100755
--- a/tests/mkdir/p-2
+++ b/tests/mkdir/p-2
@@ -21,7 +21,7 @@ if test "$VERBOSE" = yes; then
mkdir --version
fi
-. $srcdir/../test-lib.sh
+. $top_srcdir/tests/test-lib.sh
fail=0
mkdir --parents "`pwd`/t/u" || fail=1
diff --git a/tests/mkdir/p-3 b/tests/mkdir/p-3
index e868b520f..e05021ff2 100755
--- a/tests/mkdir/p-3
+++ b/tests/mkdir/p-3
@@ -23,7 +23,7 @@ if test "$VERBOSE" = yes; then
mkdir --version
fi
-. $srcdir/../test-lib.sh
+. $top_srcdir/tests/test-lib.sh
skip_if_root_
mkdir no-access || framework_failure
diff --git a/tests/mkdir/p-slashdot b/tests/mkdir/p-slashdot
index b35ce19cf..273b7b7e3 100755
--- a/tests/mkdir/p-slashdot
+++ b/tests/mkdir/p-slashdot
@@ -1,7 +1,7 @@
#!/bin/sh
# Ensure that mkdir -p works with arguments specified with a trailing "/.".
-# Copyright (C) 2005-2007 Free Software Foundation, Inc.
+# Copyright (C) 2005-2008 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,7 +21,7 @@ if test "$VERBOSE" = yes; then
mkdir --version
fi
-. $srcdir/../test-lib.sh
+. $top_srcdir/tests/test-lib.sh
fail=0
diff --git a/tests/mkdir/p-thru-slink b/tests/mkdir/p-thru-slink
index 8607a935e..c32619140 100755
--- a/tests/mkdir/p-thru-slink
+++ b/tests/mkdir/p-thru-slink
@@ -1,7 +1,7 @@
#!/bin/sh
# Ensure that mkdir -p foo/bar works when foo is a symbolic link to a directory
-# Copyright (C) 2005-2007 Free Software Foundation, Inc.
+# Copyright (C) 2005-2008 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,7 +21,7 @@ if test "$VERBOSE" = yes; then
mkdir --version
fi
-. $srcdir/../test-lib.sh
+. $top_srcdir/tests/test-lib.sh
ln -s . slink || framework_failure
diff --git a/tests/mkdir/p-v b/tests/mkdir/p-v
index 316c1e939..ffca679e2 100755
--- a/tests/mkdir/p-v
+++ b/tests/mkdir/p-v
@@ -21,8 +21,8 @@ if test "$VERBOSE" = yes; then
mkdir --version
fi
-. $srcdir/../lang-default
-. $srcdir/../test-lib.sh
+. $top_srcdir/tests/lang-default
+. $top_srcdir/tests/test-lib.sh
fail=0
mkdir -pv foo/a/b/c/d >out || fail=1
diff --git a/tests/mkdir/parents b/tests/mkdir/parents
index 81302745f..72fb05a4b 100755
--- a/tests/mkdir/parents
+++ b/tests/mkdir/parents
@@ -1,7 +1,7 @@
#!/bin/sh
# make sure mkdir's -p options works properly
-# Copyright (C) 2000, 2004, 2006, 2007 Free Software Foundation, Inc.
+# Copyright (C) 2000, 2004, 2006-2008 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,7 +21,7 @@ if test "$VERBOSE" = yes; then
mkdir --version
fi
-. $srcdir/../test-lib.sh
+. $top_srcdir/tests/test-lib.sh
. "$abs_top_srcdir/tests/setgid-check"
mkdir -m 700 e-dir || framework_failure
@@ -36,12 +36,12 @@ mkdir e-dir > /dev/null 2>&1 && fail=1
# Create an existing directory.
umask 077
mode_str=drwxr-x-wx
-mode_arg=`"$abs_top_srcdir/tests/rwx-to-mode" $mode_str`
+mode_arg=`rwx_to_mode_ $mode_str`
mkdir -m $mode_arg a || fail=1
# this `mkdir -p ...' shouldn't change perms of existing dir `a'.
d_mode_str=drwx-w--wx
-d_mode_arg=`"$abs_top_srcdir/tests/rwx-to-mode" $d_mode_str`
+d_mode_arg=`rwx_to_mode_ $d_mode_str`
mkdir -p -m $d_mode_arg a/b/c/d
# Make sure the permissions of `a' haven't been changed.
diff --git a/tests/mkdir/perm b/tests/mkdir/perm
index a10d5f6c1..c6c941765 100755
--- a/tests/mkdir/perm
+++ b/tests/mkdir/perm
@@ -2,7 +2,7 @@
# Verify that mkdir's `-m MODE' option works properly
# with various umask settings.
-# Copyright (C) 2000, 2002-2007 Free Software Foundation, Inc.
+# Copyright (C) 2000, 2002-2008 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,7 +22,7 @@ if test "$VERBOSE" = yes; then
mkdir --version
fi
-. $srcdir/../test-lib.sh
+. $top_srcdir/tests/test-lib.sh
. "$abs_top_srcdir/tests/setgid-check"
. "$abs_top_srcdir/tests/umask-check"
diff --git a/tests/mkdir/selinux b/tests/mkdir/selinux
index 91b23b14e..c81669d61 100755
--- a/tests/mkdir/selinux
+++ b/tests/mkdir/selinux
@@ -27,9 +27,9 @@ fi
# mcstrans-0.2.8-1.fc9, the following commands may mistakenly exit
# successfully, in spite of the invalid context string.
-. $srcdir/../envvar-check
-. $srcdir/../lang-default
-. $srcdir/../test-lib.sh
+. $top_srcdir/tests/envvar-check
+. $top_srcdir/tests/lang-default
+. $top_srcdir/tests/test-lib.sh
c=invalid-selinux-context
msg="failed to set default file creation context to \`$c':"
diff --git a/tests/mkdir/special-1 b/tests/mkdir/special-1
index 800d51065..10d5b86aa 100755
--- a/tests/mkdir/special-1
+++ b/tests/mkdir/special-1
@@ -21,7 +21,7 @@ if test "$VERBOSE" = yes; then
mkdir --version
fi
-. $srcdir/../test-lib.sh
+. $top_srcdir/tests/test-lib.sh
set_mode_string=u=rwx,g=rx,o=w,-s,+t
output_mode_string=drwxr-x-wT
diff --git a/tests/mkdir/t-slash b/tests/mkdir/t-slash
index a6fab5cc2..fdb5e8692 100755
--- a/tests/mkdir/t-slash
+++ b/tests/mkdir/t-slash
@@ -2,7 +2,7 @@
# Ensure that mkdir works with arguments specified with and without
# a trailing slash.
-# Copyright (C) 2000, 2004, 2006, 2007 Free Software Foundation, Inc.
+# Copyright (C) 2000, 2004, 2006-2008 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,7 +22,7 @@ if test "$VERBOSE" = yes; then
mkdir --version
fi
-. $srcdir/../test-lib.sh
+. $top_srcdir/tests/test-lib.sh
fail=0
diff --git a/tests/mkdir/writable-under-readonly b/tests/mkdir/writable-under-readonly
index 92d87ab5a..ebca859b8 100755
--- a/tests/mkdir/writable-under-readonly
+++ b/tests/mkdir/writable-under-readonly
@@ -29,7 +29,7 @@ if test "$VERBOSE" = yes; then
mkdir --version
fi
-. $srcdir/../test-lib.sh
+. $top_srcdir/tests/test-lib.sh
require_root_
# FIXME: for now, skip it unconditionally