gpu: nvgpu: unit: add test levels

Add -t/--test-level option for the unit test framework. This
correlates with the test plan levels in GVS. L0 tests are a subset of
the L1 tests. Currently, only test levels 0 and 1 are supported.

The test output has been updated to display skipped tests. Skipped
tests are not included in the test dump.

JIRA NVGPU-2251

Change-Id: Icc2ff19a81529be8526e89f70983e96040390e00
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2085280
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Philip Elcan
2019-03-29 11:59:04 -04:00
committed by mobile promotions
parent f7860833f1
commit c0d5a715bd
25 changed files with 293 additions and 218 deletions

View File

@@ -45,6 +45,11 @@ struct unit_module_test {
*/
module_test_fn fn;
/*
* Minimum test plan level (L0, L1) to execute the test.
*/
unsigned int test_lvl;
/*
* A void pointer to arbitrary arguments. Lets the same unit test
* function perform multiple tests. This gets passed into the
@@ -141,11 +146,12 @@ struct unit_module {
.fw = NULL, \
}
#define UNIT_TEST(__name, __fn, __args) \
#define UNIT_TEST(__name, __fn, __args, __test_lvl) \
{ \
.name = #__name, \
.fn = __fn, \
.args = __args, \
.test_lvl = __test_lvl, \
.jama.requirement = "", \
.jama.unique_id = "", \
.jama.verification_criteria = "", \
@@ -155,11 +161,12 @@ struct unit_module {
* 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) \
#define UNIT_TEST_REQ(__req, __uid, __vc, __name, __fn, __args, __test_lvl) \
{ \
.name = #__name, \
.fn = __fn, \
.args = __args, \
.test_lvl = __test_lvl, \
.jama.requirement = __req, \
.jama.unique_id = __uid, \
.jama.verification_criteria = __vc, \