QTools  7.3.4
Collection of Host-Based Tools
Loading...
Searching...
No Matches
Blinky Example

Hierarchical State Machine ExampleDPP Example

This example shows how to unit-test a simple active object (AO) called "Blinky". This Blinky AO, which is driven by a QP time event, turns on and off an LED.

Code Under Test (CUT)

This example is available in both the QP/C as well as the QP/C++ frameworks. The complete code for the Blinky example is provided in the directory <qpc|qpcpp>\examples\qutest\blinky\test.

Blinky model in QM.

Running the Test with QUTest

To run the Blinky test (on Windows), open a command prompt and type:

qspy

This will start the QSPY host utility with the TCP/IP connection to the Target.

Next, open a second command prompt window and type:

cd C:\qp\<qpc|qpcpp>\examples\qutest\blinky\test
make
Note
The provided Makefile will also work on Linux and MacOS. The only difference from Windows is that you open a terminal window and change the directory to ~/qp/<qpc|qpcpp>/examples/qutest/blinky/test.

This will build the test fixture as a host executable and then it will run the test script (in Python). The screen shot below shows the output produced in these two command-prompt windows.

Blinky test build and run with QUTest (right) and QSPY output (left)


Hierarchical State Machine ExampleDPP Example