checked
REQUIREMENTS.checked(string reqID, [verdict|signal verdict])
To show the success/failed (green/red) status of a linked requirement in the table generated by
the REQUIREMENTS.report()
command, you must use the
REQUIREMENTS.checked()
command. Otherwise the table will show only the
inconclusive results (yellow).
The requirements will show in the table even if they are not linked (a static check), provided
that the REQUIREMENTS.checked()
command is used.
Parameters:
reqID ID of one of the requirements imported into TPT
[verdict]
(optional)
the verdict is optional (if omitted, TPT.INCONCLUSIVE
is assumed). If a verdict is given, it can be either
- one of the verdict constants
TPT.PASSED
,TPT.FAILED
, orTPT.INCONCLUSIVE
(formerlyTPT.DONT_KNOW
) or - a signal.
signal.getVerdict()
call is basically a shortcut for
REQUIREMENTS.checked(reqID, signal.getVerdict()).
Note that if REQUIREMENTS.checked()
is called several times with
different verdicts, the "worst case" is considered, not just the last one.
Examples:
if(mycondition_okay): # if condition is okay, SRS-123 has been fulfilled REQUIREMENTS.checked("SRS-123", TPT.PASSED); else: # otherwise, requirement failed. REQUIREMENTS.checked("SRS-123", TPT.FAILED); # check a condition of a requirement "inlined" in the REQUIREMENTS.checked() call: # check if mysig is always greater than 4 and assign the result to the requirement SRS-124 REQUIREMENTS.checked("SRS-124", TPT.assertAlways(mysig > 4));