On Saturday 26 January 2013, Laszlo Papp wrote:
> On Fri, Jan 25, 2013 at 9:05 PM, Knoll Lars <[email protected]> wrote:
> >  And a question: There's no auto tests. I know that testing serial
> >  ports
> > can't really be done in an automated fashion, but is there anything we
> > can do to cover the module?

> * The CI machines could be using a loopback cable, and test it that way.
> It would be even better to use a pandaboard or raspberry pi (with
> gserial in that case). The board could be used for receiving and sending
> data back for instance, but this requires a special hardware setup.
> 
> Perhaps, there are other alternatives to address this, but these have
> just come to my mind for the moment.

Actually it is rather easy - unfortunately the recipes are very different 
for different platforms.

Linux: all terminals behave essentially like serial ports. You simply need a 
small program that allocates two PTYs, connects them in a virtual loop and 
exposes the two corresponding TTYs to the test case. You cannot test speed 
directly (PTYs ignore their speed parameter), but you can ask the port for 
what speed it has set. I'm not sure about the non-data lines in serial 
ports, since I have never used them.

Windows: there are several projects on Sourceforge that emulate serial 
interfaces. I've used com0com to simulate loops.

I have never done serial work on Mac, but I'd guess it is similar to Linux, 
being a kind of mock-Unix. ;-)

The CI machines would simply have to have these virtual loops installed and 
they'd need some kind of configuration that shows which ports to use (Linux 
/dev/pts/*, Windows: COM?).


        Konrad

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
Development mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/development

Reply via email to