summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGary V. Vaughan <gary@gnu.org>2011-11-21 18:02:23 +0700
committerGary V. Vaughan <gary@gnu.org>2012-10-02 21:02:16 +0700
commitff3b32aed7db925a7390d92ffede055b4c8ccf18 (patch)
tree6eb2f1c92698577a841faf6e1621e82edb3edc25 /tests
parentd43b40113ec1e8289e48d77f00e8947f2fd98fd4 (diff)
downloadlibtool-ff3b32aed7db925a7390d92ffede055b4c8ccf18.tar.gz
syntax-check: fix violations and implement sc_prohibit_sed_s_comma.
I like to name temporary directories that I will remove shortly with two leading commas so that they sort lexicographically at the top of `ls' output. Now, `./configure --prefix=`pwd`/,,inst' works again, for the first time in several years. * cfg.mk (sc_prohibit_sed_s_comma): Comma is too common a character to use routinely as the separator for sed substitutions on file paths and other variables determined by the user, causing bugs like the one I describe above. Make sure we don't accidentally reintroduce any comma separators in future. * Makefile.am, bootstrap, bootstrap.conf, build-aux/extract-trace, build-aux/general.m4sh, build-aux/git-hooks/commit-msg, build-aux/git-log-fix, build-aux/ltmain.m4sh, libtoolize.m4sh, m4/libtool.m4, m4/ltdl.m4, tests/cdemo-undef.test, tests/cmdline_wrap.at, tests/darwin.at, tests/defs.m4sh, tests/getopt-m4sh.at, tests/install.at, tests/libtoolize.at, tests/mdemo/Makefile.am, tests/need_lib_prefix.at, tests/sysroot.at, tests/tagdemo-undef.test, tests/testsuite.at: Try to use `|' as the default separator wherever possible, otherwise something else that doesn't occur in the substitution expression. * NEWS: Updated. Signed-off-by: Gary V. Vaughan <gary@gnu.org>
Diffstat (limited to 'tests')
-rwxr-xr-xtests/cdemo-undef.test2
-rw-r--r--tests/cmdline_wrap.at2
-rw-r--r--tests/darwin.at2
-rw-r--r--tests/defs.m4sh2
-rw-r--r--tests/getopt-m4sh.at2
-rw-r--r--tests/install.at2
-rw-r--r--tests/libtoolize.at14
-rw-r--r--tests/mdemo/Makefile.am2
-rw-r--r--tests/need_lib_prefix.at2
-rw-r--r--tests/sysroot.at2
-rwxr-xr-xtests/tagdemo-undef.test2
-rw-r--r--tests/testsuite.at4
12 files changed, 19 insertions, 19 deletions
diff --git a/tests/cdemo-undef.test b/tests/cdemo-undef.test
index 7d5cd9bf..732e3553 100755
--- a/tests/cdemo-undef.test
+++ b/tests/cdemo-undef.test
@@ -34,7 +34,7 @@ grep '^allow_undefined_flag=.\{0,1\}unsupported.\{0,1\}$' ./libtool >/dev/null 2
&& func_skip "$host doesn't support undefined symbols in shared libs"
if test -f ./libtool; then
- $SED 's,allow_undefined=no,allow_undefined=yes,g' ./libtool > ltnew
+ $SED 's|allow_undefined=no|allow_undefined=yes|g' ./libtool > ltnew
else
exit 1
fi
diff --git a/tests/cmdline_wrap.at b/tests/cmdline_wrap.at
index c7f56714..79a39319 100644
--- a/tests/cmdline_wrap.at
+++ b/tests/cmdline_wrap.at
@@ -30,7 +30,7 @@ AT_KEYWORDS([recursive expensive])
m4_ifdef([AT_CAPTURE_FILE],
[AT_CAPTURE_FILE([testsuite.log])])
-sed 's,max_cmd_len=.*,max_cmd_len="24",' < $LIBTOOL > libtool
+sed 's|max_cmd_len=.*|max_cmd_len="24"|' < $LIBTOOL > libtool
chmod +x libtool
LIBTOOL=`pwd`/libtool
export LIBTOOL
diff --git a/tests/darwin.at b/tests/darwin.at
index 11be3aa7..4b0d789c 100644
--- a/tests/darwin.at
+++ b/tests/darwin.at
@@ -74,7 +74,7 @@ if test $# != 1; then
exit 1
fi
-echo $1 | sed "s,^.*/,,"
+echo $1 | sed "s|^.*/||"
]])
chmod +x bin/basename
diff --git a/tests/defs.m4sh b/tests/defs.m4sh
index 6cfe9788..31089a8c 100644
--- a/tests/defs.m4sh
+++ b/tests/defs.m4sh
@@ -348,7 +348,7 @@ func_exec ()
}
# Shared global variables for test scripts
-prefix=./_inst-`echo "$0" | sed 's,.*/,,; s,-.*,,'`
+prefix=./_inst-`echo "$0" | sed 's|.*/||; s|-.*||'`
abs_srcdir=`cd '@srcdir@' && pwd`
abs_macro_dir=`cd '@srcdir@/@macro_dir@' && pwd`
abs_aux_dir=`cd '@srcdir@/@aux_dir@' && pwd`
diff --git a/tests/getopt-m4sh.at b/tests/getopt-m4sh.at
index ee59ca51..5eec5c23 100644
--- a/tests/getopt-m4sh.at
+++ b/tests/getopt-m4sh.at
@@ -49,7 +49,7 @@ m4_pattern_forbid([AS_INIT])
AT_CHECK([$M4SH --version || exit 77], [], [ignore], [ignore])
AT_CHECK([$M4SH -B $abs_top_srcdir/build-aux options.m4sh > t-options],
[], [], [], [AT_CHECK([test 63 -eq "$at_status" && exit 77])])
-$SED "s,@LN_S\@,$LN_S,g;s,@SED\@,$SED,g" t-options > options
+$SED "s|@LN_S\@|$LN_S|g;s|@SED\@|$SED|g" t-options > options
])# _LT_AT_GETOPT_M4SH_SETUP
diff --git a/tests/install.at b/tests/install.at
index 5e155558..5b6c73e8 100644
--- a/tests/install.at
+++ b/tests/install.at
@@ -30,7 +30,7 @@ AT_KEYWORDS([libtool])
AT_CHECK([$LIBTOOL --features | grep 'enable shared libraries' || exit 77],
[], [ignore])
-sed 's,^\(install_override_mode\)=.*,\1=755,' < $LIBTOOL > ./libtool
+sed 's|^\(install_override_mode\)=.*|\1=755|' < $LIBTOOL > ./libtool
LIBTOOL=./libtool
chmod a+rx $LIBTOOL
diff --git a/tests/libtoolize.at b/tests/libtoolize.at
index 30362840..9bc37701 100644
--- a/tests/libtoolize.at
+++ b/tests/libtoolize.at
@@ -696,7 +696,7 @@ LT_AT_ACLOCAL([-I $abs_top_srcdir/m4])
: ${GREP="grep"}
: ${SED="sed"}
-basename='s,^.*/,,'
+basename='s|^.*/||'
# func_grep expression filename
# Check whether EXPRESSION matches any line of FILENAME, without output.
@@ -714,7 +714,7 @@ func_serial ()
my_macro_regex=$2
my_sed_serial='
/^# serial [1-9][0-9.]*[ ]*'"$my_macro_regex"'[ ]*$/ {
- s,^# serial \([1-9][0-9.]*\).*$,\1,
+ s|^# serial \([1-9][0-9.]*\).*$|\1|
q
}
d'
@@ -742,11 +742,11 @@ libtool_serial=`func_serial "$tst_aclocaldir/libtool.m4" LT_INIT`
ltversion_serial=`func_serial "$tst_aclocaldir/ltversion.m4" ltversion.m4`
ltsugar_serial=`func_serial "$tst_aclocaldir/ltsugar.m4" ltsugar.m4`
lt_obsolete_serial=`func_serial "$tst_aclocaldir/lt~obsolete.m4" lt~obsolete.m4`
-$SED -e 's,^#.*serial.*ltoptions.m4$,# serial 99999 ltoptions.m4,' \
- -e "s,^#.*serial.*libtool.m4\$,# serial $libtool_serial libtool.m4," \
- -e "s,^#.*serial.*ltversion.m4\$,# serial $ltversion_serial ltversion.m4," \
- -e "s,^#.*serial.*ltsugar.m4\$,# serial $ltsugar_serial ltsugar.m4," \
- -e "s,^#.*serial.*lt~obsolete.m4\$,# serial $lt_obsolete_serial lt~obsolete.m4," \
+$SED -e 's|^#.*serial.*ltoptions.m4$|# serial 99999 ltoptions.m4|' \
+ -e "s|^#.*serial.*libtool.m4\$|# serial $libtool_serial libtool.m4|" \
+ -e "s|^#.*serial.*ltversion.m4\$|# serial $ltversion_serial ltversion.m4|" \
+ -e "s|^#.*serial.*ltsugar.m4\$|# serial $ltsugar_serial ltsugar.m4|" \
+ -e "s|^#.*serial.*lt~obsolete.m4\$|# serial $lt_obsolete_serial lt~obsolete.m4|" \
< aclocal.m4 > aclocal.m4t
mv -f aclocal.m4t aclocal.m4
diff --git a/tests/mdemo/Makefile.am b/tests/mdemo/Makefile.am
index 7f34be12..ff9e4592 100644
--- a/tests/mdemo/Makefile.am
+++ b/tests/mdemo/Makefile.am
@@ -55,7 +55,7 @@ top_distdir = ../..
$(LIBLTDL): $(top_distdir)/libtool \
$(top_distdir)/config.h $(srcdir)/$(top_distdir)/libltdl/ltdl.c \
$(srcdir)/$(top_distdir)/libltdl/ltdl.h
- (cd $(top_distdir); $(MAKE) `echo $(LIBLTDL) | sed 's,.*\.\./libltdl/,libltdl/,g'`)
+ (cd $(top_distdir); $(MAKE) `echo $(LIBLTDL) | sed 's|.*\.\./libltdl/|libltdl/|g'`)
# Do not error out if toplevel config.h does not exist:
$(top_distdir)/config.h:
diff --git a/tests/need_lib_prefix.at b/tests/need_lib_prefix.at
index 4eee3b90..5d72e574 100644
--- a/tests/need_lib_prefix.at
+++ b/tests/need_lib_prefix.at
@@ -161,7 +161,7 @@ eval libname=\"$libname_spec\"
AT_CHECK([test lib = "$libname" || exit 77])
# Create our own libtool, forcing need_lib_prefix setting
-sed 's,^\(need_lib_prefix\)=.*$,\1=unknown,' $LIBTOOL > ./libtool
+sed 's|^\(need_lib_prefix\)=.*$|\1=unknown|' $LIBTOOL > ./libtool
LIBTOOL="$SHELL ./libtool"
# Installation directory:
diff --git a/tests/sysroot.at b/tests/sysroot.at
index 34e6d48d..3c01278c 100644
--- a/tests/sysroot.at
+++ b/tests/sysroot.at
@@ -39,7 +39,7 @@ for i in crt0.o crt1.o crt2.o crti.o; do
test $? = 0 || continue
case $j in
$gcc_sysroot*/lib/$i)
- prefix=`echo "$j" | sed "s,^$gcc_sysroot\\(.*\\)/lib/$i\$,\\1,"`
+ prefix=`echo "$j" | sed "s|^$gcc_sysroot\\(.*\\)/lib/$i\$|\\1|"`
break ;;
esac
done
diff --git a/tests/tagdemo-undef.test b/tests/tagdemo-undef.test
index e1f966db..89d97cd2 100755
--- a/tests/tagdemo-undef.test
+++ b/tests/tagdemo-undef.test
@@ -35,7 +35,7 @@ grep '^allow_undefined_flag=.\{0,1\}unsupported.\{0,1\}$' ./libtool >/dev/null 2
&& func_skip "$host doesn't support undefined symbols in shared libs"
if test -f ./libtool; then
- $SED 's,allow_undefined=no,allow_undefined=yes,g' ./libtool > ltnew
+ $SED 's|allow_undefined=no|allow_undefined=yes|g' ./libtool > ltnew
else
exit 1
fi
diff --git a/tests/testsuite.at b/tests/testsuite.at
index 48aa080a..5e429cea 100644
--- a/tests/testsuite.at
+++ b/tests/testsuite.at
@@ -92,7 +92,7 @@ AT_KEYWORDS([libtoolize])
# ---------------------------
# Fix the expected output of installed libtoolize in presence of --program-*.
m4_define([_LIBTOOLIZE_TRANSFORM],
-[lt_name=`$ECHO "$LIBTOOLIZE" | sed "s,^.*/,,"`
+[lt_name=`$ECHO "$LIBTOOLIZE" | sed "s|^.*/||"`
sed "s/libtoolize/$lt_name/g
s|/usr/local/share/aclocal/|${tst_aclocaldir-$abs_top_srcdir/libltdl/m4}/|" < $1 > $1.t
mv -f $1.t $1
@@ -243,7 +243,7 @@ esac])
# - location of the libtool script,
# - error messages involving unstable temporary file names.
m4_define([LT_AT_NORMALIZE_COMPILER_OUTPUT],
-[_ltbase=`$ECHO "$LIBTOOL" | sed 's,^.*/,,'`
+[_ltbase=`$ECHO "$LIBTOOL" | sed 's|^.*/||'`
[sed "/^distcc\[[0-9]*\]/d
/^$_ltbase: compile/d
s/\(tmp\/\{1,\}cc\)\([a-zA-Z0-9_]\{1,\}\)/\1-normalized-tmpname/g" < $1 > $1.t]