@@ -52,10 +52,14 @@ static void odp_init_abort(void)
abort();
}
-int init_main_abort(void)
+int init_main_abort(int argc, char *argv[])
{
int ret;
+ /* parse common options: */
+ if (odp_cunit_parse_options(argc, argv))
+ return -1;
+
/* prevent default ODP init: */
odp_cunit_register_global_init(NULL);
odp_cunit_register_global_term(NULL);
@@ -116,10 +120,14 @@ static int odp_init_log(odp_log_level_t level __attribute__((unused)),
return r;
}
-int init_main_log(void)
+int init_main_log(int argc, char *argv[])
{
int ret;
+ /* parse common options: */
+ if (odp_cunit_parse_options(argc, argv))
+ return -1;
+
/* prevent default ODP init: */
odp_cunit_register_global_init(NULL);
odp_cunit_register_global_term(NULL);
@@ -157,10 +165,14 @@ odp_suiteinfo_t init_suites_ok[] = {
ODP_SUITE_INFO_NULL,
};
-int init_main_ok(void)
+int init_main_ok(int argc, char *argv[])
{
int ret;
+ /* parse common options: */
+ if (odp_cunit_parse_options(argc, argv))
+ return -1;
+
/* prevent default ODP init: */
odp_cunit_register_global_init(NULL);
odp_cunit_register_global_term(NULL);
@@ -25,8 +25,8 @@ extern odp_suiteinfo_t init_suites_log[];
extern odp_suiteinfo_t init_suites_ok[];
/* main test program: */
-int init_main_abort(void);
-int init_main_log(void);
-int init_main_ok(void);
+int init_main_abort(int argc, char *argv[]);
+int init_main_log(int argc, char *argv[]);
+int init_main_ok(int argc, char *argv[]);
#endif
@@ -5,7 +5,7 @@
*/
#include "init.h"
-int main(void)
+int main(int argc, char *argv[])
{
- return init_main_abort();
+ return init_main_abort(argc, argv);
}
@@ -5,7 +5,7 @@
*/
#include "init.h"
-int main(void)
+int main(int argc, char *argv[])
{
- return init_main_log();
+ return init_main_log(argc, argv);
}
@@ -5,7 +5,7 @@
*/
#include "init.h"
-int main(void)
+int main(int argc, char *argv[])
{
- return init_main_ok();
+ return init_main_ok(argc, argv);
}
As the tests themselves do not have specific args, they just call the cunit_common parsing function to pick up cunit_common and helpers arguments. Signed-off-by: Christophe Milard <christophe.milard@linaro.org> --- test/validation/init/init.c | 18 +++++++++++++++--- test/validation/init/init.h | 6 +++--- test/validation/init/init_main_abort.c | 4 ++-- test/validation/init/init_main_log.c | 4 ++-- test/validation/init/init_main_ok.c | 4 ++-- 5 files changed, 24 insertions(+), 12 deletions(-)