gpu: nvgpu: unit: required tests system

When running unit testing, we need to ensure that all expected unit
tests were actually run. This used to be done by an external Python
script, but it is not suitable for some OSes. This patch brings this
mechanism into the unit testing framework, and makes use of an INI
file to provide the list of expected tests.

JIRA NVGPU-3072

Change-Id: I9ed590de9005fe10324c594ea33ebc8fda482019
Signed-off-by: Nicolas Benech <nbenech@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2317220
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
This commit is contained in:
Nicolas Benech
2020-03-23 14:36:56 -04:00
committed by Alex Waterman
parent b7767a604f
commit fee7b81061
10 changed files with 1516 additions and 4976 deletions

View File

@@ -40,10 +40,11 @@ static struct option core_opts[] = {
{ "num-threads", 1, NULL, 'j' },
{ "test-level", 1, NULL, 't' },
{ "debug", 0, NULL, 'd' },
{ "required", 0, NULL, 'r' },
{ NULL, 0, NULL, 0 }
};
static const char *core_opts_str = "hvqCnQL:j:t:d";
static const char *core_opts_str = "hvqCnQL:j:t:dr:";
void core_print_help(struct unit_fw *fw)
{
@@ -74,6 +75,8 @@ void core_print_help(struct unit_fw *fw)
" Test plan level. 0=L0, 1=L1. default: 1\n",
" -d, --debug Disable signal handling to facilitate debug of",
" crashes.\n",
" -r, --required <FILE> Path to a file with a list of required tests to\n"
" check if all were executed.\n",
"\n",
"Note: mandatory arguments to long arguments are mandatory for short\n",
"arguments as well.\n",
@@ -92,6 +95,7 @@ static void set_arg_defaults(struct unit_fw_args *args)
args->unit_load_path = DEFAULT_ARG_UNIT_LOAD_PATH;
args->thread_count = 1;
args->test_lvl = TEST_PLAN_MAX;
args->required_tests_file = NULL;
}
/*
@@ -166,6 +170,9 @@ int core_parse_args(struct unit_fw *fw, int argc, char **argv)
case 'd':
args->debug = true;
break;
case 'r':
args->required_tests_file = optarg;
break;
case '?':
args->help = true;
return -1;