From 0933a8cae4c508c19ad9348fb0aa24354bca9207 Mon Sep 17 00:00:00 2001 From: Stefano Lattarini Date: Sat, 16 Jul 2011 10:37:55 +0200 Subject: [PATCH] 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. --- ChangeLog | 20 ++++++++++++++++++++ tests/backcompat.test | 10 +++++----- tests/backcompat2.test | 20 ++++++++++---------- tests/backcompat4.test | 18 +++++++++--------- tests/depend4.test | 19 +++++++++---------- tests/init.test | 6 +++--- tests/instfail-java.test | 6 +----- tests/instmany-mans.test | 10 +++++----- tests/instmany-python.test | 6 +++--- tests/instmany.test | 14 +++++++------- tests/missing5.test | 6 +++--- tests/parallel-am2.test | 8 ++++---- tests/parallel-am3.test | 8 ++++---- tests/pr307.test | 6 +++--- 14 files changed, 86 insertions(+), 71 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3688e3b47..41acf614c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,23 @@ +2011-07-16 Stefano Lattarini + + 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 tests: avoid '##'-style comments inside recipe commands 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 < configure.in < config.h.in <<'END' END for am_arg3 in ':' 'false' '#' ' '; do - cat > configure.in < configure.in < configure.in < configure.in <configure.in <configure.in <configure.in <configure.in <> 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 <configure.in <java$n.java <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 <>Makefile.am <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 <>Makefile.am <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 <>Makefile.am <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 <$tool.in <> 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 < sub$i/Makefile.am <foo.h for i in a b c d e f g h; do - cat >$i.c <$i.c <