mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2025-09-10 07:59:52 +02:00
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,"
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
# ===================================================
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user