Skip to main content

QUTest Python scripting support

Project description

The "qutest" Python package supports developing Python test scripts for the QUTest unit testing harness. Thus the "qutest" Python package is part of the larger unit-testing infrastructure for embedded C or C++ code on embedded targets as well as host computers.

General Requirements

The "qutest" package requires standard Python 3, which is included in the QTools distribution for Windows and is typically included with other operating systems, such as Linux and macOS.

To execute test scripts in Python, you need to first launch the QSPY console application to communicate with the chosen embedded target or the host executable. Once QSPY is running, from a separate terminal you can launch and "attach" to the QSPY UDP socket. After this communication has been established, "qutest" can execute the test scripts in Python to perform testing of the test fixture inside the target (through QSPY).


The script can be used standalone, without any installation (see Using "qutest" below).

Alternatively, you can install with pip from PyPi by executing the following command:

pip install qutest

Or directly from the sources directory (e.g., /qp/qtools/qutest):

python install --install-dir=/qp/qtools/qutest

Using "qutest"

If you are using qutest as a standalone Python script, you invoke it as follows:

python /path-to-qutest-script/ [-x] [test-scripts] [host_exe] [qspy_host[:udp_port]] [qspy_tcp_port]

Alternatively, if you've installed qutest with pip, you invoke it as follows:

qutest [-x] [test-scripts] [host_exe] [qspy_host[:udp_port]] [qspy_tcp_port]

Command-line Options

  • -x - optional flag that causes qutest to exit on first test failure.

  • test_scripts - optional specification of the Python test scripts to run. If not specified, qutest will try to run all *.py files in the current directory as test scripts

  • host_exe | DEBUG - optional specification of the test-fixture compiled for the host (host executable) for testing on the host computer. The special value DEBUG means that qutest will run in the "debug mode", in which it will NOT launch the host executables and it will wait for the Target reset and other responses from the Target. If host_exe is not specified, an embedded target is assumed (which is loaded with the test fixture alredy).

  • qspy_host[:udp_port] - optional host-name/IP-address:port for the host running the QSPY host utility. If not specified, the default is 'localhost:7701'.

  • tcp_port - optional the QSpy TCP port number for connecting host executables. If not specified, the default is '6601'.

Examples (for Windows):

python %QTOOLS%\qutest\

python %QTOOLS%\qutest\ *.py

python %QTOOLS%\qutest\ *.py build\dpp.exe

qutest *.py build\dpp.exe

qutest *.py build\dpp.exe localhost:7701 6605

qutest *.py DEBUG

qutest *.py DEBUG localhost:7701 6605

Examples (for Linux/macOS):

python $(QTOOLS)/qutest/

python $(QTOOLS)/qutest/ *.py

qutest *.py build/dpp

qutest *.py build/dpp

qutest *.py build/dpp localhost:7701 6605

qutest *.py DEBUG

qutest *.py DEBUG localhost:7701 6605

More Information

More information about the QUTest unit testing harness is available online at:

More information about the QP/QSPY software tracing system is available online at:

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qutest-7.1.2.tar.gz (14.3 kB view hashes)

Uploaded source

Built Distribution

qutest-7.1.2-py3-none-any.whl (13.8 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page