coverage: emacs lisp files in subdirectories
authorStefano Lattarini <stefano.lattarini@gmail.com>
Sat, 14 Jul 2012 18:55:30 +0000 (20:55 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Sat, 14 Jul 2012 21:46:54 +0000 (23:46 +0200)
* t/lisp-subdir.sh, t/lisp-subdir2.sh: New tests, still failing.
* t/list-of-files.mk (handwritten_TESTS, XFAIL_TESTS): Add them.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
t/lisp-subdir.sh [new file with mode: 0755]
t/lisp-subdir2.sh [new file with mode: 0755]
t/list-of-tests.mk

diff --git a/t/lisp-subdir.sh b/t/lisp-subdir.sh
new file mode 100755 (executable)
index 0000000..5c67c53
--- /dev/null
@@ -0,0 +1,80 @@
+#! /bin/sh
+# Copyright (C) 2012 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Emacs lisp files in subdirectories.
+
+required=emacs
+. ./defs || exit 1
+
+cat >> configure.ac << 'END'
+AM_PATH_LISPDIR
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+nobase_lisp_LISP = sub/am-one.el sub/am-two.el sub/am-three.el
+nobase_dist_lisp_LISP = sub/am-three.el
+dist_noinst_LISP = sub/am-four.el
+EXTRA_DIST = sub/am-one.el sub/am-two.el
+END
+
+mkdir sub
+echo "(require 'am-two) (provide 'am-one)"      > sub/am-one.el
+echo "(require 'am-three) (provide 'am-two)"    > sub/am-two.el
+echo "(provide 'am-three)"                      > sub/am-three.el
+echo "(require 'am-one) (require 'am-two)"      > sub/am-four.el
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE --add-missing
+
+./configure --prefix="$(pwd)/inst" \
+            --with-lispdir="$(pwd)/inst/elisp" \
+
+$MAKE
+# No byte-compiled elisp files in the top-level directory.
+test "$(echo *.elc)" = '*.elc'
+test -f sub/am-one.elc
+test -f sub/am-two.elc
+test -f sub/am-three.elc
+test -f sub/am-four.elc
+$MAKE clean
+test ! -e sub/am-one.elc
+test ! -e sub/am-two.elc
+test ! -e sub/am-three.elc
+test ! -e sub/am-four.elc
+
+# Check installation.
+
+sort > exp << 'END'
+inst/elisp/sub/am-one.elc
+inst/elisp/sub/am-two.elc
+inst/elisp/sub/am-three.elc
+END
+
+$MAKE install
+find inst # For debugging.
+find inst -name '*.elc' > lst || { cat lst; exit 1; }
+sort lst > got
+
+cat exp
+cat got
+diff exp got
+
+# Also check VPATH builds and uninstall completeness.
+$MAKE distcheck
+
+:
diff --git a/t/lisp-subdir2.sh b/t/lisp-subdir2.sh
new file mode 100755 (executable)
index 0000000..d7517ad
--- /dev/null
@@ -0,0 +1,78 @@
+#! /bin/sh
+# Copyright (C) 2012 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Compiling elisp files in different subdirectories.
+
+required=emacs
+. ./defs || exit 1
+
+cat >> configure.ac << 'END'
+AM_PATH_LISPDIR
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+dist_lisp_LISP = am-one.el
+nodist_lisp_LISP = sub/am-two.el
+sub/am-two.el:
+       mkdir sub
+       echo "(provide 'am-two)" > $@
+DISTCLEANFILES = $(nodist_lisp_LISP)
+dist_noinst_LISP = x/y/z/am-three.el
+
+elc-test:
+       test -f am-one.elc
+       test -f sub/am-two.elc
+       test -f x/y/z/am-three.elc
+.PHONY: elc-test
+check-local: elc-test
+END
+
+mkdir x x/y x/y/z
+echo "(provide 'am-one)" > am-one.el
+# sub/am-two.el is generated at make runtime
+echo "(provide 'am-three)" > x/y/z/am-three.el
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE --add-missing
+
+./configure
+
+$MAKE
+$MAKE elc-test
+$MAKE clean
+test ! -e am-one.elc
+test ! -e sub/am-two.elc
+test ! -e x/y/z/am-three.elc
+test -f am-one.el
+test -f sub/am-two.el
+test -f x/y/z/am-three.el
+
+# Byte-compiling only a subset of the elisp files.
+$MAKE am-one.elc sub/am-two.elc 
+test -f am-one.elc
+test -f sub/am-two.elc
+test ! -e x/y/z/am-three.elc
+rm -f am-one.elc sub/am-two.elc
+$MAKE x/y/z/am-three.elc
+test ! -e am-one.elc
+test ! -e sub/am-two.elc
+test -f x/y/z/am-three.elc
+
+$MAKE distcheck
+
+:
index 383be1b..40665c1 100644 (file)
@@ -38,6 +38,8 @@ t/override-conditional-2.sh \
 t/dist-pr109765.sh \
 t/instdir-cond2.sh \
 t/java-nobase.sh \
+t/lisp-subdir.sh \
+t/lisp-subdir2.sh \
 t/objext-pr10128.sh \
 t/parallel-tests-many.sh \
 t/pr8365-remake-timing.sh \
@@ -630,6 +632,8 @@ t/lisp5.sh \
 t/lisp6.sh \
 t/lisp7.sh \
 t/lisp8.sh \
+t/lisp-subdir.sh \
+t/lisp-subdir2.sh \
 t/lispdry.sh \
 t/lisp-pr11806.sh \
 t/listval.sh \