The Automake test suite
-
User interface
==============
-
Running the tests
-----------------
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
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
--- /dev/null
+#! /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