diff mbox

[PATCHv7,02/35] validation: common: adding command line argument parsing

Message ID 1463490282-23277-3-git-send-email-christophe.milard@linaro.org
State Superseded
Headers show

Commit Message

Christophe Milard May 17, 2016, 1:04 p.m. UTC
A function to parse the command line args is added. This function is meant
to parse only arguments altering the behaviour of cunit_common (this
includes the helpers args as cunit_common uses the helpers)
As at this stage only helper args fall into that category, this function
simply calls the helper parsing function.
(parsing pure cunit_commons args might be added later here if needed)

Signed-off-by: Christophe Milard <christophe.milard@linaro.org>
---
 test/validation/common/odp_cunit_common.c | 10 ++++++++++
 test/validation/common/odp_cunit_common.h |  2 ++
 2 files changed, 12 insertions(+)
diff mbox

Patch

diff --git a/test/validation/common/odp_cunit_common.c b/test/validation/common/odp_cunit_common.c
index 2712abe..2a5864f 100644
--- a/test/validation/common/odp_cunit_common.c
+++ b/test/validation/common/odp_cunit_common.c
@@ -342,3 +342,13 @@  int odp_cunit_register(odp_suiteinfo_t testsuites[])
 
 	return 0;
 }
+
+/*
+ * Parse command line options to extract options affectiong cunit_common.
+ * (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[])
+{
+	return odph_parse_options(argc, argv, NULL, NULL);
+}
diff --git a/test/validation/common/odp_cunit_common.h b/test/validation/common/odp_cunit_common.h
index 22c2a19..3812b0f 100644
--- a/test/validation/common/odp_cunit_common.h
+++ b/test/validation/common/odp_cunit_common.h
@@ -73,6 +73,8 @@  typedef struct {
 	int numthrds; /**< no of pthreads to create */
 } pthrd_arg;
 
+/* parse parameters that affect the behaviour of odp_cunit_common */
+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() */