summaryrefslogtreecommitdiff
path: root/tests/ln
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/ln
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/ln')
-rwxr-xr-xtests/ln/backup-18
-rwxr-xr-xtests/ln/hard-backup8
-rwxr-xr-xtests/ln/hard-to-sym8
-rwxr-xr-xtests/ln/misc8
-rwxr-xr-xtests/ln/slash-decorated-nonexistent-dest8
-rwxr-xr-xtests/ln/target-18
6 files changed, 12 insertions, 36 deletions
diff --git a/tests/ln/backup-1 b/tests/ln/backup-1
index 83d7e629b..f07ba9493 100755
--- a/tests/ln/backup-1
+++ b/tests/ln/backup-1
@@ -19,12 +19,8 @@
# Based on a problem report from Jamie Lokier.
-if test "$VERBOSE" = yes; then
- set -x
- ln --version
-fi
-
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+test "$VERBOSE" = yes && ln --version
touch a b || framework_failure
diff --git a/tests/ln/hard-backup b/tests/ln/hard-backup
index 6dfce5163..3b3f6ec71 100755
--- a/tests/ln/hard-backup
+++ b/tests/ln/hard-backup
@@ -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
- ln --version
-fi
-
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+test "$VERBOSE" = yes && ln --version
touch f || framework_failure
diff --git a/tests/ln/hard-to-sym b/tests/ln/hard-to-sym
index ac74bb97d..a78b738ad 100755
--- a/tests/ln/hard-to-sym
+++ b/tests/ln/hard-to-sym
@@ -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
- ln --version
-fi
-
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+test "$VERBOSE" = yes && ln --version
# ===================================================
diff --git a/tests/ln/misc b/tests/ln/misc
index 362bf354c..de03890f4 100755
--- a/tests/ln/misc
+++ b/tests/ln/misc
@@ -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
- ln --version
-fi
-
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+test "$VERBOSE" = yes && ln --version
t=tln-symlink
d=tln-subdir
diff --git a/tests/ln/slash-decorated-nonexistent-dest b/tests/ln/slash-decorated-nonexistent-dest
index f7d51e8bb..1020da270 100755
--- a/tests/ln/slash-decorated-nonexistent-dest
+++ b/tests/ln/slash-decorated-nonexistent-dest
@@ -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
- ln --version
-fi
-
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+test "$VERBOSE" = yes && ln --version
touch f || framework_failure
diff --git a/tests/ln/target-1 b/tests/ln/target-1
index 3865e2cde..1f1ebc2d5 100755
--- a/tests/ln/target-1
+++ b/tests/ln/target-1
@@ -21,12 +21,8 @@
# ln: `d/.': cannot overwrite directory
# Based on a test case from Dmitry V. Levin.
-if test "$VERBOSE" = yes; then
- set -x
- ln --version
-fi
-
-. $srcdir/test-lib.sh
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+test "$VERBOSE" = yes && ln --version
mkdir d || framework_failure
ln -s --target-dir=d ../f || fail=1