* tests/lisp2.test: Prettify, and improve debugging output. Make grepping of automake stderr stricter. * tests/lisp7.test: Ensure verbose printing of captured make output. Add trailing `:' command. * tests/lisp8.test: Likewise. * tests/lisp3.test: Likewise. Also, check that `.el' files and compiled `.elc' files get installed by "make install", and uninstalled by "make uninstall". * tests/lisp4.test: Ensure installed `.el' files gets removed by "make uninstall". Related changes. Add trailing `:' command. * tests/lisp5.test: Likewise. * tests/lisp6.test: Use proper m4 quoting in configure.in. Fix use of blank lines, to improve clarity and symmetry. Fix typo in comment. Add trailing `:' command. --- ChangeLog | 18 ++++++++++++++++++ tests/lisp2.test | 26 +++++++++++++++++--------- tests/lisp3.test | 33 ++++++++++++++++++++++++++++++--- tests/lisp4.test | 20 +++++++++++--------- tests/lisp5.test | 12 +++++++++++- tests/lisp6.test | 9 ++++++--- tests/lisp7.test | 5 +++-- tests/lisp8.test | 4 +++- 8 files changed, 99 insertions(+), 28 deletions(-)
diff --git a/ChangeLog b/ChangeLog index 84b8671..3879c5a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,23 @@ 2011-07-16 Stefano Lattarini <stefano.lattar...@gmail.com> + tests: tweak, improve and extend tests on lisp support + * tests/lisp2.test: Prettify, and improve debugging output. Make + grepping of automake stderr stricter. + * tests/lisp7.test: Ensure verbose printing of captured make + output. Add trailing `:' command. + * tests/lisp8.test: Likewise. + * tests/lisp3.test: Likewise. Also, check that `.el' files and + compiled `.elc' files get installed by "make install", and + uninstalled by "make uninstall". + * tests/lisp4.test: Ensure installed `.el' files gets removed by + "make uninstall". Related changes. Add trailing `:' command. + * tests/lisp5.test: Likewise. + * tests/lisp6.test: Use proper m4 quoting in configure.in. Fix + use of blank lines, to improve clarity and symmetry. Fix typo in + comment. Add trailing `:' command. + +2011-07-16 Stefano Lattarini <stefano.lattar...@gmail.com> + tests: drop useless requirement in 'license.test' * tests/license.test: Drop useless requirement "makeinfo". Add an extra blank line, for clarity. diff --git a/tests/lisp2.test b/tests/lisp2.test index 3b795db..9ce19f7 100755 --- a/tests/lisp2.test +++ b/tests/lisp2.test @@ -18,7 +18,8 @@ . ./defs || Exit 1 -echo 1 + +: TRY 1 -- We lack both EMACS and lispdir. cat > Makefile.am << 'END' lisp_LISP = foo.el @@ -27,10 +28,12 @@ END $ACLOCAL AUTOMAKE_fails grep AM_PATH_LISPDIR stderr +grep '[Ll]isp source.*EMACS.* undefined' stderr +grep '[Ll]isp source.*lispdir.* undefined' stderr +grep ' add .*AM_PATH_LISPDIR' stderr -echo 2 -# Setting lispdir should not be enough. +: TRY 2 -- Setting lispdir should not be enough. cat > Makefile.am << 'END' lispdir = /usr/share/emacs/site-lisp @@ -39,10 +42,12 @@ END $ACLOCAL AUTOMAKE_fails -grep AM_PATH_LISPDIR stderr +grep 'lispdir.*undefined' stderr && Exit 1 +grep '[Ll]isp source.*EMACS.* undefined' stderr +grep 'define .*EMACS.* add .*AM_PATH_LISPDIR' stderr + -echo 3 -# Setting EMACS should not be enough. +: TRY 3 -- Setting EMACS should not be enough. cat > Makefile.am << 'END' EMACS = emacs @@ -51,11 +56,12 @@ END $ACLOCAL AUTOMAKE_fails -grep AM_PATH_LISPDIR stderr +grep 'EMACS.*undefined' stderr && Exit 1 +grep '[Ll]isp source.*lispdir.* undefined' stderr +grep 'define .*lispdir.* add .*AM_PATH_LISPDIR' stderr -echo 4 -# Setting both is OK. +: TRY 4 -- Setting both EMACS and lispdir is OK. cat > Makefile.am << 'END' lispdir = /usr/share/emacs/site-lisp @@ -65,3 +71,5 @@ END $ACLOCAL $AUTOMAKE -a + +: diff --git a/tests/lisp3.test b/tests/lisp3.test index a8a0fc3..aaf17c5 100755 --- a/tests/lisp3.test +++ b/tests/lisp3.test @@ -36,11 +36,11 @@ echo "(require 'am-two)" > am-one.el echo "(require 'am-three) (provide 'am-two)" > am-two.el # am-three.el is a built source - $ACLOCAL $AUTOCONF $AUTOMAKE --add-missing -./configure + +./configure --prefix="`pwd`/_inst" $MAKE @@ -54,14 +54,41 @@ rm -f am-one.elc $MAKE test -f am-one.elc +# Test installation/deinstallation. + +$MAKE install + +find _inst # For debugging. + +# Keep thin in sync with m4/lispdir.m4. +for dir in lib/emacs lib/xemacs share/emacs share/xemacs :; do + if test $dir = :; then + Exit 1 + elif test -d _inst/$dir/site-lisp; then + break + fi +done + +test -f _inst/$dir/site-lisp/am-one.el +test -f _inst/$dir/site-lisp/am-one.elc +test -f _inst/$dir/site-lisp/am-two.el +test -f _inst/$dir/site-lisp/am-two.elc +test -f _inst/$dir/site-lisp/am-three.el +test -f _inst/$dir/site-lisp/am-three.elc + +$MAKE uninstall +find _inst | $EGREP '\.elc?$' && Exit 1 + # Make sure we build all files when any of them change. # (We grep a message to make sure the compilation happens.) unique=0a3346e2af8a689b85002b53df09142a $sleep echo "(message \"$unique\")(provide 'am-three)" > am-three.el -$MAKE >output 2>&1 +$MAKE >output 2>&1 || { cat output; Exit 1; } cat output grep $unique output # It should also work for VPATH-builds. $MAKE distcheck + +: diff --git a/tests/lisp4.test b/tests/lisp4.test index 3834746..8f1bfe5 100755 --- a/tests/lisp4.test +++ b/tests/lisp4.test @@ -42,13 +42,9 @@ install-test: install test ! -f "$(lispdir)/am-two.elc" test ! -f "$(lispdir)/am-three.elc" -install-test2: install - test ! -f "$(lispdir)/am-one.el" - test ! -f "$(lispdir)/am-two.el" - test ! -f "$(lispdir)/am-three.el" - test ! -f "$(lispdir)/am-one.elc" - test ! -f "$(lispdir)/am-two.elc" - test ! -f "$(lispdir)/am-three.elc" +not-installed: + find "$(lispdir)" | grep '\.el$$' && exit 1; : + find "$(lispdir)" | grep '\.elc$$' && exit 1; : EOF cat >> configure.in << 'EOF' @@ -69,10 +65,16 @@ $MAKE $MAKE test $MAKE install-test $MAKE uninstall +$MAKE not-installed # Fake the absence of emacs. -# *.el files should not be installed. +# *.el files should not be installed, but "make install" and +# "make uninstall" should continue to work. ./configure EMACS=no --prefix "`pwd`" $MAKE $MAKE test -$MAKE install-test2 +$MAKE install +$MAKE not-installed +$MAKE uninstall + +: diff --git a/tests/lisp5.test b/tests/lisp5.test index 93ac9e1..59bd8ec 100755 --- a/tests/lisp5.test +++ b/tests/lisp5.test @@ -40,6 +40,10 @@ install-test: install test ! -f "$(lispdir)/am-one.elc" test ! -f "$(lispdir)/am-two.elc" test ! -f "$(lispdir)/am-three.elc" + +not-installed: + find "$(lispdir)" | grep '\.el$$' && exit 1; : + find "$(lispdir)" | grep '\.elc$$' && exit 1; : EOF cat >> configure.in << 'EOF' @@ -60,10 +64,16 @@ $MAKE $MAKE test $MAKE install-test $MAKE uninstall +$MAKE not-installed # Fake the absence of emacs. -# *.el files SHOULD be installed. +# *.el files SHOULD be installed by "make install" (and uninstalled +# by "make uninstall"). ./configure EMACS=no --prefix "`pwd`" $MAKE $MAKE test $MAKE install-test +$MAKE uninstall +$MAKE not-installed + +: diff --git a/tests/lisp6.test b/tests/lisp6.test index d424511..1af351c 100755 --- a/tests/lisp6.test +++ b/tests/lisp6.test @@ -33,7 +33,7 @@ dist-test: distdir EOF cat >> configure.in << 'EOF' -AM_CONDITIONAL([WANT_TWO], test -n "$want_two") +AM_CONDITIONAL([WANT_TWO], [test -n "$want_two"]) AM_PATH_LISPDIR AC_OUTPUT EOF @@ -45,6 +45,7 @@ echo "(require 'am-one)" > am-three.el $ACLOCAL $AUTOCONF $AUTOMAKE --add-missing + ./configure "--with-lispdir=`pwd`/lisp" $MAKE @@ -69,15 +70,15 @@ test ! -f am-two.elc test ! -f am-three.elc test ! -f elc-stamp - ./configure "--with-lispdir=`pwd`/lisp" want_two=1 + $MAKE test -f am-one.elc test -f am-two.elc test -f am-three.elc test -f elc-stamp -# Let's mutilate the source tree, the check the recover rule. +# Let's mutilate the source tree, to check the recover rule. rm -f am-*.elc $MAKE test -f am-one.elc @@ -100,3 +101,5 @@ test ! -f am-one.elc test ! -f am-two.elc test ! -f am-three.elc test ! -f elc-stamp + +: diff --git a/tests/lisp7.test b/tests/lisp7.test index ad231dd..f1d0093 100755 --- a/tests/lisp7.test +++ b/tests/lisp7.test @@ -37,8 +37,7 @@ $AUTOCONF $AUTOMAKE --add-missing ./configure -$MAKE >stdout - +$MAKE >stdout || { cat stdout; Exit 1; } cat stdout test 1 -eq `grep 'Warnings can be ignored' stdout | wc -l` @@ -48,3 +47,5 @@ test ! -f am-three.elc test -f elc-stamp $MAKE distcheck + +: diff --git a/tests/lisp8.test b/tests/lisp8.test index afba76c..5b8a6ff 100755 --- a/tests/lisp8.test +++ b/tests/lisp8.test @@ -51,7 +51,7 @@ test -f elc-stamp rm -f am-*.elc : >stdout -$MAKE -j >>stdout +$MAKE -j >>stdout || { cat stdout; Exit 1; } cat stdout test 1 -eq `grep 'Warnings can be ignored' stdout | wc -l` @@ -59,3 +59,5 @@ test -f am-one.elc test -f am-two.elc test -f am-three.elc test -f elc-stamp + +: -- 1.7.2.3