bug-groff
[Top][All Lists]
Advanced

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

[bug #62506] do-not-seek-the-unseekable.sh: should check for controlling


From: G. Branden Robinson
Subject: [bug #62506] do-not-seek-the-unseekable.sh: should check for controlling terminal
Date: Wed, 25 May 2022 22:57:38 -0400 (EDT)

Update of bug #62506 (project groff):

                 Summary: do-not-seek-the-unseekable.sh: result depends on
"make -j<n>" => do-not-seek-the-unseekable.sh: should check for controlling
terminal

    _______________________________________________________

Follow-up Comment #10:


[comment #8 comment #8:]
>   The failing part of the "preconv" test is the line
> 
> test -c /dev/stdin || exit 77 # skip

Bjarni, that's not a failure.  77 is the exit status used to signal the
Automake test harness that a test is being skipped.

That's why the word "skip" is adjacent to it in a comment.

> (In my case with "make -j2", "test -c /dev/stdin" says "not a character
> device".)

It sounds like you have a non-conforming implementation of the "test" command,
then.  The POSIX standard does not countenance this command writing any
messages. 
https://pubs.opengroup.org/onlinepubs/9699919799.2018edition/utilities/test.html
 
>   Changing this test from "-c" to "-e" results in the script ending
> with PASS, because the error output of "preconv" contains the text
> "stream is not seekable".

Changing the test(1) command's argument from "-c" to "-e" defeats the point of
the subsequent test.

As I attempted to explain in comment #5, the check that follows "test -c"
exercises the code path added in the quoted commit message.

Here is the code path in question. 
https://git.savannah.gnu.org/cgit/groff.git/tree/src/preproc/preconv/preconv.cpp#n1109
 
>   "/dev/stdin" needs only to exist to continue the script otherwise if
> the test were absent:
> 
> printf '\n' | ./preconv -d /dev/empty

The point is not to run as much of the shell script as possible no matter how
the host environment is configured, but _to test the software_.

>   shows
> 
> ./preconv: error: can't open '/dev/empty': No such file or directory

The test script as it exists in the groff tree does not attempt to open
/dev/empty.  I don't understand what your counterfactual establishes apart
from a failure to understand why I've written it as I have.

> 
> results in "grep" not finding the "magic string" and "FAIL" would result
> before "preconv" could actually do anything.
> 
> N.B.
> 
>   And testing with "make -j2" and even different arguments to '-j'
> reveals something.
> 
>   The actual test is weather "stream is not seekable" is in the error
> output of "preconv".  PASS is the result if it is.
> 
>   The error message from "preconv" lacks information about __FILE__ and
> __LINE__.

Why is this information necessary?  "Because we should always put this
information in every diagnostic" is a non-starter argument and will get us
nowhere.  That assertion is not the case.  Reporting a location in source code
is not useful to a person who lacks the skill or intention to examine said
source code.

I've resolved this issue as far as I intend to, but I welcome _new_
information being brought to light.


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?62506>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

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