autoconf-patches
[Top][All Lists]
Advanced

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

Emit copyright notices in Autotest test suites


From: Noah Misch
Subject: Emit copyright notices in Autotest test suites
Date: Sun, 9 Jan 2005 19:15:47 -0800
User-agent: Mutt/1.5.6i

Autotest test suites do not have copyright notices in the script file header or
in --version.  This patch adds them by way of `AT_COPYRIGHT' and infrastructure
very similar to AC_COPYRIGHT.

I added an Autotest copyright notice very much like the `configure' copyright
notice, since lib/autotest/general.m4 bears the license exception.  Autoconf
licenses its own test suite under the GPL only, so local.at appends an
additional copyright notice for that.

I also updated the `configure' copyright notice to 2005 and added `(C)'.

All tests pass.

2005-01-09  Noah Misch  <address@hidden>

        * lib/autoconf/general.m4 (_AC_INIT_COPYRIGHT): Update for 2005.
        (AC_COPYRIGHT): Factor header comment portion out and move into...
        * lib/m4sugar/m4sh.m4 (AS_COPYRIGHT): This.
        * lib/autotest/general.at (AT_COPYRIGHT): New macro.
        (AT_INIT): Add Autotest copyright notice.  Display copyright notices in
        --version output.
        * tests/local.at: Add Autoconf test suite copyright notice.
        * doc/autoconf.texi (Writing testsuite.at): Document AT_COPYRIGHT.

diff -urp -X dontdiff ac-clean/doc/autoconf.texi ac-testcr/doc/autoconf.texi
--- ac-clean/doc/autoconf.texi  2005-01-03 07:02:43.000000000 -0500
+++ ac-testcr/doc/autoconf.texi 2005-01-09 21:45:05.723399838 -0500
@@ -15471,6 +15471,17 @@ the test suite always displays the packa
 inherits the package bug report address.
 @end defmac
 
address@hidden AT_COPYRIGHT (@var{copyright-notice})
address@hidden
address@hidden Copyright Notice
+State that, in addition to the Free Software Foundation's copyright on
+the Autotest macros, parts of your test suite are covered by
address@hidden
+
+The @var{copyright-notice} will show up in both the head of
address@hidden and in @samp{testsuite --version}.
address@hidden defmac
+
 @defmac AT_TESTED (@var{executables})
 @atindex{TESTED}
 Log the file name and answer to @option{--version} of each program in
