- Locations
:cpp
Testcase
- Properties
:qml
alias
, :qmlname
The Depends
defines a dependency on another test case specified by :qmlname
. In its simplest form, it specifies only a precedence relation as for instance in the following example:
code/reference/simple-depends.qml
In the above example, test case B may want to access results and properties of A. The Depends item attaches a reference of selected properties from A to B. These properties are available in B through the :qmlTestcase::dependencies
property as shown in the following example:
code/reference/simple-exports.qml
After completion of A, Qst copies the properties of the :qmlExports
item over to B. Test case B can access them through the :qmldependencies
property. Only basic QML types <language_basic-data-types>
are considered for exporting which avoids side effects.
When being assigned to a :qmlMatrix
item, a testcase may be expanded to multiple jobs. The Depends item allows to control which job instances of one test case A
match which job instances of a test case B
. It comes in two matching flavours. Consider the following Matrix
project:
code/reference/depends-project-with-matrix.qml
The project in depends-project-with-matrix.qml consists of 3 test cases, 2 of which depend on a test case A
. The referenced test cases will be explained in the following sub-sections.
The Depends item specifies all tag keys of the depending test case. This matching type is always unambiguous and is especially useful when a non-tagged test case depends only on certain jobs of a tagged one. Example:
code/reference/explicit.qml
$ qst run -f depends-project-with-matrix.qml | grep -e explicit -e " A "
PASS, A 0000000 [ board-1 debug ],,,
PASS, A 0000001 [ board-2 debug ],,,
PASS, A 0000002 [ board-1 release ],,,
PASS, A 0000003 [ board-2 release ],,,
INFO, explicit, , explicit.qml:21, depends on board-1-debug.elf board-2-debug.elf
PASS, explicit,,,
The Depends item specifies none of the tags of a depending test case. In this case, the matching behavior depends on whether the test case and the dependency are tagged or not. Non-tagged example:
code/reference/implicit.qml
$ qst run -f depends-project-with-matrix.qml | grep -e implicit -e " A "
PASS, A 0000000 [ board-1 debug ],,,
PASS, A 0000001 [ board-2 debug ],,,
PASS, A 0000002 [ board-1 release ],,,
PASS, A 0000003 [ board-2 release ],,,
INFO, implicit 0000004 [ board-1 debug ],, implicit.qml:19, depends on board-1-debug.elf
PASS, implicit 0000004 [ board-1 debug ],,,
INFO, implicit 0000005 [ board-2 debug ],, implicit.qml:19, depends on board-2-debug.elf
PASS, implicit 0000005 [ board-2 debug ],,,
INFO, implicit 0000006 [ board-1 release ],, implicit.qml:19, depends on board-1-release.elf
PASS, implicit 0000006 [ board-1 release ],,,
INFO, implicit 0000007 [ board-2 release ],, implicit.qml:19, depends on board-2-release.elf
PASS, implicit 0000007 [ board-2 release ],,,
B
(not tagged) depends onA
(not tagged)
There is only a single instance of
A
andB
.
B
(not tagged) depends onA
(tagged)
There is only a single instance of
B
and it matches all instances ofA
.
B
(tagged) depends onA
(not tagged)
Every job instance of
B
matches the same single instance ofA
.
B
(tagged) depends onA
(tagged)
Every job instance of
B
matches all jobs ofA
that have at least the same tags asB
. IfA
andB
are in the same matrix, then the resulting relationship is usually 1:1.