#serial #test #unit

bin+lib serial-unit-testing

Serial unit testing program and library

10 releases

✓ Uses Rust 2018 edition

new 0.2.3 May 26, 2020
0.2.2 Jan 19, 2020
0.2.1 Nov 19, 2019
0.1.8 Nov 8, 2019
0.1.5 Feb 24, 2019

#168 in Command line utilities

Download history 10/week @ 2020-02-07 36/week @ 2020-02-14 28/week @ 2020-02-21 11/week @ 2020-02-28 18/week @ 2020-03-06 10/week @ 2020-03-13 55/week @ 2020-03-20 11/week @ 2020-03-27 5/week @ 2020-04-03 63/week @ 2020-04-10 9/week @ 2020-04-17 1/week @ 2020-04-24 19/week @ 2020-05-01 51/week @ 2020-05-15 60/week @ 2020-05-22

89 downloads per month
Used in p50x

MIT and maybe MPL-2.0

190KB
3.5K SLoC

Serial Unit Testing

Crates.io Documentation Build Status

Description

Serial unit testing is a cross-platform cli application and rust library. Using serial unit testing communication and testing with any serial port device can be done and most important automated.

Installation

If you have rust installed:

cargo install serial-unit-testing

If you don't have rust installed:

You can download the compiled binaries from the releases. Downloads are available for Windows, macOS and Linux.

Application

The application, called sut (which is short for serial unit testing), is structured in the following sub commands:

  • list: List all available serial ports
  • send: Send data to a serial port
  • check: Send data to a serial port and check for correct response
  • monitor: Interactive serial communication monitor
  • run: Run a script on a serial port
  • verify: Verify a script can be parsed without failure
  • help: Print information about the application or a sub command
  • version: Print version information

Test script language

The run and verify commands are used to work with the test script language to automate testing easily. For a complete syntax of the language see script.

# Example script

(Test One)              "h\n"  :  "Help"
(Test Two, repeat = 2) h"00FF" : h"00"
                       h"00af" : h"03"

[Group One]
(Group Test One) "gp\n" : "yes"
(Group Test Two) "gq\n" : "no"

License

MIT License

Copyright (c) 2020 MarkAtk

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Dependencies

~1.2–2.5MB
~59K SLoC