]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
tests: more uses of the 'unindent' subroutine
authorStefano Lattarini <stefano.lattarini@gmail.com>
Sat, 16 Jul 2011 08:37:55 +0000 (10:37 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Sat, 16 Jul 2011 10:32:52 +0000 (12:32 +0200)
* 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.

14 files changed:
ChangeLog
tests/backcompat.test
tests/backcompat2.test
tests/backcompat4.test
tests/depend4.test
tests/init.test
tests/instfail-java.test
tests/instmany-mans.test
tests/instmany-python.test
tests/instmany.test
tests/missing5.test
tests/parallel-am2.test
tests/parallel-am3.test
tests/pr307.test

index 3688e3b47c2da78a873d171b669a9ba6969f5198..41acf614c9cf8c4b4c57232f22289e60ee2a5304 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,23 @@
+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
index 9d748f7f6a03fdb5434a96abdd5602c54fda5e9a..0acb77b9ae667fb38c9814fc7f10a4ff327717a6 100755 (executable)
@@ -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
index 5be6aec477410d292932de73dc9951a068262ce5..d1d3520f27f9bf8e3d46c9966b29b023017a8f1d 100755 (executable)
@@ -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
index 97f0e8c451880d77680343a5503c7d6a9320e6d0..e4432eb97f7749c44fb269553641bcc7bbf16ee3 100755 (executable)
@@ -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
index b1ca76eee233be97023cd0a39a89111b40a3099f..1dd782d3ecad5937f0028291ffe762e809064ac7 100755 (executable)
@@ -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
+
+:
index 0e2da06ad5d665f9af82a50356a1760c966b23c3..625e8eb508afc343c4860a72f5aa724347cf4389 100755 (executable)
@@ -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.
index a584d647d40627550c94e6c09f4844e0b793549f..7daf387dd09fa0b0a016d9456914401ef5c714e0 100755 (executable)
@@ -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
index 4a475c656dcb8f0b5ef7d13fe972e14f3a835f28..0462164e88de1bac0df0d5f0a268b7775aa32001 100755 (executable)
@@ -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
index 26a6b16dd9ac4ae671edef0731625ac44ef96044..d0c742351616722f9bad64afcda9a7f5c29ac677 100755 (executable)
@@ -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
index 5c55165b19300c67ba41204a6e0dcf0717191831..69c7e86317808960fc3585fa15e64a6b6d293bd5 100755 (executable)
@@ -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
index b618bd1ee08af53d4d440f3d367b87d847480d65..462aeb03d1a09ab465f62fc9a84f928a8f962e61 100755 (executable)
@@ -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
 
index 52dfde8fc3edcb468396511595ad8b0765d6af1f..16b089fc9d8a0a69250263e92b513993cda13ce6 100755 (executable)
@@ -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
 
index 932dea40fb328a6c9ade6b8fd48e5338f31a7717..9918edff18108b136f9da82babf1f600a7ff117d 100755 (executable)
@@ -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
 
index 3db9f854cf582222459640f6467b884bee05007e..ea25151710a1aa3498bd0d0ee64998b2d34ee38e 100755 (executable)
@@ -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