automake-commit
[Top][All Lists]
Advanced

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

[automake-commit] branch master updated: tests: add test for new posix o


From: Karl Berry
Subject: [automake-commit] branch master updated: tests: add test for new posix option.
Date: Fri, 06 Oct 2023 11:28:29 -0400

This is an automated email from the git hooks/post-receive script.

karl pushed a commit to branch master
in repository automake.

View the commit online:
https://git.savannah.gnu.org/gitweb/?p=automake.git;a=commitdiff;h=b2d0fee3dd00906805cf97a6de21fc0fe6dfdc5b

The following commit(s) were added to refs/heads/master by this push:
     new b2d0fee3d tests: add test for new posix option.
b2d0fee3d is described below

commit b2d0fee3dd00906805cf97a6de21fc0fe6dfdc5b
Author: Karl Berry <karl@freefriends.org>
AuthorDate: Fri Oct 6 08:28:19 2023 -0700

    tests: add test for new posix option.
    
    See https://bugs.gnu.org/55025.
    
    * t/posixtarget.sh: New test.
    * t/list-of-tests.mk (handwritten_tests): Add it.
    * t/README: mention using existing tests as a basis.
---
 t/README           | 13 +++++++++----
 t/list-of-tests.mk |  1 +
 t/posixtarget.sh   | 43 +++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 53 insertions(+), 4 deletions(-)

diff --git a/t/README b/t/README
index 16096ca7b..4772c0be2 100644
--- a/t/README
+++ b/t/README
@@ -1,10 +1,8 @@
                            The Automake test suite
 
-
 User interface
 ==============
 
-
 Running the tests
 -----------------
 
@@ -117,10 +115,18 @@ Reporting failures
 Writing test cases
 ==================
 
+* See also summary information in the top-level HACKING file.
+
 * If you plan to fix a bug, write the test case first.  This way you'll
   make sure the test catches the bug, and that it succeeds once you have
   fixed the bug.
 
+* Sometimes it is better to add to an existing test than to write a new one.
+  In any case, it is good to look for existing tests checking for
+  something related, and use one or more them as a starting point.
+  The posixtarget test is a nearly-minimal test if you end up starting
+  from scratch.
+
 * Add a copyright/license paragraph.
 
 * Explain what the test does, i.e., which features it checks, which
@@ -142,8 +148,7 @@ Writing test cases
   tools which can be taken for granted because they're listed in the
   GNU Coding Standards (for example, 'gzip').
 
-* Include 'test-init.sh' in every test script (see existing tests for
-  examples of how to do this).
+* Include 'test-init.sh' in every test script.
 
 * Use the 'skip_' function to skip tests, with a meaningful message if
   possible.  Where convenient, use the 'warn_' function to print generic
diff --git a/t/list-of-tests.mk b/t/list-of-tests.mk
index 94781d9b0..5c118b52d 100644
--- a/t/list-of-tests.mk
+++ b/t/list-of-tests.mk
@@ -872,6 +872,7 @@ t/pluseq8.sh \
 t/pluseq9.sh \
 t/pluseq10.sh \
 t/pluseq11.sh \
+t/posixtarget.sh \
 t/posixsubst-data.sh \
 t/posixsubst-extradist.sh \
 t/posixsubst-ldadd.sh \
diff --git a/t/posixtarget.sh b/t/posixtarget.sh
new file mode 100644
index 000000000..ffe7abd54
--- /dev/null
+++ b/t/posixtarget.sh
@@ -0,0 +1,43 @@
+#! /bin/sh
+# Copyright (C) 2023 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
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <https://www.gnu.org/licenses/>.
+
+# Check that the posix option is supported. See https://bugs.gnu.org/55025.
+
+. test-init.sh
+
+cat > configure.ac << 'END'
+AC_INIT([posixtest], [0.0])
+AM_INIT_AUTOMAKE([posix foreign])
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+# Some comment.
+random-target:
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+# .POSIX should be the first non-blank non-comment line.
+sed -e '/^$/d' -e '/^ *#/d' -e 1q | grep '^\.POSIX:' Makefile.in
+
+./configure
+# Although we aren't responsible for what autoconf does, check that the
+# result is as expected, since we're here.
+sed -e '/^$/d' -e '/^ *#/d' -e 1q | grep '^\.POSIX:' Makefile



reply via email to

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