[Development] Proposal - QtSerialPort graduation from the Playground

Konrad Rosenbaum konrad at silmor.de
Sat Jan 26 12:44:54 CET 2013


On Saturday 26 January 2013, Laszlo Papp wrote:
> On Fri, Jan 25, 2013 at 9:05 PM, Knoll Lars <Lars.Knoll at digia.com> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20130126/94889029/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/development/attachments/20130126/94889029/attachment.sig>


More information about the Development mailing list