Skip to content

Commit 5f34b5c

Browse files
committed
7.2.1
1 parent 208755b commit 5f34b5c

File tree

10 files changed

+172
-67
lines changed

10 files changed

+172
-67
lines changed

doxygen/Doxyfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#---------------------------------------------------------------------------
88
DOXYFILE_ENCODING = UTF-8
99
PROJECT_NAME = QTools
10-
PROJECT_NUMBER = 7.2.0
10+
PROJECT_NUMBER = 7.2.1
1111
PROJECT_BRIEF = "Collection of Host-Based Tools"
1212
PROJECT_LOGO = ../../ql-doxygen/images/logo_ql.png
1313
OUTPUT_DIRECTORY =

doxygen/history.dox

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
/**
22
@page history Revision History
33

4+
@section qtools_7_2_1 Version 7.2.1, 2023-01-11
5+
Introduced the @ref qutest_inter "QUTest interactive mode".
6+
7+
48
@section qtools_7_2_0 Version 7.2.0, 2022-12-22
59
@ref qutest "QUTest testing framework":<br>
610
This release represents a significant overhaul of the @ref qutest_use "qutest.py test runner".
File renamed without changes.

doxygen/img/img.htm

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
<img src="logo_ql.png">
99
<img src="splitbar.png">
10-
<img src="logo_python3.png">
1110
<img src="logo_win48.png">
1211
<img src="logo_linux48.png">
1312
<img src="logo_macos48.png">

doxygen/qutest.dox

Lines changed: 79 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ Several examples of *test scripts* are explained in the @ref qutest_tut "QUTest
3737
@remark
3838
The separation between CUT execution and checking the test results has many benefits. One of the most important ones is that CUT execution (@ref qutest_fixture "test fixture") and checking the results (@ref qutest_script "test script") can be done in *different programming languages*. To this end QUTest&trade; provides support for writing the @ref qutest_script "test scripts in Python".
3939
<br>
40-
@image html img/logo_python3.png
41-
@image latex img/logo_python3.png width=5.0in
40+
@image html logo_python3.png
41+
@image latex logo_python3.png width=5.0in
4242

4343

4444
The general QUTest&trade; structure just described corresponds to running tests on an embedded Target. But QUTest&trade; can also execute tests on the **host computer**. In that case (shown in the figure below), the *@ref qutest_fixture "test fixture"* is a host executable that communicates with the @ref qspy_command "QSPY host application" via a TCP/IP socket. In this case all QUTest&trade; components execute on the host computer.
@@ -142,7 +142,7 @@ options:
142142
-l [LOG], --log [LOG]
143143
Optional log directory (might not exist yet)
144144
-o [OPT], --opt [OPT]
145-
xcob: x:exit-on-fail, c:qspy-clear, o:qspy-save-txt, b:qspy-save-bin
145+
xciob: x:exit-on-fail,i:inter,c:qspy-clear,o:qspy-save-txt,b:qspy-save-bin
146146

147147
More info: https://www.state-machine.com/qtools/qutest.html
148148
@endverbatim
@@ -171,12 +171,13 @@ where:<br>
171171
@param -o[opt] options for the QUTest script runner to perform the
172172
following actions:<br>
173173
x : exit on first failed test<br>
174+
i : interactive mode<br>
174175
c : clear the QSPY screen just after attaching<br>
175176
o : save the QSPY text output to a file (in the QSPY launch directory)<br>
176177
b : save the QSPY binary output to a file (in the QSPY launch directory)
177178

178179
@note
179-
For reliable operation it is recommended to apply the short options *without* a space between the option and the parameter (e.g., `-q192.168.1.100`, `-ocx`).
180+
For reliable operation it is recommended to apply the short options *without* a space between the option and the parameter (e.g., `-q192.168.1.100`, `-oci`).
180181

181182

182183
@section qutest_exa Examples
@@ -233,6 +234,80 @@ For reliable operation it is recommended to apply the short options *without* a
233234
`[6]` runs "qutest" in the DEBUG mode to execute the test script `test_mpu.py` in the current directory.
234235

235236

237+
@section qutest_inter Interactive Mode
238+
Similar to the Python interpreter itself, the `qutest.py` test runner has two basic modes: script (default) and interactive. In the default script mode, `qutest.py` runs the provided @ref qutest_script "test scripts" and exits. In the **interactive mode** the reads and executes commands *interactively* @ref from the terminal input. The interactive mode is activated by providing the `-oi` @ref qutest_command "command-line option". Interactive mode is a good way to play around and try the system's response to various commands. Also, interactive mode can be used to provide stimuli for debugging the @ref qutest_fixture "test fixture".
239+
240+
Once activated, the interactive mode works as follows:
241+
242+
- If any test scripts are provided, after each test group (test script) the test runner enters an interactive session, where the user can manually enter any supported test commands. These commands are executed in the context of the *last test in the group*. Tt is also possible to start a new test interactively (by providing the @ref qutest_dsl::test() "test()" command). In that case, the interactively entered commands will be executed in the context of the new test.
243+
244+
- If no test scripts are provided, the test runner enters an interactive session immediately. In that case, the user must provide the @ref qutest_dsl::test() "test()" command manually (perhaps after defining the @ref qutest_dsl-preamble "test callbacks").
245+
246+
In either case, the interactive mode is shown by the presence of the `>>> ` command prompt. During an interactive session the output produced by the text fixture is displayed on the screen and **not** checked against any expectations. In fact, the @ref qutest_dsl::expect() "expect()" command itself makes no sense in the interactive mode. Also, all tests that are interactive are considered "SIKPPED" and are not evaluated as "PASS" or "FAIL".
247+
248+
@note
249+
You can use the up- and down-arrow keys to navigate through the list of previous commands. You end the interactive session by providing an "empty" command, that is by pressing the `<Enter>` key right at the `>>> ` command prompt
250+
251+
Here is an example of an interactive session with test scripts provided. (Note the annotations added after the `//` comments).
252+
253+
@verbatim
254+
C:\qp\qpc\examples\qutest\qhsmtst\test>make OPT=i // <--- NOTE OPT=i
255+
256+
python3 C:\qp\qtools/qutest/qutest.py -ebuild/test_qhsmtst.exe -q -l -oci --
257+
258+
QUTest unit testing front-end 7.2.1 running on Python 3.10.1
259+
Copyright (c) 2005-2022 Quantum Leaps, www.state-machine.com
260+
Attaching to QSpy (localhost:7701) ... OK
261+
262+
Run ID : 230111_174610
263+
Target : build/test_qhsmtst.exe
264+
265+
==================================[Group 1]==================================
266+
test_qhsm-funct.py
267+
[ 1]--------------------------------------------------------------------------
268+
QHsmTst_init
269+
[ PASS ( 0.1s) ]
270+
[ 2]^-------------------------------------------------------------------------
271+
QHsmTst dispatch
272+
>>> dispatch('A_SIG') // <--- interactive command
273+
0000000127 BSP_DISPLAY s1-A;
274+
0000000128 BSP_DISPLAY s11-EXIT;
275+
0000000129 BSP_DISPLAY s1-EXIT;
276+
0000000130 BSP_DISPLAY s1-ENTRY;
277+
0000000131 BSP_DISPLAY s1-INIT;
278+
0000000132 BSP_DISPLAY s11-ENTRY;
279+
0000000133 Trg-Done QS_RX_EVENT
280+
>>> dispatch('B_SIG') // <--- interactive command
281+
0000000134 BSP_DISPLAY s1-B;
282+
0000000135 BSP_DISPLAY s11-EXIT;
283+
0000000136 BSP_DISPLAY s11-ENTRY;
284+
0000000137 Trg-Done QS_RX_EVENT
285+
>>> // <--- end of interactive session
286+
interactive test shows as "skipped" ---> [ SKIPPED ]
287+
288+
==================================[Group 2]==================================
289+
test_qhsm-struct.py
290+
[ 3]--------------------------------------------------------------------------
291+
QHsmTst init
292+
[ PASS ( 0.1s) ]
293+
[ 4]^-------------------------------------------------------------------------
294+
QHsmTst dispatch
295+
>>> // <--- end of interactive session
296+
[ SKIPPED ]
297+
298+
==================================[ SUMMARY ]=================================
299+
300+
Target ID : 230111_170758 (QP-Ver=721)
301+
Log file :
302+
Groups : 2
303+
Tests : 4
304+
Skipped : 2 [ 2 4 ]
305+
Failed : 0
306+
307+
==============================[ OK ( 20.1s) ]===============================
308+
@endverbatim
309+
310+
236311
@section qutest_log Generating Test Logs
237312
As required for safety certification, the `qutest.py` test runner can generate permanent records of the runs by producing **log files**. This feature is enabled by the `-l<log-dir>` command-line option.
238313

0 commit comments

Comments
 (0)