You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doxygen/qutest.dox
+79-4Lines changed: 79 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -37,8 +37,8 @@ Several examples of *test scripts* are explained in the @ref qutest_tut "QUTest
37
37
@remark
38
38
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™ provides support for writing the @ref qutest_script "test scripts in Python".
39
39
<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
42
42
43
43
44
44
The general QUTest™ structure just described corresponds to running tests on an embedded Target. But QUTest™ 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™ components execute on the host computer.
More info: https://www.state-machine.com/qtools/qutest.html
148
148
@endverbatim
@@ -171,12 +171,13 @@ where:<br>
171
171
@param -o[opt] options for the QUTest script runner to perform the
172
172
following actions:<br>
173
173
x : exit on first failed test<br>
174
+
i : interactive mode<br>
174
175
c : clear the QSPY screen just after attaching<br>
175
176
o : save the QSPY text output to a file (in the QSPY launch directory)<br>
176
177
b : save the QSPY binary output to a file (in the QSPY launch directory)
177
178
178
179
@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`).
180
181
181
182
182
183
@section qutest_exa Examples
@@ -233,6 +234,80 @@ For reliable operation it is recommended to apply the short options *without* a
233
234
`[6]` runs "qutest" in the DEBUG mode to execute the test script `test_mpu.py` in the current directory.
234
235
235
236
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).
==============================[ OK ( 20.1s) ]===============================
308
+
@endverbatim
309
+
310
+
236
311
@section qutest_log Generating Test Logs
237
312
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.
0 commit comments