[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Testsuite coverage for AC_COPYRIGHT and AT_COPYRIGHT.
From: |
Ralf Wildenhues |
Subject: |
Testsuite coverage for AC_COPYRIGHT and AT_COPYRIGHT. |
Date: |
Sun, 6 Jun 2010 13:49:07 +0200 |
User-agent: |
Mutt/1.5.20 (2009-10-28) |
The sed script in the second test was nontrivial to get right, but other
than that: OK now or after 2.66?
Thanks,
Ralf
Testsuite coverage for AC_COPYRIGHT and AT_COPYRIGHT.
* tests/autotest.at (AT@&address@hidden): New test.
* tests/base.at (AC@&address@hidden): Likewise.
diff --git a/tests/autotest.at b/tests/autotest.at
index 7267915..a09e2c1 100644
--- a/tests/autotest.at
+++ b/tests/autotest.at
@@ -135,6 +135,30 @@ m4_define([AT_CHECK_EGREP],
])
+## -------------- ##
+## 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@&address@hidden,
+[[AT_INIT([Testing AT@&address@hidden)
+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. ##
## ------------------ ##
diff --git a/tests/base.at b/tests/base.at
index c4b6273..042f16c 100644
--- a/tests/base.at
+++ b/tests/base.at
@@ -219,6 +219,37 @@ AT_CHECK([grep "^PACKAGE_TARNAME='fu'\$" configure], [],
[ignore])
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@&address@hidden)
+
+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. ##
## ---------------- ##
- Testsuite coverage for AC_COPYRIGHT and AT_COPYRIGHT.,
Ralf Wildenhues <=