When gcc coverage instrumentation is used, these tests hang. They work
with clang coverage instrumentation, but for some reason clang does not
give us full reports (at least not when used together with CodeCov.io).
We have tried to troubleshoot this for hours and hours - now is time to
give up until someone comes up with a bright idea. So we make the affected
tests skip themselves when they detect gcc with coverage instrumentation.
Make the test program explicitly flush lines written to stdout and
stderr, and do not use stdbuf to force line buffering for stdout.
In Python 2 stderr was unbuffered, but in Python 3 it is block-buffered
when redirected to a file/pipe. Besides, stdbuf seems to have no effect
on Python 3.
This solves one of the problems with this test described in #3361.
The problem ocurred with Python 3 and after the addition of the
wait_file_lines check in v8.40.0. The buffering that Python did caused
the last two lines of the output file to be written at shutdown time.
Other minor fixes and consistency enhancements in other omprog tests.
Also now permit interactivly running tests without explicitly setting
$srcdir. This now works if we are inside ./tests and fails, as before,
when we are in a different directory.
Detected by shellcheck via CodeFactor.io
Restart the program if it does not respond within timeout.
New setting 'confirmTimeout' (default 10 seconds).
Allow the program to provide keep-alive feedback when a
message requires long-running processing.
Improve efficiency when reading feedback line (use buffer).
Retry interrupted writes/reads to/from pipe.
New setting 'reportFailures' for reporting error messages
from the program.
Report child termination when writing to pipe.
Minor refactor: renamed writePipe function to sendMessage,
renamed readPipe to readStatus.