Functions | |
def | include (fname) |
include python code in a test script More... | |
def | test_file () |
get the test file name with path More... | |
def | test_dir () |
get the test directory (relative to the current directory) More... | |
def | test (title, opt=0) |
start a new test More... | |
def | skip (nTests=9999) |
skip the tests following this command. More... | |
def | expect (match) |
defines an expectation for the current test More... | |
def | glb_filter (*args) |
Send the QS Global Filter to the Target. More... | |
def | loc_filter (*args) |
Send the Local Filter to the Target. More... | |
def | ao_filter (obj_id) |
Updates the Local Filter for a given AO in the Target. More... | |
def | current_obj (obj_kind, obj_id) |
Set the Current-Object in the Target. More... | |
def | query_curr (obj_kind) |
query the current object in the Target More... | |
def | tick (tick_rate=0) |
trigger system clock tick in the Target More... | |
def | expect_pause () |
defines expectation for a Test Pause More... | |
def | expect_run () |
defines expectation for calling QF_run()/QF::run() More... | |
def | continue_test () |
sends the CONTINUE packet to the Target to continue a test More... | |
def | command (cmdId, param1=0, param2=0, param3=0) |
executes a given command in the Target More... | |
def | init (signal=0, params=None) |
take the top-most initial transition in the current SM object in the Target More... | |
def | dispatch (signal, params=None) |
dispatch a given event in the current SM object in the Target More... | |
def | post (signal, params=None) |
post a given event to the current AO object in the Target More... | |
def | publish (signal, params=None) |
publish a given event to subscribers in the Target More... | |
def | probe (func, data) |
sends a Test-Probe to the Target More... | |
def | peek (offset, size, num) |
peeks data in the Target More... | |
def | poke (offset, size, data) |
pokes data into the Target. More... | |
def | fill (offset, size, num, item=0) |
fills data into the Target. More... | |
def | pack (format, v1, v2) |
packs data into binary string to be sent to QSPY. More... | |
def | on_reset () |
callback function invoked after each Target reset More... | |
def | on_setup () |
callback function invoked at the beginning of each test More... | |
def | on_teardown () |
callback function invoked at the end of each test More... | |
Variables | |
int | VERSION = 693 |
current version of the Python QUTest interface More... | |
def 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 79 of file qutest_dsl.py.
def qutest_dsl.test_file | ( | ) |
get the test file name with path
Definition at line 90 of file qutest_dsl.py.
def qutest_dsl.test_dir | ( | ) |
get the test directory (relative to the current directory)
Definition at line 101 of file qutest_dsl.py.
def 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 120 of file qutest_dsl.py.
def 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 146 of file qutest_dsl.py.
def 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 174 of file qutest_dsl.py.
def 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:
Definition at line 212 of file qutest_dsl.py.
def 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: IDS_ALL # all QS-IDs
IDS_AO # Active Object QS-IDs (1..64)
IDS_EP # Event Pool QS-IDs (65-80)
IDS_EQ # Event Queue QS-IDs (81-96)
IDS_AP # Application-Specific QS-IDs (97-127)
|
Definition at line 239 of file qutest_dsl.py.
def 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 259 of file qutest_dsl.py.
def 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: OBJ_SM # State Machine object
OBJ_AO # Active Object object
OBJ_MP # Memory Pool object
OBJ_EQ # Event Queue object
OBJ_TE # Time Event object
OBJ_AP # Application-Specific object
OBJ_SM_AO # Both, State Machine and Active Object
|
[in] | obj_id | Name or addres of the object |
Definition at line 289 of file qutest_dsl.py.
def 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: OBJ_SM # State Machine object@n
OBJ_AO # Active Object object@n
OBJ_MP # Memory Pool object@n
OBJ_EQ # Event Queue object@n
OBJ_TE # Time Event object
|
Definition at line 326 of file qutest_dsl.py.
def 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 345 of file qutest_dsl.py.
def qutest_dsl.expect_pause | ( | ) |
defines expectation for a Test Pause
expect_pause()
expectation must be placed in the on_reset() callback.Definition at line 363 of file qutest_dsl.py.
def qutest_dsl.expect_run | ( | ) |
defines expectation for calling QF_run()/QF::run()
Definition at line 381 of file qutest_dsl.py.
def qutest_dsl.continue_test | ( | ) |
sends the CONTINUE packet to the Target to continue a test
Definition at line 394 of file qutest_dsl.py.
def qutest_dsl.command | ( | cmdId, | |
param1 = 0 , |
|||
param2 = 0 , |
|||
param3 = 0 |
|||
) |
executes a given command in the Target
[in] | cmdId | the command-id first argument to QS_onCommand() NOTE: this could be either the raw number or a name that is delivered by QS_USR_DICTIONARY() from the Target |
[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 411 of file qutest_dsl.py.
def 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 430 of file qutest_dsl.py.
def 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 447 of file qutest_dsl.py.
def 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 464 of file qutest_dsl.py.
def 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 480 of file qutest_dsl.py.
def 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 505 of file qutest_dsl.py.
def 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 524 of file qutest_dsl.py.
def 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 542 of file qutest_dsl.py.
def 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 561 of file qutest_dsl.py.
def 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 exactly. The pack() command is typically used inside other QUTest commands to pack the binary event parameters or binary data for poke() and fill().[in] | format | string |
[in] | v1 | one or more data elements requried by format |
[in] | v2 | one or more data elements requried by format |
Definition at line 584 of file qutest_dsl.py.
def qutest_dsl.on_reset | ( | ) |
callback function invoked after each Target reset
Definition at line 588 of file qutest_dsl.py.
def qutest_dsl.on_setup | ( | ) |
callback function invoked at the beginning of each test
Definition at line 592 of file qutest_dsl.py.
def qutest_dsl.on_teardown | ( | ) |
callback function invoked at the end of each test
Definition at line 596 of file qutest_dsl.py.
int VERSION = 693 |
current version of the Python QUTest interface
Definition at line 54 of file qutest_dsl.py.