[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 1/7] coverage: emacs lisp files in subdirectories
From: |
Stefano Lattarini |
Subject: |
[PATCH 1/7] coverage: emacs lisp files in subdirectories |
Date: |
Sat, 14 Jul 2012 23:51:55 +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 <address@hidden>
---
t/lisp-subdir.sh | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++++
t/lisp-subdir2.sh | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++
t/list-of-tests.mk | 4 +++
3 files changed, 162 insertions(+)
create mode 100755 t/lisp-subdir.sh
create mode 100755 t/lisp-subdir2.sh
diff --git a/t/lisp-subdir.sh b/t/lisp-subdir.sh
new file mode 100755
index 0000000..5c67c53
--- /dev/null
+++ b/t/lisp-subdir.sh
@@ -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
index 0000000..d7517ad
--- /dev/null
+++ b/t/lisp-subdir2.sh
@@ -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
+
+:
diff --git a/t/list-of-tests.mk b/t/list-of-tests.mk
index 383be1b..40665c1 100644
--- a/t/list-of-tests.mk
+++ b/t/list-of-tests.mk
@@ -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 \
--
1.7.9.5
- Refactoring elisp compilation, Jack Kelly, 2012/07/14
- Re: Refactoring elisp compilation, Stefano Lattarini, 2012/07/14
- [PATCH 0/7] More work on elisp support, Stefano Lattarini, 2012/07/14
- [PATCH 1/7] coverage: emacs lisp files in subdirectories,
Stefano Lattarini <=
- [PATCH 2/7] coverage: elisp path contains $(srcdir) and $(builddir), Stefano Lattarini, 2012/07/14
- [PATCH 3/7] elisp: use suffix rules, get rid of 'elisp-comp' script (mostly a rewrite), Stefano Lattarini, 2012/07/14
- [PATCH 4/7] elisp: prefer $(builddir) files over $(srcdir) ones, Stefano Lattarini, 2012/07/14
- [PATCH 5/7] elisp: no need to "absolutize" $(srcdir) and $(builddir) ..., Stefano Lattarini, 2012/07/14
- Re: [PATCH 5/7] elisp: no need to "absolutize" $(srcdir) and $(builddir) ..., Jack Kelly, 2012/07/14
- Re: [PATCH 5/7] elisp: no need to "absolutize" $(srcdir) and $(builddir) ..., Stefano Lattarini, 2012/07/15
- [PATCH 7/7] elisp: support elisp files in subdirectories properly, Stefano Lattarini, 2012/07/14
- [PATCH 6/7] elisp: simplify suffix rules using emacs '-L' option, Stefano Lattarini, 2012/07/14
- Re: Refactoring elisp compilation, Jack Kelly, 2012/07/14