eval - Evaluate Expression
Evaluate an expression and use its result as the step’s pass/fail outcome and result value.
- command: eval <expression>
[extractKey: <key>]
Argument |
Description |
|---|---|
expression |
Expression to evaluate |
key |
Key in which to store the evaluated expression value |
expression may reference any key set with define - Define user key, plus a fixed
set of system keys (PRODUCT, VERSION, BOM_REV, DUT_ID,
SERIAL_NUMBER, PLT_RUNNER_VERSION, PLT_OS_VERSION,
TEST_PLAN_TITLE, PLT_IP_ADDRESS, RELEASE_UUID,
PROJECT_UUID) and any key extracted by a prior value - Parse values,
measure - Probe Measurement, or similar step. A key set with define overrides a
system key of the same name. Reference a key by its bare name inside
expression (e.g. SERIAL_NUMBER == "12345"); use %KEY%
substitution only where the key must be expanded before the expression
is parsed, such as inside a regular expression literal.
The step’s outcome depends on the type of the evaluated result:
A boolean result of
truepasses the step;falsefails it.A non-empty string or numeric result passes the step, and becomes the result value (stored under key if
extractKey:is set).An empty string result fails the step.
Supported operators:
Operator |
Description |
|---|---|
|
Addition, concatenation |
|
Subtraction, Negation |
|
Division |
|
Multiplication |
|
Power |
|
Modulo |
|
Bitwise And |
|
Bitwise Or |
|
Bitwise Xor |
|
Bitwise Not |
|
Right shift |
|
Left shift |
|
Inversion |
|
Logical And |
|
Logical Or |
|
Ternary True |
|
Ternary False |
|
Null coalescence |
|
Greater than |
|
Less than |
|
Less than or equal |
|
Greater than or equal |
|
Equal |
|
Not equal |
|
Regex match |
|
Regex mismatch |
|
Set membership, e.g. |
Supported functions:
Function |
Description |
|---|---|
|
Build a string from one or more numeric byte values (each argument is truncated to a byte, 0-255). |
|
Convert numeric value to a hexadecimal string (no leading |
|
Convert value to a numeric value. value may be a bool, number, numeric string, or a measurement result (voltage, current, resistance, power, or frequency). Optional unit (e.g. |
|
Returns the current timestamp. If format is provided, the date is returned in the specified format using Golang Time Format; otherwise it defaults to |
Examples
See also