Hi Dirk,
On 03/08/2018 07:15 AM, Dirk Zimoch wrote:
Now I would like to add tests. Is there already support to compare shell
function output with expected output?
Where to put the test? I want to test the shell function as well as
channel access.
The easiest way to write that kind of test might be in Perl. There is a
Perl IOC module that can start an IOC as a sub-process, feed it iocsh
commands and return their responses, then shut down the IOC again. It
only works with Base-3.16 or later though since it has to be able to
disable GNU readline for the iocsh communication to work properly.
The perl CA library doesn't build or run on Windows, but we would just
not try to build or run those tests on Windows.
The IOC.pm module is used in Marty Kraimer's exampleCPP PVA module in a
fairly simple way to run other test programs after starting an IOC, but
it has more capabilities that he is actually using. I have written
programs that start an IOC, connect to it over CA, do CA puts/gets and
use the built-in dbpf/dbgf commands to put/get data. It's very easy to
send your own iocsh commands and get back a multi-line response, as long
as the command is synchronous (no background tasks!).
It does need some better documentation to be written though which is why
I haven't added it to Base as a module yet, but I'd be willing to do
that if you're interested in using it. Just don't expect it tomorrow...
- Andrew