Functions | |
include (fname) | |
include python code in a test script | |
test_file () | |
get the test file name with path | |
test_dir () | |
get the test directory (relative to the current directory) | |
test (title, opt=0) | |
start a new test | |
scenario (title, opt=0) | |
start a new scenario | |
skip (nTests=9999) | |
skip the tests following this command. | |
expect (match) | |
defines an expectation for the current test | |
ensure (bool_expr) | |
ensures that the provided Boolean expression is true | |
glb_filter (*args) | |
Send the QS Global Filter to the Target. | |
loc_filter (*args) | |
Send the Local Filter to the Target. | |
ao_filter (obj_id) | |
Updates the Local Filter for a given AO in the Target. | |
current_obj (obj_kind, obj_id) | |
Set the Current-Object in the Target. | |
query_curr (obj_kind) | |
query the current object in the Target | |
tick (tick_rate=0) | |
trigger system clock tick in the Target | |
expect_pause () | |
defines expectation for a Test Pause | |
expect_run () | |
defines expectation for calling QF_run()/QF::run() | |
continue_test () | |
sends the CONTINUE packet to the Target to continue a test | |
command (cmdId, param1=0, param2=0, param3=0) | |
executes a given command in the Target | |
init (signal=0, params=None) | |
take the top-most initial transition in the current SM object in the Target | |
dispatch (signal, params=None) | |
dispatch a given event in the current SM object in the Target | |
post (signal, params=None) | |
post a given event to the current AO object in the Target | |
publish (signal, params=None) | |
publish a given event to subscribers in the Target | |
probe (func, data) | |
sends a Test-Probe to the Target | |
peek (offset, size, num) | |
peeks data in the Target | |
poke (offset, size, data) | |
pokes data into the Target. | |
fill (offset, size, num, item=0) | |
fills data into the Target. | |
note (msg, dest=(SCREEN|TRACE)) | |
display a note in the QUTest output and in QSPY output. | |
tag (msg, dest=(SCREEN|TRACE)) | |
display a tag in the QUTest output and in QSPY output. | |
pack (format, v1, v2) | |
packs data into binary string to be sent to QSPY. | |
last_rec () | |
returns last record received from the target as string. | |
on_reset () | |
callback function invoked after each Target reset | |
on_setup () | |
callback function invoked at the beginning of each test | |
on_teardown () | |
callback function invoked at the end of each test | |
Variables | |
int | VERSION = 721 |
current version of the Python QUTest interface | |
qutest_dsl.include | ( | fname | ) |
include python code in a test script
[in] | fname | name of the file to include. May contain a path relative to the test script. |
Example
file to be included:
test script calling include()
:
Definition at line 58 of file qutest_dsl.py.
qutest_dsl.test_file | ( | ) |
get the test file name with path
Definition at line 69 of file qutest_dsl.py.
qutest_dsl.test_dir | ( | ) |
get the test directory (relative to the current directory)
Definition at line 80 of file qutest_dsl.py.
qutest_dsl.test | ( | title, | |
opt = 0 |
|||
) |
start a new test
[in] | title | title of the test |
[in] | opt | options {0=default, NORESET} |
Definition at line 100 of file qutest_dsl.py.
qutest_dsl.scenario | ( | title, | |
opt = 0 |
|||
) |
start a new scenario
Definition at line 107 of file qutest_dsl.py.
qutest_dsl.skip | ( | nTests = 9999 | ) |
skip the tests following this command.
[in] | nTests | number of tests to skip (default-all remaining tests) e.g., skip(1) will skip one test following this command. |
Definition at line 132 of file qutest_dsl.py.
qutest_dsl.expect | ( | match | ) |
defines an expectation for the current test
[in] | match | the expected match for the QSPY output The match string can contain special characters, such as: * , ? and [chars] , which are matched according to the Python command fnmatch.fnmatchcase() |
match
string can be the printf-style %-subsitution string (compatible with Python 2 and Python 3), or the new "f-string" (compatible only with Python 3).match
parameter will be automatically replaced with the current numerical value of the test sequence-counter.Definition at line 160 of file qutest_dsl.py.
qutest_dsl.ensure | ( | bool_expr | ) |
ensures that the provided Boolean expression is true
[in] | bool_expr | the Boolean expression to check |
Definition at line 174 of file qutest_dsl.py.
qutest_dsl.glb_filter | ( | * | args | ) |
Send the QS Global Filter to the Target.
[in] | args | list of Record-Type groups or individual Record-Types to set or clear. A given filter-group or an individual filter is set when it is positive, and cleared with it is preceded with the minus (- ) sign. The filter list can contain the following: GRP_ALL # all Record-Types
GRP_SM # State Machine Record-Types
GRP_AO # Active Object Record-Types
GRP_MP # Memory Pool Record-Types
GRP_EQ # Event Queue Record-Types
GRP_TE # Time Events Record-Types
GRP_QF # Framework Record-Types (e.g., post/publish/..)
GRP_SC # Scheduler Record-Types (e.g., scheduler lock/unlock)
GRP_SEM # Semaphore Record-Types (e.g., Semaphore take/signal)
GRP_MTX # Mutex Record-Types (e.g., Mutex lock/unlock)
GRP_U0 # User group 0 (Record-Types 100-104)
GRP_U1 # User group 1 (Record-Types 105-109)
GRP_U2 # User group 2 (Record-Types 110-114)
GRP_U3 # User group 3 (Record-Types 115-119)
GRP_U4 # User group 0 (Record-Types 120-124)
GRP_UA # All user records (Record-Types 100-124)
<num> # Specific QS trace Record-Type in the range 0..127
|
recID
the bitmask has a '1' in the position (1 << recID
).Definition at line 219 of file qutest_dsl.py.
qutest_dsl.loc_filter | ( | * | args | ) |
Send the Local Filter to the Target.
[in] | args | list of QS-ID groups or individual QS-IDs to set or clear. A given filter-group or an individual filter is set when it is positive, and cleared with it is preceded with the minus (- ) sign. |
This parameter can take one of the following values:
qsID
the bitmask has a '1' in the position (1 << qsID
).Definition at line 252 of file qutest_dsl.py.
qutest_dsl.ao_filter | ( | obj_id | ) |
Updates the Local Filter for a given AO in the Target.
[in] | obj_id | active object to set/clear the local filter for in the Target |
This parameter can be either a string (name of the AO) or the AO's priority. Also, it can be either positive (to set) or negative (to clear) the QS local filter.
Definition at line 276 of file qutest_dsl.py.
qutest_dsl.current_obj | ( | obj_kind, | |
obj_id | |||
) |
Set the Current-Object in the Target.
[in] | obj_kind | Kind of object to set |
This parameter can take one of the following values:
[in] | obj_id | Name or addres of the object |
Definition at line 307 of file qutest_dsl.py.
qutest_dsl.query_curr | ( | obj_kind | ) |
query the current object in the Target
[in] | obj_kind | Kind of object to query |
This parameter can take one of the following values:
Definition at line 345 of file qutest_dsl.py.
qutest_dsl.tick | ( | tick_rate = 0 | ) |
trigger system clock tick in the Target
[in] | tick_rate | the tick rate (0..QF_MAX_TICK_RATE) |
Definition at line 365 of file qutest_dsl.py.
qutest_dsl.expect_pause | ( | ) |
defines expectation for a Test Pause
expect_pause()
expectation must be placed in the on_reset() callback.Definition at line 383 of file qutest_dsl.py.
qutest_dsl.expect_run | ( | ) |
defines expectation for calling QF_run()/QF::run()
Definition at line 401 of file qutest_dsl.py.
qutest_dsl.continue_test | ( | ) |
sends the CONTINUE packet to the Target to continue a test
Definition at line 414 of file qutest_dsl.py.
qutest_dsl.command | ( | cmdId, | |
param1 = 0 , |
|||
param2 = 0 , |
|||
param3 = 0 |
|||
) |
executes a given command in the Target
[in] | cmdId | the first cmdId argument for the QS_onCommand() callback function in the test fixture. |
cmdId
parameter could be either the raw number or a name that is delivered by QS_ENUM_DICTIONARY(enum, group), where the second group
argument is QS_CMD (numerical value 7).[in] | param1 | the "param1" argument to QS_onCommand() (optional) |
[in] | param2 | the "param2" argument to QS_onCommand() (optional) |
[in] | param3 | the "param3" argument to QS_onCommand() (optional) |
Definition at line 436 of file qutest_dsl.py.
qutest_dsl.init | ( | signal = 0 , |
|
params = None |
|||
) |
take the top-most initial transition in the current SM object in the Target
[in] | signal | the event signal of the "initialization event" |
[in] | params | the parameters of the "initialization event" |
Definition at line 455 of file qutest_dsl.py.
qutest_dsl.dispatch | ( | signal, | |
params = None |
|||
) |
dispatch a given event in the current SM object in the Target
[in] | signal | the event signal of the event to be dispatched |
[in] | params | the parameters of the event to be dispatched |
Definition at line 472 of file qutest_dsl.py.
qutest_dsl.post | ( | signal, | |
params = None |
|||
) |
post a given event to the current AO object in the Target
[in] | signal | the event signal of the event to be posted |
[in] | params | the parameters of the event to be posted |
Definition at line 489 of file qutest_dsl.py.
qutest_dsl.publish | ( | signal, | |
params = None |
|||
) |
publish a given event to subscribers in the Target
[in] | signal | the event signal of the event to be posted |
[in] | params | the parameters of the event to be posted |
Definition at line 506 of file qutest_dsl.py.
qutest_dsl.probe | ( | func, | |
data | |||
) |
sends a Test-Probe to the Target
[in] | func | the name or raw address of a function |
[in] | data | the data (uint32_t) for the Test-Probe |
Definition at line 532 of file qutest_dsl.py.
qutest_dsl.peek | ( | offset, | |
size, | |||
num | |||
) |
peeks data in the Target
[in] | offset | offset [in bytes] from the start of the current_obj() |
[in] | size | size of the data items (1, 2, or 4) |
[in] | num | number of data items to peek |
Definition at line 551 of file qutest_dsl.py.
qutest_dsl.poke | ( | offset, | |
size, | |||
data | |||
) |
pokes data into the Target.
[in] | offset | offset [in bytes] from the start of the current_obj() |
[in] | size | size of the data items (1, 2, or 4) |
[in] | data | binary data to send |
Definition at line 570 of file qutest_dsl.py.
qutest_dsl.fill | ( | offset, | |
size, | |||
num, | |||
item = 0 |
|||
) |
fills data into the Target.
[in] | offset | offset [in bytes] from the start of the current_obj() |
[in] | size | size of the data item (1, 2, or 4) |
[in] | num | number of data items to fill |
[in] | item | data item to fill with |
Definition at line 589 of file qutest_dsl.py.
qutest_dsl.note | ( | msg, | |
dest = (SCREEN | TRACE) |
|||
) |
display a note in the QUTest output and in QSPY output.
[in] | msg | text message |
[in] | dest | destination (SCREEN, TRACE), default both |
Definition at line 610 of file qutest_dsl.py.
qutest_dsl.tag | ( | msg, | |
dest = (SCREEN | TRACE) |
|||
) |
display a tag in the QUTest output and in QSPY output.
Definition at line 617 of file qutest_dsl.py.
qutest_dsl.pack | ( | format, | |
v1, | |||
v2 | |||
) |
packs data into binary string to be sent to QSPY.
format
. The arguments must match the values required by the [format](https://docs.python.org/3/library/struct.html#format-strings") exactly.
The pack() command is typically used inside other QUTest commands
to pack the binary event parameters or binary data for poke() and fill().
@param [in] format string
@param [in] v1 one or more data elements requried by format
@param [in] v2 one or more data elements requried by format
@par Usage
@code{py}
dispatch("MY_SIG", pack("<B", 2))
poke(2, 2, pack("<HH", 0xB2C2, 0xD2E2)) Definition at line 640 of file qutest_dsl.py.
qutest_dsl.last_rec | ( | ) |
returns last record received from the target as string.
Definition at line 657 of file qutest_dsl.py.
qutest_dsl.on_reset | ( | ) |
callback function invoked after each Target reset
Definition at line 661 of file qutest_dsl.py.
qutest_dsl.on_setup | ( | ) |
callback function invoked at the beginning of each test
Definition at line 665 of file qutest_dsl.py.
qutest_dsl.on_teardown | ( | ) |
callback function invoked at the end of each test
Definition at line 669 of file qutest_dsl.py.
int qutest_dsl.VERSION = 721 |
current version of the Python QUTest interface
Definition at line 33 of file qutest_dsl.py.