summaryrefslogtreecommitdiff
path: root/tests/tools.at
diff options
context:
space:
mode:
authorDaniel Elstner <daniel.kitta@gmail.com>2016-12-21 17:15:46 +0100
committerEric Blake <eblake@redhat.com>2016-12-21 10:31:54 -0600
commit78ad1b0b2cea606bf401ed0262540b503db73e1c (patch)
tree752a1ccec918b31eb05bc0901c1bd758109d937f /tests/tools.at
parent0e2eecedb12dd472c9a008748be6edd6ea68fa0e (diff)
downloadautoconf-78ad1b0b2cea606bf401ed0262540b503db73e1c.tar.gz
autoheader: check templates of all config headers
* bin/autoheader.in: When checking for missing templates, take all config headers into account, not just the one generated by autoheader. This makes it possible to use AC_DEFINE() for secondary headers without duplicating the template into the first header. * tests/tools.at: Add a check for autoheader with multiple config headers. * NEWS: Document the new behavior. Message-Id: <1482336946.31331.2.camel@gmail.com> Signed-off-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'tests/tools.at')
-rw-r--r--tests/tools.at25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/tools.at b/tests/tools.at
index 4993b3f5..2592a209 100644
--- a/tests/tools.at
+++ b/tests/tools.at
@@ -860,6 +860,31 @@ config.h.in:0
AT_CLEANUP
+# autoheader should take all config header inputs into account when
+# checking for missing templates.
+AT_SETUP([autoheader with multiple headers])
+
+AT_DATA([config-extra.h.in],
+[[/* Define this to whatever you want. */
+#undef HANNA
+]])
+AT_DATA([configure.ac],
+[[AC_INIT
+AC_CONFIG_HEADERS([config.h config-extra.h])
+AC_DEFINE([HANNA], ["Hanna"])
+AC_DEFINE([SEAN], ["Sean"], [Sean's name])
+AC_OUTPUT
+]])
+
+AT_CHECK_AUTOCONF
+AT_CHECK_AUTOHEADER
+AT_CHECK([grep HANNA configure], [0], [ignore], [ignore])
+AT_CHECK([grep HANNA config.h.in], [1], [ignore], [ignore])
+AT_CHECK([grep SEAN configure], [0], [ignore], [ignore])
+AT_CHECK([grep SEAN config.h.in], [0], [ignore], [ignore])
+
+AT_CLEANUP
+
## ------------ ##