bug-automake
[Top][All Lists]
Advanced

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

bug#70638: [PATCH] doc: Put test-driver option args in separate words, n


From: Mark Wooding
Subject: bug#70638: [PATCH] doc: Put test-driver option args in separate words, not joined with `='
Date: Tue, 30 Apr 2024 00:06:39 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)

Karl Berry <karl@freefriends.org> writes:

> Hi Mark - thanks for the report.
>
>     it seems to me that the least bad approach is to correct the
>     documentation and usage messages to describe it accurately, with a
>     historical note in the manual explaining the long-standing error in
>     previous versions of the documentation.
>
> I agree. Would you be up for writing a draft patch? Given the research
> you've already done to send this report, you're certainly more familiar
> with the relevant places than me (by several miles :).

Sure, I can give that a try.

------8<------8<------8<------8<------8<------8<------8<------8<------

This addresses #70638.  As now mentioned in the manual, the description
of the test-driver command-line interface has been wrong since 2011 when
it was first added.  The manual, and the driver usage messages
themselves, have consistently shown option arguments joined to the
option name with `=' characters, while the implementation of Automake
has always provided option arguments in the following argument word, and
the provided test drivers only accepted option arguments in the
following argument word.

Because Automake has never used the `=' syntax, there can't possibly be
a working driver which actually follows the specification as written, so,
despite the fierce language of the manual, we agreed that changing the
specification was the right approach.  The `test-driver' program's usage
message has already been fixed (#22445), but the full extent of the
problem wasn't noticed at that time.

So...

* doc/automake.texi (Command-line arguments for test drivers): Fix the
table of options to show arguments passed as separate words; add
footnote explaining this rather sorry situation.
* doc/automake.texi (Use TAP with the Automake test harness): Remove `='
from documentation of `--diagnostic-string', because that was never
acceptable either.
* lib/tap-driver.sh: Fix usage message.
* contrib/tap-driver.pl: Change usage message to match the defined
protocol.  (This implementation parses options using Perl's
`GetOpt::Long' module, so it accepts the `=' syntax as specified, but
this program isn't actually used.)

Signed-off-by: Mark Wooding <mdw@distorted.org.uk>
---
 contrib/tap-driver.pl |  8 ++++----
 doc/automake.texi     | 22 ++++++++++++++--------
 lib/tap-driver.sh     |  8 ++++----
 3 files changed, 22 insertions(+), 16 deletions(-)

diff --git a/contrib/tap-driver.pl b/contrib/tap-driver.pl
index c48593984..787741e38 100755
--- a/contrib/tap-driver.pl
+++ b/contrib/tap-driver.pl
@@ -38,10 +38,10 @@ my $ME = "tap-driver.pl";
 
 my $USAGE = <<'END';
 Usage:
-  tap-driver --test-name=NAME --log-file=PATH --trs-file=PATH
-             [--expect-failure={yes|no}] [--color-tests={yes|no}]
-             [--enable-hard-errors={yes|no}] [--ignore-exit]
-             [--diagnostic-string=STRING] [--merge|--no-merge]
+  tap-driver --test-name NAME --log-file PATH --trs-file PATH
+             [--expect-failure {yes|no}] [--color-tests {yes|no}]
+             [--enable-hard-errors {yes|no}] [--ignore-exit]
+             [--diagnostic-string STRING] [--merge|--no-merge]
              [--comments|--no-comments] [--] TEST-COMMAND
 The '--test-name', '--log-file' and '--trs-file' options are mandatory.
 END
diff --git a/doc/automake.texi b/doc/automake.texi
index d30905e0f..a9fa601da 100644
--- a/doc/automake.texi
+++ b/doc/automake.texi
@@ -10125,34 +10125,40 @@ A custom driver can rely on various command-line 
options and arguments
 being passed to it automatically by the Automake-generated test harness.
 It is @emph{mandatory} that it understands all of them (even if the exact
 interpretation of the associated semantics can legitimately change
-between a test driver and another, and even be a no-op in some drivers).
+between a test driver and another, and even be a no-op in some
+drivers).@footnote{Regrettably, older versions of this manual stated that
+option arguments should be joined to their options with a @code{=}
+character, rather than passed as in the following argument word as shown
+here.  The syntax with @code{=} has never been accepted by the test drivers
+supplied with Automake, and has never been produced by @file{Makefile}s
+generated by Automake.}
 
 @noindent
 Here is the list of options:
 
 @table @option
-@item --test-name=@var{NAME}
+@item --test-name @var{NAME}
 The name of the test, with VPATH prefix (if any) removed.  This can have a
 suffix and a directory component (as in e.g., @file{sub/foo.test}), and is
 mostly meant to be used in console reports about testsuite advancements and
 results (@pxref{Testsuite progress output}).
-@item --log-file=@file{@var{PATH}.log}
+@item --log-file @file{@var{PATH}.log}
 The @file{.log} file the test driver must create (@pxref{Basics of
 test metadata}).  If it has a directory component (as in e.g.,
 @file{sub/foo.log}), the test harness will ensure that such directory
 exists @emph{before} the test driver is called.
-@item --trs-file=@file{@var{PATH}.trs}
+@item --trs-file @file{@var{PATH}.trs}
 The @file{.trs} file the test driver must create (@pxref{Basics of
 test metadata}).  If it has a directory component (as in e.g.,
 @file{sub/foo.trs}), the test harness will ensure that such directory
 exists @emph{before} the test driver is called.
-@item --color-tests=@{yes|no@}
+@item --color-tests @{yes|no@}
 Whether the console output should be colorized or not (@pxref{Simple
 tests and color-tests}, to learn when this option gets activated and
 when it doesn't).
-@item --expect-failure=@{yes|no@}
+@item --expect-failure @{yes|no@}
 Whether the tested program is expected to fail.
-@item --enable-hard-errors=@{yes|no@}
+@item --enable-hard-errors @{yes|no@}
 Whether ``hard errors'' in the tested program should be treated differently
 from normal failures or not (the default should be @code{yes}).  The exact
 meaning of ``hard error'' is highly dependent from the test protocols or
@@ -10378,7 +10384,7 @@ harness to get confused if anything that appears on 
standard error
 looks like a test result.
 @item --no-merge
 Revert the effects of @option{--merge}.
-@item --diagnostic-string=@var{STRING}
+@item --diagnostic-string @var{STRING}
 Change the string that introduces TAP diagnostics from the default value
 of ``@code{#}'' to @code{@var{STRING}}.  This can be useful if your
 TAP-based test scripts produce verbose output on which they have limited
diff --git a/lib/tap-driver.sh b/lib/tap-driver.sh
index f16f44df3..69121683a 100755
--- a/lib/tap-driver.sh
+++ b/lib/tap-driver.sh
@@ -48,10 +48,10 @@ print_usage ()
 {
   cat <<END
 Usage:
-  tap-driver.sh --test-name=NAME --log-file=PATH --trs-file=PATH
-                [--expect-failure={yes|no}] [--color-tests={yes|no}]
-                [--enable-hard-errors={yes|no}] [--ignore-exit]
-                [--diagnostic-string=STRING] [--merge|--no-merge]
+  tap-driver.sh --test-name NAME --log-file PATH --trs-file PATH
+                [--expect-failure {yes|no}] [--color-tests {yes|no}]
+                [--enable-hard-errors {yes|no}] [--ignore-exit]
+                [--diagnostic-string STRING] [--merge|--no-merge]
                 [--comments|--no-comments] [--] TEST-COMMAND
 The '--test-name', '-log-file' and '--trs-file' options are mandatory.
 END
-- 
[mdw]





reply via email to

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