diff -urp -X dontdiff ac-clean/lib/autoconf/general.m4 
ac-testcr/lib/autoconf/general.m4
--- ac-clean/lib/autoconf/general.m4    2005-01-04 09:15:49.000000000 -0500
+++ ac-testcr/lib/autoconf/general.m4   2005-01-09 20:59:21.370643789 -0500
@@ -262,18 +262,10 @@ m4_ifndef([AC_PACKAGE_BUGREPORT],
 
 # AC_COPYRIGHT(TEXT, [VERSION-DIVERSION = VERSION_USER])
 # ------------------------------------------------------
-# Append Copyright information in the top of `configure'.  TEXT is
-# evaluated once, hence TEXT can use macros.  Note that we do not
-# prepend `# ' but address@hidden:@ ', since m4 does not evaluate the comments.
-# Had we used `# ', the Copyright sent in the beginning of `configure'
-# would have not been evaluated.  Another solution, a bit fragile,
-# would have be to use m4_quote to force an evaluation:
-#
-#     m4_bpatsubst(m4_quote($1), [^], [# ])
+# Emit TEXT, a copyright notice, in the top of `configure' and in
+# --version output.  Macros in TEXT are expanded once.
 m4_define([AC_COPYRIGHT],
-[m4_divert_text([HEADER-COPYRIGHT],
-[m4_bpatsubst([
-$1], [^], address@hidden:@ ])])dnl
+[AS_COPYRIGHT([$1])[]dnl
 m4_divert_text(m4_default([$2], [VERSION_USER]),
 [
 $1])dnl
@@ -354,8 +346,8 @@ m4_ifset([AC_PACKAGE_BUGREPORT],
 # user copyrights, and after the setup of the --version handling.
 m4_define([_AC_INIT_COPYRIGHT],
 [AC_COPYRIGHT(
-[Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002,
-2003, 2004 Free Software Foundation, Inc.
+[Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
+2002, 2003, 2004, 2005 Free Software Foundation, Inc.
 This configure script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it.],
              [VERSION_FSF])dnl
diff -urp -X dontdiff ac-clean/lib/autotest/general.m4 
ac-testcr/lib/autotest/general.m4
--- ac-clean/lib/autotest/general.m4    2005-01-02 12:39:22.000000000 -0500
+++ ac-testcr/lib/autotest/general.m4   2005-01-09 21:58:48.623814093 -0500
@@ -1,6 +1,7 @@
 # This file is part of Autoconf.                          -*- Autoconf -*-
 # M4 macros used in building test suites.
-# Copyright (C) 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 Free Software
+# Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -74,6 +75,7 @@
 #    cases of a case statement.
 #  - PARSE_ARGS_END
 #    Finish up the option processing.
+#
 #  - HELP
 #    Start printing the help message.
 #  - HELP_MODES
@@ -86,6 +88,14 @@
 #    User help can be appended to this as self-contained cat'd here-docs.
 #  - HELP_END
 #    Finish up the help texts.
+#
+#  - VERSION
+#    Head of the handling of --version.
+#  - VERSION_NOTICES
+#    Copyright notices for --version.
+#  - VERSION_END
+#    Tail of the handling of --version.
+#
 #  - PREPARE_TESTS
 #    Like DEFAULTS but run after argument processing for purposes of
 #    optimization.  Do anything else that needs to be done to prepare for
@@ -107,6 +117,9 @@ m4_define([_m4_divert(HELP_MODES)],     
 m4_define([_m4_divert(HELP_TUNING)],        302)
 m4_define([_m4_divert(HELP_OTHER)],         303)
 m4_define([_m4_divert(HELP_END)],           304)
+m4_define([_m4_divert(VERSION)],            350)
+m4_define([_m4_divert(VERSION_NOTICES)],    351)
+m4_define([_m4_divert(VERSION_END)],        352)
 m4_define([_m4_divert(PREPARE_TESTS)],      400)
 m4_define([_m4_divert(TESTS)],              401)
 m4_define([_m4_divert(TESTS_END)],          402)
@@ -144,6 +157,11 @@ m4_define([AT_TESTSUITE_NAME],
 m4_define([AT_ordinal], 0)
 m4_define([AT_banner_ordinal], 0)
 AS_INIT
+AT_COPYRIGHT(
+[Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 Free Software
+Foundation, Inc.
+This test suite is free software; the Free Software Foundation gives
+unlimited permission to copy, distribute and modify it.])
 AS_PREPARE
 m4_divert_push([DEFAULTS])dnl
 
@@ -188,6 +206,8 @@ at_quiet=echo
 at_debug_p=false
 # Display help message?
 at_help_p=false
+# Display the version message?
+at_version_p=false
 # List test groups?
 at_list_p=false
 # Test groups to run
@@ -249,8 +269,7 @@ do
        ;;
 
     --version | -V )
-       echo "$as_me (AT_PACKAGE_STRING)"
-       exit 0
+       at_version_p=:
        ;;
 
     --clean | -c )
@@ -431,6 +450,16 @@ _ATEOF
   exit 0
 fi
 m4_divert_pop([HELP_END])dnl
+m4_divert_push([VERSION])dnl
+if $at_version_p; then
+  echo "$as_me (AT_PACKAGE_STRING)"
+  cat <<\_ACEOF
+m4_divert_pop([VERSION])dnl
+m4_divert_push([VERSION_END])dnl
+_ACEOF
+  exit 0
+fi
+m4_divert_pop([VERSION_END])dnl
 m4_divert_push([PREPARE_TESTS])dnl
 
 # Don't take risks: use only absolute directories in PATH.
@@ -1034,6 +1063,17 @@ m4_define([AT_TESTED],
 [m4_append_uniq([AT_tested], [$1], [ ])])
 
 
+# AT_COPYRIGHT(TEXT)
+# ------------------
+# Emit TEXT, a copyright notice, in the top of the test suite and in
+# --version output.  Macros in TEXT are expanded once.
+m4_define([AT_COPYRIGHT],
+[AS_COPYRIGHT([$1])[]dnl
+m4_divert_text([VERSION_NOTICES],
+[
+$1])])# AT_COPYRIGHT
+
+
 # AT_SETUP(DESCRIPTION)
 # ---------------------
 # Start a group of related tests, all to be executed in the same subshell.
diff -urp -X dontdiff ac-clean/lib/m4sugar/m4sh.m4 ac-testcr/lib/m4sugar/m4sh.m4
--- ac-clean/lib/m4sugar/m4sh.m4        2005-01-04 09:15:51.000000000 -0500
+++ ac-testcr/lib/m4sugar/m4sh.m4       2005-01-09 19:23:00.830209554 -0500
@@ -296,6 +296,17 @@ AS_IF([func_ret_failure],
 test $exitcode = 0])
 
 
+# AS_COPYRIGHT(TEXT)
+# ------------------
+# Emit TEXT, a copyright notice, as a shell comment near the top of the
+# script.  TEXT is expanded once; to accomplish that, we do not prepend
+# `# ' but address@hidden:@ '.
+m4_define([AS_COPYRIGHT],
+[m4_divert_text([HEADER-COPYRIGHT],
+[m4_bpatsubst([
+$1], [^], address@hidden:@ ])])])
+
+
 # AS_SHELL_SANITIZE
 # -----------------
 m4_defun([AS_SHELL_SANITIZE],
diff -urp -X dontdiff ac-clean/tests/local.at ac-testcr/tests/local.at
--- ac-clean/tests/local.at     2005-01-02 12:39:22.000000000 -0500
+++ ac-testcr/tests/local.at    2005-01-09 21:00:03.904958187 -0500
@@ -1,6 +1,7 @@
 # M4 macros used in building Autoconf test suites.        -*- Autotest -*-
 
-# Copyright (C) 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 Free Software
+# Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -391,3 +392,8 @@ AT_CLEANUP()dnl
 ## ----------------------- ##
 
 AT_INIT
+AT_COPYRIGHT(
+[Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 Free Software
+Foundation, Inc.
+This is free software; see the source for copying conditions.  There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."])




reply via email to

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