diff options
author | Stefano Lattarini <stefano.lattarini@gmail.com> | 2011-07-16 10:37:55 +0200 |
---|---|---|
committer | Stefano Lattarini <stefano.lattarini@gmail.com> | 2011-07-16 12:32:52 +0200 |
commit | 0933a8cae4c508c19ad9348fb0aa24354bca9207 (patch) | |
tree | 074952318331e7a4beeda6d1865d4d9132b60e7a | |
parent | 75eb16857bc94aae196be1d74a2eaf9a6a822347 (diff) | |
download | automake-0933a8cae4c508c19ad9348fb0aa24354bca9207.tar.gz |
tests: more uses of the 'unindent' subroutine
* tests/backcompat.test: Prefer `unindent' over plain `cat' for
here documents created from within a loop of if/else body.
* tests/backcompat2.test: Likewise.
* tests/backcompat4.test: Likewise.
* tests/init.test: Likewise.
* tests/instmany.test: Likewise.
* tests/instmany-mans.test: Likewise.
* tests/instmany-python.test: Likewise.
* tests/missing5.test: Likewise.
* tests/parallel-am2.test : Likewise.
* tests/parallel-am3.test : Likewise.
* tests/pr307.test: Likewise.
* tests/depend4.test: Likewise. Since we are at it, normalize
other code formatting.
* tests/instfail-java.test: Prefer `echo' over `cat' + here-doc
inside a for loop.
-rw-r--r-- | ChangeLog | 20 | ||||
-rwxr-xr-x | tests/backcompat.test | 10 | ||||
-rwxr-xr-x | tests/backcompat2.test | 20 | ||||
-rwxr-xr-x | tests/backcompat4.test | 18 | ||||
-rwxr-xr-x | tests/depend4.test | 19 | ||||
-rwxr-xr-x | tests/init.test | 6 | ||||
-rwxr-xr-x | tests/instfail-java.test | 6 | ||||
-rwxr-xr-x | tests/instmany-mans.test | 10 | ||||
-rwxr-xr-x | tests/instmany-python.test | 6 | ||||
-rwxr-xr-x | tests/instmany.test | 14 | ||||
-rwxr-xr-x | tests/missing5.test | 6 | ||||
-rwxr-xr-x | tests/parallel-am2.test | 8 | ||||
-rwxr-xr-x | tests/parallel-am3.test | 8 | ||||
-rwxr-xr-x | tests/pr307.test | 6 |
14 files changed, 86 insertions, 71 deletions
@@ -1,5 +1,25 @@ 2011-07-16 Stefano Lattarini <stefano.lattarini@gmail.com> + tests: more uses of the 'unindent' subroutine + * tests/backcompat.test: Prefer `unindent' over plain `cat' for + here documents created from within a loop of if/else body. + * tests/backcompat2.test: Likewise. + * tests/backcompat4.test: Likewise. + * tests/init.test: Likewise. + * tests/instmany.test: Likewise. + * tests/instmany-mans.test: Likewise. + * tests/instmany-python.test: Likewise. + * tests/missing5.test: Likewise. + * tests/parallel-am2.test : Likewise. + * tests/parallel-am3.test : Likewise. + * tests/pr307.test: Likewise. + * tests/depend4.test: Likewise. Since we are at it, normalize + other code formatting. + * tests/instfail-java.test: Prefer `echo' over `cat' + here-doc + inside a for loop. + +2011-07-16 Stefano Lattarini <stefano.lattarini@gmail.com> + tests: avoid '##'-style comments inside recipe commands * tests/autodist.test: Do not whitespace-indent `##' comments when they are embedded in a makefile rule: having them indented is not diff --git a/tests/backcompat.test b/tests/backcompat.test index 9d748f7f6..0acb77b9a 100755 --- a/tests/backcompat.test +++ b/tests/backcompat.test @@ -46,11 +46,11 @@ END for ac_init in 'AC_INIT' 'AC_INIT([Makefile.am])'; do for am_extra_args in '' ', []' ', [:]' ', [false]'; do rm -rf autom4te*.cache config* Makefile.in Makefile - cat > configure.in <<END -$ac_init -AM_INIT_AUTOMAKE([FooBar], [0.7.1]$am_extra_args) -AC_CONFIG_FILES([Makefile]) -AC_OUTPUT + unindent > configure.in <<END + $ac_init + AM_INIT_AUTOMAKE([FooBar], [0.7.1]$am_extra_args) + AC_CONFIG_FILES([Makefile]) + AC_OUTPUT END cat configure.in # might be useful for debugging $ACLOCAL diff --git a/tests/backcompat2.test b/tests/backcompat2.test index 5be6aec47..d1d3520f2 100755 --- a/tests/backcompat2.test +++ b/tests/backcompat2.test @@ -32,11 +32,11 @@ cat > config.h.in <<'END' END for am_arg3 in ':' 'false' '#' ' '; do - cat > configure.in <<END -AC_INIT -AC_CONFIG_HEADERS([config.h]) -AM_INIT_AUTOMAKE([pkgname], [pkgversion], [$am_arg3]) -AC_OUTPUT + unindent > configure.in <<END + AC_INIT + AC_CONFIG_HEADERS([config.h]) + AM_INIT_AUTOMAKE([pkgname], [pkgversion], [$am_arg3]) + AC_OUTPUT END cat configure.in # might be useful for debugging $AUTOCONF @@ -53,11 +53,11 @@ END done for am_extra_args in '' ',' ', []'; do - cat > configure.in <<END -AC_INIT -AC_CONFIG_HEADERS([config.h]) -AM_INIT_AUTOMAKE([pkgname], [pkgversion]$am_extra_args) -AC_OUTPUT + unindent > configure.in <<END + AC_INIT + AC_CONFIG_HEADERS([config.h]) + AM_INIT_AUTOMAKE([pkgname], [pkgversion]$am_extra_args) + AC_OUTPUT END cat configure.in # might be useful for debugging $AUTOCONF diff --git a/tests/backcompat4.test b/tests/backcompat4.test index 97f0e8c45..e4432eb97 100755 --- a/tests/backcompat4.test +++ b/tests/backcompat4.test @@ -40,21 +40,21 @@ for args in \ 'foo:foo1.in:foo2.in:sub/bar.in:foo3.in' \ ; do rm -rf autom4te*.cache aclocal.m4 - cat >configure.in <<END -AC_INIT([$me], [1.0]) -AM_INIT_AUTOMAKE -AC_CONFIG_FILES([$args]) -AC_OUTPUT + unindent >configure.in <<END + AC_INIT([$me], [1.0]) + AM_INIT_AUTOMAKE + AC_CONFIG_FILES([$args]) + AC_OUTPUT END cat configure.in # for debugging $ACLOCAL $AUTOMAKE Makefile mv -f Makefile.in Makefile.acf rm -rf autom4te*.cache aclocal.m4 - cat >configure.in <<END -AC_INIT([$me], [1.0]) -AM_INIT_AUTOMAKE -AC_OUTPUT([$args]) + unindent >configure.in <<END + AC_INIT([$me], [1.0]) + AM_INIT_AUTOMAKE + AC_OUTPUT([$args]) END cat configure.in # for debugging $ACLOCAL diff --git a/tests/depend4.test b/tests/depend4.test index b1ca76eee..1dd782d3e 100755 --- a/tests/depend4.test +++ b/tests/depend4.test @@ -23,15 +23,14 @@ echo AC_PROG_CC >> configure.in $ACLOCAL headers= -for header in one.h two.h three.h four.h five.h six.h -do - headers="$headers $header" - cat > Makefile.am << END -bin_PROGRAMS = fred -fred_SOURCES = fred1.c $headers +for header in one.h two.h three.h four.h five.h six.h; do + headers="$headers $header" + unindent > Makefile.am << END + bin_PROGRAMS = fred + fred_SOURCES = fred1.c $headers END - - $AUTOMAKE - - test 1 = `grep '^@AMDEP_TRUE@@am__include@' Makefile.in | wc -l` + $AUTOMAKE + test 1 = `grep '^@AMDEP_TRUE@@am__include@' Makefile.in | wc -l` done + +: diff --git a/tests/init.test b/tests/init.test index 0e2da06ad..625e8eb50 100755 --- a/tests/init.test +++ b/tests/init.test @@ -22,9 +22,9 @@ for ac_init_args in '' '([x])'; do for am_init_args in '' '([1.10])'; do rm -rf aclocal.m4 autom4te*.cache - cat >configure.in <<END -AC_INIT$ac_init_args -AM_INIT_AUTOMAKE$am_init_args + unindent >configure.in <<END + AC_INIT$ac_init_args + AM_INIT_AUTOMAKE$am_init_args END cat configure.in # might be useful for debugging # The error message should mention AC_INIT, not AC_PACKAGE_VERSION. diff --git a/tests/instfail-java.test b/tests/instfail-java.test index a584d647d..7daf387dd 100755 --- a/tests/instfail-java.test +++ b/tests/instfail-java.test @@ -32,11 +32,7 @@ java_JAVA = java1.java java2.java java3.java END for n in 1 2 3; do - cat >java$n.java <<END -class java$n -{ -} -END + echo "class java$n { }" >java$n.java done $ACLOCAL diff --git a/tests/instmany-mans.test b/tests/instmany-mans.test index 4a475c656..0462164e8 100755 --- a/tests/instmany-mans.test +++ b/tests/instmany-mans.test @@ -90,11 +90,11 @@ notrans_man3_MANS = END for n in $list; do - cat >>Makefile.am <<END -man_MANS += page$n.1 -man3_MANS += page$n.man -notrans_man_MANS += npage$n.1 -notrans_man3_MANS += npage$n.man + unindent >>Makefile.am <<END + man_MANS += page$n.1 + man3_MANS += page$n.man + notrans_man_MANS += npage$n.1 + notrans_man3_MANS += npage$n.man END echo >page$n.1 echo >page$n.man diff --git a/tests/instmany-python.test b/tests/instmany-python.test index 26a6b16dd..d0c742351 100755 --- a/tests/instmany-python.test +++ b/tests/instmany-python.test @@ -84,9 +84,9 @@ nobase_python_PYTHON = END for n in $list; do - cat >>Makefile.am <<END -python_PYTHON += python$n.py -nobase_python_PYTHON += npython$n.py + unindent >>Makefile.am <<END + python_PYTHON += python$n.py + nobase_python_PYTHON += npython$n.py END echo >python$n.py echo >npython$n.py diff --git a/tests/instmany.test b/tests/instmany.test index 5c55165b1..69c7e8631 100755 --- a/tests/instmany.test +++ b/tests/instmany.test @@ -100,13 +100,13 @@ nobase_include_HEADERS = END for n in $list; do - cat >>Makefile.am <<END -bin_SCRIPTS += script$n -nobase_bin_SCRIPTS += nscript$n -data_DATA += data$n -nobase_data_DATA += ndata$n -include_HEADERS += header$n.h -nobase_include_HEADERS += nheader$n.h + unindent >>Makefile.am <<END + bin_SCRIPTS += script$n + nobase_bin_SCRIPTS += nscript$n + data_DATA += data$n + nobase_data_DATA += ndata$n + include_HEADERS += header$n.h + nobase_include_HEADERS += nheader$n.h END echo >script$n echo >nscript$n diff --git a/tests/missing5.test b/tests/missing5.test index b618bd1ee..462aeb03d 100755 --- a/tests/missing5.test +++ b/tests/missing5.test @@ -35,9 +35,9 @@ AC_OUTPUT EOF for tool in $needed_tools; do - cat >$tool.in <<EOF -#! /bin/sh -exec @$tool@ "\$@" + unindent >$tool.in <<EOF + #! /bin/sh + exec @$tool@ "\$@" EOF done diff --git a/tests/parallel-am2.test b/tests/parallel-am2.test index 52dfde8fc..16b089fc9 100755 --- a/tests/parallel-am2.test +++ b/tests/parallel-am2.test @@ -37,10 +37,10 @@ for i in $list; do echo "AC_CONFIG_FILES([sub$i/Makefile])" >> configure.in echo "SUBDIRS += sub$i" >> Makefile.am mkdir sub$i sub$i/sub - cat > sub$i/Makefile.am << END -AUTOMAKE_OPTIONS = subdir-objects -bin_PROGRAMS = sub$i -sub${i}_SOURCES = sub/main$i.c + unindent > sub$i/Makefile.am << END + AUTOMAKE_OPTIONS = subdir-objects + bin_PROGRAMS = sub$i + sub${i}_SOURCES = sub/main$i.c END done diff --git a/tests/parallel-am3.test b/tests/parallel-am3.test index 932dea40f..9918edff1 100755 --- a/tests/parallel-am3.test +++ b/tests/parallel-am3.test @@ -43,10 +43,10 @@ for i in $list; do echo "AC_CONFIG_FILES([sub$i/Makefile])" >> configure.in echo "SUBDIRS += sub$i" >> Makefile.am mkdir sub$i - cat > sub$i/Makefile.am <<END -python_PYTHON = foo$i.py -lisp_LISP = foo$i.el -bin_PROGRAMS = p$i + unindent > sub$i/Makefile.am <<END + python_PYTHON = foo$i.py + lisp_LISP = foo$i.el + bin_PROGRAMS = p$i END done diff --git a/tests/pr307.test b/tests/pr307.test index 3db9f854c..ea2515171 100755 --- a/tests/pr307.test +++ b/tests/pr307.test @@ -57,9 +57,9 @@ END : >foo.h for i in a b c d e f g h; do - cat >$i.c <<EOF -#include "foo.h" -int $i() { return 0; } + unindent >$i.c <<EOF + #include "foo.h" + int $i () { return 0; } EOF done |