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:
Jim Meyering
2010-11-14 11:05:05 +01:00
parent 30b74dfff1
commit f38becab02
323 changed files with 646 additions and 1938 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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
# ===================================================

View File

@@ -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

View File

@@ -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

View File

@@ -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