I am using testscript to test the behaviour of a program that is not intended to terminate in production. I would like to examine its output while running for a period, but it is not possible to obtain stdout/stderr until a background exec has terminated. To achieve this I would like to be able to
cmd &name&
sleep 1s
kill name
wait name # depending on implementation of kill this may or may not be necessary.
stdout <pattern>
stderr <pattern>
I am able to add the sleep, but access to the exec's termination details are not exposed, so the script cannot terminate the exec unless invoking stop, which would defeat the test.
I am using testscript to test the behaviour of a program that is not intended to terminate in production. I would like to examine its output while running for a period, but it is not possible to obtain stdout/stderr until a background exec has terminated. To achieve this I would like to be able to
I am able to add the
sleep
, but access to the exec's termination details are not exposed, so the script cannot terminate the exec unless invokingstop
, which would defeat the test.