gpu: nvgpu: unit: Add requirement unit test type

Add a type of unit test that satisfies requirement verification
criteria. This new unit test type allows the source code to link
to verification criteria.

JIRA NVGPU-1323

Change-Id: I5b9e5142f614b369aa805886ad6ca1283bd222ca
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1949208
Reviewed-by: Philip Elcan <pelcan@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Alex Waterman
2018-11-12 15:33:18 -08:00
committed by mobile promotions
parent f756732979
commit 4be0c8ac20
2 changed files with 72 additions and 0 deletions

View File

@@ -51,6 +51,38 @@ struct unit_module_test {
* module_test_fn as @args.
*/
void *args;
/*
* Linkage to JAMA test specification. An example would be:
*
* .requirement = "NVGPU-RQCD-68"
* .verification_criteria = "C1"
*
* This would link to C1 verification criteria of the pd_cache
* requirement NVGPU-RQCD-68.
*
* This is an optional field for any given unit test. But a unit
* test module must satisfy the necessary VC for all requirements
* within that unit.
*/
struct {
/*
* Requirement linkage: this should point to the unique ID
* of the test specification.
*/
const char *unique_id;
/*
* The particular verification criteria that this is
* satisfying.
*/
const char *verification_criteria;
/*
* Specific requirement this test provides coverage for.
*/
const char *requirement;
} jama;
};
/*
@@ -116,6 +148,20 @@ struct unit_module {
.args = __args, \
}
/*
* Use this for a unit test that satisfies or contributes to satisfying a
* verification criteria for a given requirement.
*/
#define UNIT_TEST_REQ(__req, __uid, __vc, __name, __fn, __args) \
{ \
.name = #__name, \
.fn = __fn, \
.args = __args, \
.jama.requirement = __req, \
.jama.unique_id = __uid, \
.jama.verification_criteria = __vc, \
}
#define unit_return_fail(m, msg, ...) \
do { \
unit_err(m, "%s():%d " msg, \