summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorStefano Lattarini <stefano.lattarini@gmail.com>2014-12-22 17:56:22 +0100
committerStefano Lattarini <stefano.lattarini@gmail.com>2014-12-22 17:56:22 +0100
commit88ac92b2d5beaf4aee7d7bb4f3dc9a86da823550 (patch)
tree16c1527969be06b21275e997f559333b738c8be5 /t
parent4179284a3de093f3578a67c9b258a0d91eb4b6be (diff)
parent912383451a4a394383a8e95240e3e98ee68faf72 (diff)
downloadautomake-88ac92b2d5beaf4aee7d7bb4f3dc9a86da823550.tar.gz
Merge branch 'micro' into minor
* micro: cleanup: refactor code to initialize DIST_COMMON dist: ordering of files in DIST_COMMON is deterministic now tests: refactor some tests on DIST_COMMON maint: make output of 'gen-testsuite-part' deterministic When computing lispdir, don't load emacs site wide init file. PATH: quote $(PATH_SEPARATOR) as well Improve detection of GNU make, avoiding "Arg list too long" errors.
Diffstat (limited to 't')
-rw-r--r--t/Makefile.inc4
-rw-r--r--t/distcom-subdir.sh51
-rw-r--r--t/distcom2.sh12
-rw-r--r--t/distcom3.sh22
-rw-r--r--t/distcom4.sh28
-rw-r--r--t/distcom5.sh42
-rw-r--r--t/hdr-vars-defined-once.sh23
7 files changed, 75 insertions, 107 deletions
diff --git a/t/Makefile.inc b/t/Makefile.inc
index 5f10d90ef..62613ac7d 100644
--- a/t/Makefile.inc
+++ b/t/Makefile.inc
@@ -64,9 +64,9 @@ AM_TESTS_ENVIRONMENT += stderr_fileno_=9; export stderr_fileno_;
# in case it is given with a relative name containing no slashes.
AM_TESTS_ENVIRONMENT += \
if test $(srcdir) != .; then \
- PATH='$(abs_srcdir)/%D%/ax'$(PATH_SEPARATOR)$$PATH; \
+ PATH='$(abs_srcdir)/%D%/ax$(PATH_SEPARATOR)'$$PATH; \
fi; \
- PATH='$(abs_builddir)/%D%/ax'$(PATH_SEPARATOR)$$PATH; \
+ PATH='$(abs_builddir)/%D%/ax$(PATH_SEPARATOR)'$$PATH; \
export PATH;
# Hand-written tests.
diff --git a/t/distcom-subdir.sh b/t/distcom-subdir.sh
index 257561ed8..df40f96cd 100644
--- a/t/distcom-subdir.sh
+++ b/t/distcom-subdir.sh
@@ -17,59 +17,60 @@
# Test to make sure that if an auxfile (here depcomp) is required
# by a subdir Makefile.am, it is distributed by that Makefile.am.
+required=cc
. test-init.sh
cat >> configure.ac << 'END'
AC_CONFIG_FILES([subdir/Makefile])
AC_PROG_CC
+AC_PROG_FGREP
AC_OUTPUT
END
cat > Makefile.am << 'END'
SUBDIRS = subdir
+test-distdir: distdir
+ test -f $(distdir)/depcomp
+.PHONY: test-distdir
+check-local: test-distdir
END
rm -f depcomp
mkdir subdir
-: > subdir/Makefile.am
+cat > subdir/Makefile.am << 'END'
+.PHONY: test-distcom
+test-distcom:
+ echo ' ' $(DIST_COMMON) ' ' | $(FGREP) ' $(top_srcdir)/depcomp '
+END
$ACLOCAL
$AUTOCONF
$AUTOMAKE
test ! -e depcomp
-cat > subdir/Makefile.am << 'END'
+cat >> subdir/Makefile.am << 'END'
bin_PROGRAMS = foo
+.PHONY: test-distcom
+test-distcom:
+ echo ' ' $(DIST_COMMON) ' ' | $(FGREP) ' $(top_srcdir)/depcomp '
+check-local: test-distcom
END
-: > subdir/foo.c
+cat > subdir/foo.c <<'END'
+int main (void)
+{
+ return 0;
+}
+END
$AUTOMAKE -a subdir/Makefile
test -f depcomp
-# FIXME: the logic of this check and other similar ones in other
-# FIXME: 'distcom*.sh' files should be factored out in a common
-# FIXME: subroutine in 'am-test-lib.sh'...
-sed -n -e "
- /^DIST_COMMON =.*\\\\$/ {
- :loop
- p
- n
- t clear
- :clear
- s/\\\\$/\\\\/
- t loop
- s/$/ /
- s/[$tab ][$tab ]*/ /g
- p
- n
- }" subdir/Makefile.in > dc.txt
-cat dc.txt
-$FGREP ' $(top_srcdir)/depcomp ' dc.txt
-
./configure
-$MAKE distdir
-test -f $distdir/depcomp
+(cd subdir && $MAKE test-distcom)
+$MAKE test-distdir
+
+$MAKE distcheck
:
diff --git a/t/distcom2.sh b/t/distcom2.sh
index c13a6d711..3eb03762d 100644
--- a/t/distcom2.sh
+++ b/t/distcom2.sh
@@ -51,22 +51,18 @@ for opt in '' --no-force; do
test -f depcomp
for dir in . subdir; do
- # FIXME: the logic of this check and other similar ones in other
- # FIXME: 'distcom*.sh' files should be factored out in a common
- # FIXME: subroutine in 'am-test-lib.sh'...
sed -n -e "
- /^DIST_COMMON =.*\\\\$/ {
+ /^am__DIST_COMMON =.*/ {
+ b body
:loop
- p
n
- t clear
- :clear
+ :body
+ p
s/\\\\$/\\\\/
t loop
s/$/ /
s/[$tab ][$tab ]*/ /g
p
- n
}" $dir/Makefile.in > $dir/dc.txt
done
diff --git a/t/distcom3.sh b/t/distcom3.sh
index 78379594d..6f1ebaf3a 100644
--- a/t/distcom3.sh
+++ b/t/distcom3.sh
@@ -19,9 +19,13 @@
. test-init.sh
+echo AC_OUTPUT >> configure.ac
+
cat > Makefile.am << 'END'
README:
echo 'I bet you are reading me.' > README
+test-distcommon:
+ echo ' ' $(DIST_COMMON) ' ' | grep ' README '
END
# Files required by '--gnu'.
@@ -36,20 +40,14 @@ $AUTOMAKE --add-missing --gnu >output 2>&1 || { cat output; exit 1; }
cat output
grep README output && exit 1
-sed -n -e '/^DIST_COMMON =.*\\$/ {
- :loop
- p
- n
- t clear
- :clear
- s/\\$/\\/
- t loop
- p
- n
- }' -e '/^DIST_COMMON =/ p' Makefile.in | grep README
-
+$AUTOCONF
+./configure
+$MAKE test-distcommon
+$MAKE distdir
+test -f $distdir/README
# Should warn about missing README.
+rm -f README
: > Makefile.am
AUTOMAKE_fails --add-missing --gnu
grep 'required file.*README.*not found' stderr
diff --git a/t/distcom4.sh b/t/distcom4.sh
index 5feae9b96..39b5b7179 100644
--- a/t/distcom4.sh
+++ b/t/distcom4.sh
@@ -43,8 +43,13 @@ mkdir tests
: > README
: > tests/wrapper.in
cat > Makefile.am << 'END'
-.PHONY: test
-test: distdir
+.PHONY: test1 test 2
+test1:
+ for x in $(DIST_COMMON); do echo $$x; done \
+ | grep 'tests/' > lst
+ cat lst # For debugging.
+ test `wc -l <lst` -eq 1
+test2: distdir
test -f $(distdir)/tests/wrapper.in
END
@@ -52,23 +57,6 @@ $ACLOCAL
$AUTOCONF
$AUTOMAKE --add-missing
./configure
-$MAKE test
-
-sed -n -e '/^DIST_COMMON =.*\\$/ {
- :loop
- p
- n
- t clear
- :clear
- s/\\$/\\/
- t loop
- p
- n
- }' -e '/^DIST_COMMON =/ p' Makefile.in > dc.txt
-
-cat dc.txt # For debugging.
-
-test 1 -eq $(grep -c tests dc.txt)
-grep configure dc.txt
+$MAKE test1 test2
:
diff --git a/t/distcom5.sh b/t/distcom5.sh
index 2bb1b3435..939702f14 100644
--- a/t/distcom5.sh
+++ b/t/distcom5.sh
@@ -21,21 +21,6 @@
. test-init.sh
-extract_distcommon ()
-{
- sed -n -e '/^DIST_COMMON =.*\\$/ {
- :loop
- p
- n
- t clear
- :clear
- s/\\$/\\/
- t loop
- p
- n
- }' -e '/^DIST_COMMON =/ p' ${1+"$@"}
-}
-
cat >> configure.ac << 'END'
AC_CONFIG_FILES([tests/autoconf:tests/wrapper.in],
[chmod +x tests/autoconf])
@@ -57,28 +42,31 @@ END
mkdir tests
: > tests/wrapper.in
-: > tests/Makefile.am
+
cat > Makefile.am << 'END'
SUBDIRS = tests
.PHONY: test
test: distdir
test -f $(distdir)/tests/wrapper.in
+check-local: test
+ for x in $(DIST_COMMON); do echo $$x; done \
+ | grep tests && exit 1; :
+END
+
+cat > tests/Makefile.am <<'END'
+check-local:
+ for x in $(DIST_COMMON); do echo $$x; done \
+ | grep wrapper.in > lst
+ cat lst # For debugging.
+ test `wc -l <lst` -eq 1
END
$ACLOCAL
$AUTOCONF
$AUTOMAKE --add-missing
./configure
-$MAKE test
-
-extract_distcommon Makefile.in > top.txt
-extract_distcommon tests/Makefile.in > inner.txt
-
-# Might be useful for debugging.
-cat top.txt
-cat inner.txt
-
-test 0 -eq $(grep -c tests top.txt)
-test 1 -eq $(grep -c wrapper inner.txt)
+$MAKE check
+# Sanity check.
+test -f tests/lst
:
diff --git a/t/hdr-vars-defined-once.sh b/t/hdr-vars-defined-once.sh
index 85a254ae6..fdf0bb76d 100644
--- a/t/hdr-vars-defined-once.sh
+++ b/t/hdr-vars-defined-once.sh
@@ -25,25 +25,22 @@ END
cat > Makefile.am << 'END'
include Will_Be_Included_In_Makefile
+test-distcommon:
+ echo ' ' $(DIST_COMMON) ' ' \
+ | grep '[ /]Will_Be_Included_In_Makefile '
END
-: > Will_Be_Included_In_Makefile
+id=0c35bbde7c95b569a
+echo "# $id" > Will_Be_Included_In_Makefile
$ACLOCAL
$AUTOMAKE
test $(grep -c '^srcdir' Makefile.in) -eq 1
-# Also make sure include file is distributed.
-sed -n -e '/^DIST_COMMON =.*\\$/ {
- :loop
- p
- n
- t clear
- :clear
- s/\\$/\\/
- t loop
- p
- n
- }' -e '/^DIST_COMMON =/ p' Makefile.in | grep Will_Be_Included_In_Makefile
+$AUTOCONF
+./configure
+$MAKE test-distcommon
+$MAKE distdir
+grep "$id" $distdir/Will_Be_Included_In_Makefile
: