* tests/autotest.at (AT@&t@_COPYRIGHT): New test.
* tests/base.at (AC@&t@_COPYRIGHT): Likewise.
Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2010-06-08 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+ Testsuite coverage for AC_COPYRIGHT and AT_COPYRIGHT.
+ * tests/autotest.at (AT@&t@_COPYRIGHT): New test.
+ * tests/base.at (AC@&t@_COPYRIGHT): Likewise.
+
Testsuite coverage for __file__ and __line__.
* tests/m4sugar.at (__file__ and __line__): New test.
])
+## -------------- ##
+## AT_COPYRIGHT. ##
+## -------------- ##
+
+# Ensure the FSF notice as well as the user-provided one are present
+# in the head of the testsuite as well as the --version output.
+
+AT_CHECK_AT([AT@&t@_COPYRIGHT],
+[[AT_INIT([Testing AT@&t@_COPYRIGHT])
+AT_COPYRIGHT([[This is just a test notice, not a real one, so let's avoid
+words that may be matched by scanners for legal things,
+causing extra work for distributors.
+Multi-line values should be supported.
+]])
+]], [], [], [stdout], [], [], [
+AT_CHECK([grep 'Copyright.*Free Software Foundation' stdout], [], [ignore])
+AT_CHECK([grep 'This is just a test notice' stdout], [], [ignore])
+AT_CHECK([sed 50q micro-suite | grep 'Copyright.*Free Software Foundation'],
+ [], [ignore])
+AT_CHECK([sed 50q micro-suite | grep 'This is just a test notice'],
+ [], [ignore])],
+[--version])
+
+
## ------------------ ##
## Empty test suite. ##
## ------------------ ##
AT_CLEANUP
+## -------------- ##
+## AC_COPYRIGHT. ##
+## -------------- ##
+
+# Ensure the FSF notice as well as the user-provided one are present
+# in the head of the testsuite as well as the --version output.
+
+AT_SETUP([AC@&t@_COPYRIGHT])
+
+AT_DATA([configure.ac],
+[[AC_INIT([GNU fu], [1.0])
+AC_COPYRIGHT([[This is just a test notice, not a real one, so let's avoid
+words that may be matched by scanners for legal things,
+causing extra work for distributors.
+Multi-line values should be supported.
+]])
+]])
+
+AT_CHECK_AUTOCONF
+AT_CHECK_CONFIGURE([--version], [], [stdout])
+AT_CHECK([grep 'Copyright.*Free Software Foundation' stdout], [], [ignore])
+AT_CHECK([grep 'This is just a test notice' stdout], [], [ignore])
+AT_CHECK([sed -ne 50q -e '/Copyright/{' -e N -e N -e N -e N -e 's/#//g' ]dnl
+ [ -e 's/\n//g' -e p -e '}' configure ]dnl
+ [ | grep 'Copyright.*Free Software Foundation'],
+ [], [ignore])
+AT_CHECK([sed 50q configure | grep 'This is just a test notice'], [], [ignore])
+
+AT_CLEANUP
+
+
## ---------------- ##
## AC_CACHE_CHECK. ##
## ---------------- ##