summaryrefslogtreecommitdiff
path: root/tests/mkdir
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2010-11-14 11:05:05 +0100
committerJim Meyering <meyering@redhat.com>2010-11-17 20:48:57 +0100
commitf38becab02472e6872048a1951b249b2a3c054df (patch)
treee5b531384b55abae8b1829ada892891bfee58fe3 /tests/mkdir
parent30b74dfff16240ea0e4a4c5b705f1e9631e5d0a7 (diff)
downloadcoreutils-f38becab02472e6872048a1951b249b2a3c054df.tar.xz
tests: convert first batch of tests from test-lib.sh to init.sh
Initially, I did this, git grep -l srcdir/test-lib.sh|xargs perl -p0i -e '~180-byte script' but that line would have been much longer than the maximum permitted by coreutils' commit hook, and wasn't readable besides, so here's a more readable version: lhs=$(printf '%s\\n' \ 'if test "$VERBOSE" = yes; then' \ ' set -x' \ ' touch --version' \ 'fi' \ '' \ '. $srcdir/test-lib.sh' \ | sed 's/\$/\\\$/g;s/touch/(\\w+)/') rhs=$(printf '%s\\n' \ '. "${srcdir=.}/init.sh"; path_prepend_ ../src' \ 'test "$VERBOSE" = yes && FIXME --version' \ | sed 's/\$/\\\$/g;s/FIXME/\$1/') git grep -l srcdir/test-lib.sh|xargs perl -p0i -e "s,$lhs,$rhs,"
Diffstat (limited to 'tests/mkdir')
-rwxr-xr-xtests/mkdir/p-18
-rwxr-xr-xtests/mkdir/p-28
-rwxr-xr-xtests/mkdir/p-38
-rwxr-xr-xtests/mkdir/p-slashdot8
-rwxr-xr-xtests/mkdir/p-thru-slink8
-rwxr-xr-xtests/mkdir/p-v8
-rwxr-xr-xtests/mkdir/parents8
-rwxr-xr-xtests/mkdir/perm8
-rwxr-xr-xtests/mkdir/special-18
-rwxr-xr-xtests/mkdir/t-slash8
-rwxr-xr-xtests/mkdir/writable-under-readonly8
11 files changed, 22 insertions, 66 deletions
diff --git a/tests/mkdir/p-1 b/tests/mkdir/p-1
index cd60d9f36..9c8e8a5d8 100755
--- a/tests/mkdir/p-1
+++ b/tests/mkdir/p-1
@@ -16,12 +16,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-if test "$VERBOSE" = yes; then
- set -x
- mkdir --version
-fi
-
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+test "$VERBOSE" = yes && mkdir --version
mkdir --parents "`pwd`/t" || fail=1
test -d t || fail=1
diff --git a/tests/mkdir/p-2 b/tests/mkdir/p-2
index 863f188dc..735d7ad08 100755
--- a/tests/mkdir/p-2
+++ b/tests/mkdir/p-2
@@ -16,12 +16,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-if test "$VERBOSE" = yes; then
- set -x
- mkdir --version
-fi
-
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+test "$VERBOSE" = yes && mkdir --version
mkdir --parents "`pwd`/t/u" || fail=1
test -d t/u || fail=1
diff --git a/tests/mkdir/p-3 b/tests/mkdir/p-3
index 116c794be..ddc812e0e 100755
--- a/tests/mkdir/p-3
+++ b/tests/mkdir/p-3
@@ -18,12 +18,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-if test "$VERBOSE" = yes; then
- set -x
- mkdir --version
-fi
-
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+test "$VERBOSE" = yes && mkdir --version
skip_if_root_
mkdir no-access || framework_failure
diff --git a/tests/mkdir/p-slashdot b/tests/mkdir/p-slashdot
index 49843f1c0..fba112df2 100755
--- a/tests/mkdir/p-slashdot
+++ b/tests/mkdir/p-slashdot
@@ -16,12 +16,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-if test "$VERBOSE" = yes; then
- set -x
- mkdir --version
-fi
-
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+test "$VERBOSE" = yes && mkdir --version
mkdir -p d1/. || fail=1
diff --git a/tests/mkdir/p-thru-slink b/tests/mkdir/p-thru-slink
index 687c0ffed..e2cc9c93f 100755
--- a/tests/mkdir/p-thru-slink
+++ b/tests/mkdir/p-thru-slink
@@ -16,12 +16,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-if test "$VERBOSE" = yes; then
- set -x
- mkdir --version
-fi
-
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+test "$VERBOSE" = yes && mkdir --version
ln -s . slink || framework_failure
diff --git a/tests/mkdir/p-v b/tests/mkdir/p-v
index 6118b492a..aeae33da9 100755
--- a/tests/mkdir/p-v
+++ b/tests/mkdir/p-v
@@ -16,12 +16,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-if test "$VERBOSE" = yes; then
- set -x
- mkdir --version
-fi
-
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+test "$VERBOSE" = yes && mkdir --version
mkdir -pv foo/a/b/c/d >out || fail=1
diff --git a/tests/mkdir/parents b/tests/mkdir/parents
index 405cc1942..951b6f9e0 100755
--- a/tests/mkdir/parents
+++ b/tests/mkdir/parents
@@ -16,12 +16,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-if test "$VERBOSE" = yes; then
- set -x
- mkdir --version
-fi
-
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+test "$VERBOSE" = yes && mkdir --version
skip_if_setgid_
mkdir -m 700 e-dir || framework_failure
diff --git a/tests/mkdir/perm b/tests/mkdir/perm
index 7707e4f8d..0cd0a5581 100755
--- a/tests/mkdir/perm
+++ b/tests/mkdir/perm
@@ -17,12 +17,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-if test "$VERBOSE" = yes; then
- set -x
- mkdir --version
-fi
-
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+test "$VERBOSE" = yes && mkdir --version
skip_if_setgid_
working_umask_or_skip_
diff --git a/tests/mkdir/special-1 b/tests/mkdir/special-1
index 93d203e77..7ed437021 100755
--- a/tests/mkdir/special-1
+++ b/tests/mkdir/special-1
@@ -16,12 +16,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-if test "$VERBOSE" = yes; then
- set -x
- mkdir --version
-fi
-
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+test "$VERBOSE" = yes && mkdir --version
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 053f98df3..ed72880c7 100755
--- a/tests/mkdir/t-slash
+++ b/tests/mkdir/t-slash
@@ -17,12 +17,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-if test "$VERBOSE" = yes; then
- set -x
- mkdir --version
-fi
-
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+test "$VERBOSE" = yes && mkdir --version
mkdir -p dir/ || fail=1
diff --git a/tests/mkdir/writable-under-readonly b/tests/mkdir/writable-under-readonly
index 18a44ae9a..2c8ac52f4 100755
--- a/tests/mkdir/writable-under-readonly
+++ b/tests/mkdir/writable-under-readonly
@@ -24,12 +24,8 @@
#
# Demonstrate the problem, as root:
-if test "$VERBOSE" = yes; then
- set -x
- mkdir --version
-fi
-
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+test "$VERBOSE" = yes && mkdir --version
require_root_
# FIXME: for now, skip it unconditionally