automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[FYI] {testsuite-work} tests: more uses of the 'unindent' subroutine


From: Stefano Lattarini
Subject: [FYI] {testsuite-work} tests: more uses of the 'unindent' subroutine
Date: Sat, 16 Jul 2011 14:00:22 +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.
---
 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 3688e3b..41acf61 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,25 @@
 2011-07-16  Stefano Lattarini  <address@hidden>
 
+       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  <address@hidden>
+
        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 9d748f7..0acb77b 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 5be6aec..d1d3520 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 97f0e8c..e4432eb 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 b1ca76e..1dd782d 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 'address@hidden@@am__include@' Makefile.in | wc -l`
+  $AUTOMAKE
+  test 1 = `grep 'address@hidden@@am__include@' Makefile.in | wc -l`
 done
+
+:
diff --git a/tests/init.test b/tests/init.test
index 0e2da06..625e8eb 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 a584d64..7daf387 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 4a475c6..0462164 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 26a6b16..d0c7423 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 5c55165..69c7e86 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 b618bd1..462aeb0 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 52dfde8..16b089f 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 932dea4..9918edf 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 3db9f85..ea25151 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
 
-- 
1.7.2.3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]