autoconf-patches
[Top][All Lists]
Advanced

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

[PATCH] Actually test that @configure_input@ is expanded correctly.


From: Ralf Wildenhues
Subject: [PATCH] Actually test that @configure_input@ is expanded correctly.
Date: Sun, 2 Mar 2008 13:15:40 +0100
User-agent: Mutt/1.5.17+20080114 (2008-01-14)

* tests/torture.at (AC_CONFIG_FILES, HEADERS, LINKS and COMMANDS):
Actually check generated file contents for the name of the
generated file, using AC_PROG_FGREP and $FGREP.

Signed-off-by: Ralf Wildenhues <address@hidden>
---

This patch checks that the contents of the generated --file or --header
contain the right file name, by putting @configure_input@ in the input
file.  Since fgrep was the easiest to use, I used the somewhat tricky
way to let the configure script compute $FGREP, and use that result
later for the check.

Cheers,
Ralf

 ChangeLog        |    7 +++++++
 tests/torture.at |   16 ++++++++++------
 2 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index b247fd4..4ff1a7c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2008-03-02  Ralf Wildenhues  <address@hidden>
+
+       Actually test that @configure_input@ is expanded correctly.
+       * tests/torture.at (AC_CONFIG_FILES, HEADERS, LINKS and COMMANDS):
+       Actually check generated file contents for the name of the
+       generated file, using AC_PROG_FGREP and $FGREP.
+
 2008-03-01  Benoit Sigoure  <address@hidden>
 
        Be nice with file systems that don't handle unusual characters.
diff --git a/tests/torture.at b/tests/torture.at
index 0eaea17..ec86e22 100644
--- a/tests/torture.at
+++ b/tests/torture.at
@@ -134,6 +134,7 @@ AT_SETUP([[AC_CONFIG_FILES, HEADERS, LINKS and COMMANDS]])
 
 AT_DATA([configure.ac],
 [[AC_INIT
+AC_PROG_FGREP
 rm -f -r header var-header file var-file link var-link command var-command
 echo 'OK' >input
 
@@ -262,23 +263,27 @@ AT_CHECK_CONFIG_CREATION_NOWRITE(link)
 AT_CHECK([grep ac_write_fail config.status], [1])
 
 # Check that --file and --header accept funny file names
+AT_DATA([fgrep.in],
+[[FGREP="@FGREP@"
+]])
+./config.status --file=fgrep:fgrep.in
+. ./fgrep
 
 x=
 export x
 for file in \
   'with  funny '\'' $x & #! name' \
   'file with  funny \ '\'' \'\'' $ & #!*? name' \
-  'with  funny \ '\'' \'\'' " <a >b & * ? name ' # "restore font-lock
+  'with  funny \ '\'' \'\'' " | <a >b & * ? name ' # "restore font-lock
 do
   # The function func_sanitize_file_name comes from tools.at
   file=`func_sanitize_file_name "$file"`
   cat >"$file.in" <<'END'
-OK
address@hidden@
 END
   AT_CHECK([./config.status "--file=$file:$file.in"],
           [0], [ignore])
-  AT_CHECK([grep OK "$file"], [], [OK
-])
+  AT_CHECK([$FGREP "$file" "$file"], [0], [ignore])
   AT_CHECK([./config.status "--header=$file:$file.in"],
           [0], [ignore])
   # Run the same test a 2nd time to see that config.status does not recreate
@@ -290,8 +295,7 @@ config.status: $file is unchanged
   AT_CHECK_NOESCAPE([grep ' & ' "$file"], [],
 [/* $file.  Generated from $file.in by configure.  */
 ])
-  AT_CHECK([grep OK "$file"], [], [OK
-])
+  AT_CHECK([$FGREP "$file" "$file"], [0], [ignore])
 done
 AT_CLEANUP
 
-- 
1.5.4.rc5.2.g3ed9a





reply via email to

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