Project:Perl/maint-notes/dev-perl/Device-SerialPort

= Tests = This module needs hardware IO to  and so testing this is left to experts.

Here's the notes from upstreams Readme:

INSTALL and TEST:

You will need suitable permissions to open the port. If the port is also used for logins, you will need to create a lockfile (/var/lock/LCK..ttyS0) on my Redhat 5.2 system. Just touch it, the contents are not important. They may be someday. But not yet. You might need to be "root" for that.

Run 'perl Makefile.PL' followed by 'make'. This will create install files and directories. Run 'make test' with nothing connected to "/dev/ttyS1". This will run the tests and create a configuration_file. You can specify a different port to test via 'perl Makefile.PL TESTPORT='. Makefile.PL creates "t/DefaultPort.pm". You can also specify an alternate port with the Shell Variable "Makefile_Test_Port".

The Benchmark routines are used to generate reports. The test suite covers many of the module methods and sets the port for 9600 baud, 1 stop, 8 data, no parity, no handshaking, and other defaults. At various points in the testing, it expects unconnected CTS and DTR lines. The module should restore any port settings on exit. But this has not been exhaustively tested yet.

Tests may also be run individually by typing: 'perl test?.t Page_Delay [/dev/ttySx]'

With no delay, the tests execute too rapidly to follow from a command line. Delay may be set from 0 to 5 seconds.

All tests are expected to pass - I would be very interested in hearing about failures ("not ok"). These tests should be run from a command prompt. For details run "make test TEST_VERBOSE=1".

Subsequently, functional tests will not be executed unless  is in your environment, where the value should be a value passable as   as documented above.