QTools  6.3.7
QUTest™ Script Reference

A QUTest test script contains a group of related tests (a test group). The basic job of these tests is to send commands to the test fixture running in the Target and to compare the QSPY textual output produced by the Target with the expectations of the tests.

The QUTest test scripts are executed in the host by the "QUTest front-end" that communicates with the QSPY host application via the UDP interface. The "QUTest front-end" is itself implemented in Python (both Python 2+ and Python 3+ can be used).


QUTestâ„¢ Testing DSL

The Python module qtools/qspy/py/qutest.py defines a small Domain Specific Language (DSL) for writing test scripts in Python. The structure of this DSL is very simple. Each test script consists of two sections:


The "preamble" section of a test script file defines callback functions common to all tests in this file. It can contain the following callback functions:

These callback functions can call any of the test commands.


The "tests" section of a test script file contains the actual tests. Each test starts with the test() command and can contain any number of the test commands. The test continues until another test() command, or the skip() command.


The commands that you can place in the tests (as well as inside the callback functions) are:

Categories of QSPY Output

To write effective test scripts you need to understand the main categories of QSPY output, which are illustrated in the picture below:

Categories of QSPY output
Information output generated internally by QSPY. This output is not sent to test scripts.
Dictionary trace records generated by the Target. This output is not forwarded to test scripts.
Acknowledgement trace records generated by the Target. This output is forwarded to test scripts, but is checked automatically and implicitly by the test commands.
Trace records generated by the Target. This output is forwarded to test scripts and must be checked explicitly by test expectations.

Next: QSpyView™ Visualization & Monitoring