Conditions
Sometimes it is useful to only run tests in certain circumstances. For example, if a test for the connectivity of the flash has failed, then there is no point trying to program it, or you might have some XJEase code that detects different board variants and so runs different sets of tests depending on what devices are present. Conditions in the test list can be used to detect these situations and control whether a one or more test groups or functions are run.
A condition consists of a name and a boolean XJEase expression. The name is just used to identify the condition in the test list, and can contain any characters. The expression can contain any XJEase so long as it evaluates to an integer. The expression is evaluated just before any test that it contains is run. If the expression evaluates to true, i.e. is not zero, then the contained tests will be run; if it evaluates to false, i.e. zero, then the contained tests will be skipped.
The most common kind of condition is running tests based on the result of previous tests in the test list. The HAS_RUN, HAS_PASSED and RESULTOF XJEase functions exist to query the results of previous tests. However, any valid XJEase may be used, including function calls.
In a project with variants, another common condition is to only run a test in a certain variant or variants. The VARIANT_NAME XJEase read-only variable can be used to query this.
Examples
This expression will only evaluate to true and allow tests to be run if the IC5 Test ran and passed:
HAS_RUN("IC5.Test") &&? HAS_PASSED("IC5.Test")
This expression will only evaluate to true if running a variant called "VariantA" or "VariantB":
VARIANT_NAME = "VariantA" || VARIANT_NAME = "VariantB"
See Also
XJTAG v4.2.5
