diff options
author | Janne Peltonen <janne.peltonen@nokia.com> | 2024-01-04 15:38:15 +0200 |
---|---|---|
committer | Matias Elo <matias.elo@nokia.com> | 2024-01-16 15:00:31 +0200 |
commit | cf0fca8a1963c9ad939e8b0cce986c850a41c6ca (patch) | |
tree | e24b6e7adea27ce3293c51893c3b742ebc6b5d57 /test/common | |
parent | 43d74f57b2a9e8270e1c1b3831c8a5334bd4182a (diff) |
test: cunit: make odp_cunit_parse_options() update argc
Have odp_cunit_parse_options() update the option count after it has
removed the options it handled. This enables the callers to have their
own command line option processing after odp_cunit_parse_options() as
probably originally intended.
Signed-off-by: Janne Peltonen <janne.peltonen@nokia.com>
Reviewed-by: Matias Elo <matias.elo@nokia.com>
Diffstat (limited to 'test/common')
-rw-r--r-- | test/common/odp_cunit_common.c | 4 | ||||
-rw-r--r-- | test/common/odp_cunit_common.h | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/test/common/odp_cunit_common.c b/test/common/odp_cunit_common.c index a5b9ff1ea..651ae791e 100644 --- a/test/common/odp_cunit_common.c +++ b/test/common/odp_cunit_common.c @@ -708,13 +708,13 @@ int odp_cunit_register(odp_suiteinfo_t testsuites[]) * (hence also helpers options as cunit_common uses the helpers) * Options private to the test calling cunit_common are not parsed here. */ -int odp_cunit_parse_options(int argc, char *argv[]) +int odp_cunit_parse_options(int *argc, char *argv[]) { const char *ctrl_thread_env = getenv("CI_THREAD_TYPE_CONTROL"); const char *env = getenv("CI"); progname = argv[0]; - odph_parse_options(argc, argv); + *argc = odph_parse_options(*argc, argv); /* Check if we need to use control thread */ if (ctrl_thread_env && !strcmp(ctrl_thread_env, "true")) control_thread = true; diff --git a/test/common/odp_cunit_common.h b/test/common/odp_cunit_common.h index 77822ee60..63e95d5fb 100644 --- a/test/common/odp_cunit_common.h +++ b/test/common/odp_cunit_common.h @@ -66,7 +66,7 @@ typedef struct { } test_shared_data_t; /* parse parameters that affect the behaviour of odp_cunit_common */ -int odp_cunit_parse_options(int argc, char *argv[]); +int odp_cunit_parse_options(int *argc, char *argv[]); /* register suites to be run via odp_cunit_run() */ int odp_cunit_register(odp_suiteinfo_t testsuites[]); /* update tests previously registered via odp_cunit_register() */ |