@@ -866,10 +866,14 @@ odp_suiteinfo_t atomic_suites[] = {
ODP_SUITE_INFO_NULL
};
-int atomic_main(void)
+int atomic_main(int argc, char *argv[])
{
int ret;
+ /* parse common options: */
+ if (odp_cunit_parse_options(argc, argv))
+ return -1;
+
odp_cunit_register_global_init(atomic_init);
ret = odp_cunit_register(atomic_suites);
@@ -33,6 +33,6 @@ extern odp_suiteinfo_t atomic_suites[];
int atomic_init(odp_instance_t *inst);
/* main test program: */
-int atomic_main(void);
+int atomic_main(int argc, char *argv[]);
#endif
@@ -6,7 +6,7 @@
#include "atomic.h"
-int main(void)
+int main(int argc, char *argv[])
{
- return atomic_main();
+ return atomic_main(argc, argv);
}
@@ -378,10 +378,14 @@ odp_suiteinfo_t barrier_suites[] = {
ODP_SUITE_INFO_NULL
};
-int barrier_main(void)
+int barrier_main(int argc, char *argv[])
{
int ret;
+ /* parse common options: */
+ if (odp_cunit_parse_options(argc, argv))
+ return -1;
+
odp_cunit_register_global_init(barrier_init);
ret = odp_cunit_register(barrier_suites);
@@ -24,6 +24,6 @@ extern odp_suiteinfo_t barrier_suites[];
int barrier_init(odp_instance_t *inst);
/* main test program: */
-int barrier_main(void);
+int barrier_main(int argc, char *argv[]);
#endif
@@ -6,7 +6,7 @@
#include "barrier.h"
-int main(void)
+int main(int argc, char *argv[])
{
- return barrier_main();
+ return barrier_main(argc, argv);
}
@@ -257,9 +257,15 @@ odp_suiteinfo_t buffer_suites[] = {
ODP_SUITE_INFO_NULL,
};
-int buffer_main(void)
+int buffer_main(int argc, char *argv[])
{
- int ret = odp_cunit_register(buffer_suites);
+ int ret;
+
+ /* parse common options: */
+ if (odp_cunit_parse_options(argc, argv))
+ return -1;
+
+ ret = odp_cunit_register(buffer_suites);
if (ret == 0)
odp_cunit_run();
@@ -27,6 +27,6 @@ int buffer_suite_term(void);
extern odp_suiteinfo_t buffer_suites[];
/* main test program: */
-int buffer_main(void);
+int buffer_main(int argc, char *argv[]);
#endif
@@ -5,7 +5,7 @@
*/
#include "buffer.h"
-int main(void)
+int main(int argc, char *argv[])
{
- return buffer_main();
+ return buffer_main(argc, argv);
}
@@ -26,9 +26,15 @@ odp_suiteinfo_t classification_suites[] = {
ODP_SUITE_INFO_NULL,
};
-int classification_main(void)
+int classification_main(int argc, char *argv[])
{
- int ret = odp_cunit_register(classification_suites);
+ int ret;
+
+ /* parse common options: */
+ if (odp_cunit_parse_options(argc, argv))
+ return -1;
+
+ ret = odp_cunit_register(classification_suites);
if (ret == 0)
ret = odp_cunit_run();
@@ -90,6 +90,6 @@ int classification_suite_term(void);
extern odp_suiteinfo_t classification_suites[];
/* main test program: */
-int classification_main(void);
+int classification_main(int argc, char *argv[]);
#endif
@@ -6,7 +6,7 @@
#include "classification.h"
-int main(void)
+int main(int argc, char *argv[])
{
- return classification_main();
+ return classification_main(argc, argv);
}
@@ -99,9 +99,15 @@ odp_suiteinfo_t cpumask_suites[] = {
ODP_SUITE_INFO_NULL,
};
-int cpumask_main(void)
+int cpumask_main(int argc, char *argv[])
{
- int ret = odp_cunit_register(cpumask_suites);
+ int ret;
+
+ /* parse common options: */
+ if (odp_cunit_parse_options(argc, argv))
+ return -1;
+
+ ret = odp_cunit_register(cpumask_suites);
if (ret == 0)
ret = odp_cunit_run();
@@ -23,6 +23,6 @@ extern odp_testinfo_t cpumask_suite[];
extern odp_suiteinfo_t cpumask_suites[];
/* main test program: */
-int cpumask_main(void);
+int cpumask_main(int argc, char *argv[]);
#endif
@@ -5,7 +5,7 @@
*/
#include "cpumask.h"
-int main(void)
+int main(int argc, char *argv[])
{
- return cpumask_main();
+ return cpumask_main(argc, argv);
}
@@ -101,10 +101,14 @@ int crypto_term(odp_instance_t inst)
return 0;
}
-int crypto_main(void)
+int crypto_main(int argc, char *argv[])
{
int ret;
+ /* parse common options: */
+ if (odp_cunit_parse_options(argc, argv))
+ return -1;
+
odp_cunit_register_global_init(crypto_init);
odp_cunit_register_global_term(crypto_term);
@@ -40,6 +40,6 @@ int crypto_init(odp_instance_t *inst);
int crypto_term(odp_instance_t inst);
/* main test program: */
-int crypto_main(void);
+int crypto_main(int argc, char *argv[]);
#endif
@@ -6,7 +6,7 @@
#include "crypto.h"
-int main(void)
+int main(int argc, char *argv[])
{
- return crypto_main();
+ return crypto_main(argc, argv);
}
@@ -29,9 +29,15 @@ odp_suiteinfo_t errno_suites[] = {
ODP_SUITE_INFO_NULL,
};
-int errno_main(void)
+int errno_main(int argc, char *argv[])
{
- int ret = odp_cunit_register(errno_suites);
+ int ret;
+
+ /* parse common options: */
+ if (odp_cunit_parse_options(argc, argv))
+ return -1;
+
+ ret = odp_cunit_register(errno_suites);
if (ret == 0)
ret = odp_cunit_run();
@@ -19,6 +19,6 @@ extern odp_testinfo_t errno_suite[];
extern odp_suiteinfo_t errno_suites[];
/* main test program: */
-int errno_main(void);
+int errno_main(int argc, char *argv[]);
#endif
@@ -6,7 +6,7 @@
#include "errno.h"
-int main(void)
+int main(int argc, char *argv[])
{
- return errno_main();
+ return errno_main(argc, argv);
}
@@ -37,9 +37,15 @@ odp_suiteinfo_t hash_suites[] = {
ODP_SUITE_INFO_NULL
};
-int hash_main(void)
+int hash_main(int argc, char *argv[])
{
- int ret = odp_cunit_register(hash_suites);
+ int ret;
+
+ /* parse common options: */
+ if (odp_cunit_parse_options(argc, argv))
+ return -1;
+
+ ret = odp_cunit_register(hash_suites);
if (ret == 0)
ret = odp_cunit_run();
@@ -19,6 +19,6 @@ extern odp_testinfo_t hash_suite[];
extern odp_suiteinfo_t hash_suites[];
/* main test program: */
-int hash_main(void);
+int hash_main(int argc, char *argv[]);
#endif
@@ -6,7 +6,7 @@
#include "hash.h"
-int main(void)
+int main(int argc, char *argv[])
{
- return hash_main();
+ return hash_main(argc, argv);
}
@@ -1205,10 +1205,14 @@ odp_suiteinfo_t lock_suites[] = {
ODP_SUITE_INFO_NULL
};
-int lock_main(void)
+int lock_main(int argc, char *argv[])
{
int ret;
+ /* parse common options: */
+ if (odp_cunit_parse_options(argc, argv))
+ return -1;
+
odp_cunit_register_global_init(lock_init);
ret = odp_cunit_register(lock_suites);
@@ -40,6 +40,6 @@ extern odp_suiteinfo_t lock_suites[];
int lock_init(odp_instance_t *inst);
/* main test program: */
-int lock_main(void);
+int lock_main(int argc, char *argv[]);
#endif
@@ -6,7 +6,7 @@
#include "lock.h"
-int main(void)
+int main(int argc, char *argv[])
{
- return lock_main();
+ return lock_main(argc, argv);
}
@@ -1279,9 +1279,15 @@ odp_suiteinfo_t packet_suites[] = {
ODP_SUITE_INFO_NULL,
};
-int packet_main(void)
+int packet_main(int argc, char *argv[])
{
- int ret = odp_cunit_register(packet_suites);
+ int ret;
+
+ /* parse common options: */
+ if (odp_cunit_parse_options(argc, argv))
+ return -1;
+
+ ret = odp_cunit_register(packet_suites);
if (ret == 0)
ret = odp_cunit_run();
@@ -44,6 +44,6 @@ int packet_suite_term(void);
extern odp_suiteinfo_t packet_suites[];
/* main test program: */
-int packet_main(void);
+int packet_main(int argc, char *argv[]);
#endif
@@ -6,7 +6,7 @@
#include "packet.h"
-int main(void)
+int main(int argc, char *argv[])
{
- return packet_main();
+ return packet_main(argc, argv);
}
@@ -114,9 +114,15 @@ odp_suiteinfo_t pool_suites[] = {
ODP_SUITE_INFO_NULL,
};
-int pool_main(void)
+int pool_main(int argc, char *argv[])
{
- int ret = odp_cunit_register(pool_suites);
+ int ret;
+
+ /* parse common options: */
+ if (odp_cunit_parse_options(argc, argv))
+ return -1;
+
+ ret = odp_cunit_register(pool_suites);
if (ret == 0)
ret = odp_cunit_run();
@@ -23,6 +23,6 @@ extern odp_testinfo_t pool_suite[];
extern odp_suiteinfo_t pool_suites[];
/* main test program: */
-int pool_main(void);
+int pool_main(int argc, char *argv[]);
#endif
@@ -6,7 +6,7 @@
#include "pool.h"
-int main(void)
+int main(int argc, char *argv[])
{
- return pool_main();
+ return pool_main(argc, argv);
}
@@ -199,9 +199,15 @@ odp_suiteinfo_t queue_suites[] = {
ODP_SUITE_INFO_NULL,
};
-int queue_main(void)
+int queue_main(int argc, char *argv[])
{
- int ret = odp_cunit_register(queue_suites);
+ int ret;
+
+ /* parse common options: */
+ if (odp_cunit_parse_options(argc, argv))
+ return -1;
+
+ ret = odp_cunit_register(queue_suites);
if (ret == 0)
ret = odp_cunit_run();
@@ -24,6 +24,6 @@ int queue_suite_term(void);
extern odp_suiteinfo_t queue_suites[];
/* main test program: */
-int queue_main(void);
+int queue_main(int argc, char *argv[]);
#endif
@@ -6,7 +6,7 @@
#include "queue.h"
-int main(void)
+int main(int argc, char *argv[])
{
- return queue_main();
+ return queue_main(argc, argv);
}
@@ -27,9 +27,15 @@ odp_suiteinfo_t random_suites[] = {
ODP_SUITE_INFO_NULL,
};
-int random_main(void)
+int random_main(int argc, char *argv[])
{
- int ret = odp_cunit_register(random_suites);
+ int ret;
+
+ /* parse common options: */
+ if (odp_cunit_parse_options(argc, argv))
+ return -1;
+
+ ret = odp_cunit_register(random_suites);
if (ret == 0)
ret = odp_cunit_run();
@@ -19,6 +19,6 @@ extern odp_testinfo_t random_suite[];
extern odp_suiteinfo_t random_suites[];
/* main test program: */
-int random_main(void);
+int random_main(int argc, char *argv[]);
#endif
@@ -6,7 +6,7 @@
#include "random.h"
-int main(void)
+int main(int argc, char *argv[])
{
- return random_main();
+ return random_main(argc, argv);
}
@@ -1628,9 +1628,15 @@ odp_suiteinfo_t scheduler_suites[] = {
ODP_SUITE_INFO_NULL,
};
-int scheduler_main(void)
+int scheduler_main(int argc, char *argv[])
{
- int ret = odp_cunit_register(scheduler_suites);
+ int ret;
+
+ /* parse common options: */
+ if (odp_cunit_parse_options(argc, argv))
+ return -1;
+
+ ret = odp_cunit_register(scheduler_suites);
if (ret == 0)
ret = odp_cunit_run();
@@ -57,6 +57,6 @@ int scheduler_suite_term(void);
extern odp_suiteinfo_t scheduler_suites[];
/* main test program: */
-int scheduler_main(void);
+int scheduler_main(int argc, char *argv[]);
#endif
@@ -6,7 +6,7 @@
#include "scheduler.h"
-int main(void)
+int main(int argc, char *argv[])
{
- return scheduler_main();
+ return scheduler_main(argc, argv);
}
@@ -93,9 +93,15 @@ odp_suiteinfo_t std_clib_suites[] = {
ODP_SUITE_INFO_NULL
};
-int std_clib_main(void)
+int std_clib_main(int argc, char *argv[])
{
- int ret = odp_cunit_register(std_clib_suites);
+ int ret;
+
+ /* parse common options: */
+ if (odp_cunit_parse_options(argc, argv))
+ return -1;
+
+ ret = odp_cunit_register(std_clib_suites);
if (ret == 0)
ret = odp_cunit_run();
@@ -16,6 +16,6 @@ extern odp_testinfo_t std_clib_suite[];
extern odp_suiteinfo_t std_clib_suites[];
/* main test program: */
-int std_clib_main(void);
+int std_clib_main(int argc, char *argv[]);
#endif
@@ -6,7 +6,7 @@
#include "std_clib.h"
-int main(void)
+int main(int argc, char *argv[])
{
- return std_clib_main();
+ return std_clib_main(argc, argv);
}
@@ -327,9 +327,15 @@ odp_suiteinfo_t system_suites[] = {
ODP_SUITE_INFO_NULL,
};
-int system_main(void)
+int system_main(int argc, char *argv[])
{
- int ret = odp_cunit_register(system_suites);
+ int ret;
+
+ /* parse common options: */
+ if (odp_cunit_parse_options(argc, argv))
+ return -1;
+
+ ret = odp_cunit_register(system_suites);
if (ret == 0)
ret = odp_cunit_run();
@@ -38,6 +38,6 @@ extern odp_testinfo_t system_suite[];
extern odp_suiteinfo_t system_suites[];
/* main test program: */
-int system_main(void);
+int system_main(int argc, char *argv[]);
#endif
@@ -6,7 +6,7 @@
#include "system.h"
-int main(void)
+int main(int argc, char *argv[])
{
- return system_main();
+ return system_main(argc, argv);
}
@@ -123,9 +123,15 @@ odp_suiteinfo_t thread_suites[] = {
ODP_SUITE_INFO_NULL,
};
-int thread_main(void)
+int thread_main(int argc, char *argv[])
{
- int ret = odp_cunit_register(thread_suites);
+ int ret;
+
+ /* parse common options: */
+ if (odp_cunit_parse_options(argc, argv))
+ return -1;
+
+ ret = odp_cunit_register(thread_suites);
if (ret == 0)
ret = odp_cunit_run();
@@ -28,6 +28,6 @@ extern odp_testinfo_t thread_suite[];
extern odp_suiteinfo_t thread_suites[];
/* main test program: */
-int thread_main(void);
+int thread_main(int argc, char *argv[]);
#endif
@@ -6,7 +6,7 @@
#include "thread.h"
-int main(void)
+int main(int argc, char *argv[])
{
- return thread_main();
+ return thread_main(argc, argv);
}
@@ -459,9 +459,15 @@ odp_suiteinfo_t time_suites[] = {
ODP_SUITE_INFO_NULL
};
-int time_main(void)
+int time_main(int argc, char *argv[])
{
- int ret = odp_cunit_register(time_suites);
+ int ret;
+
+ /* parse common options: */
+ if (odp_cunit_parse_options(argc, argv))
+ return -1;
+
+ ret = odp_cunit_register(time_suites);
if (ret == 0)
ret = odp_cunit_run();
@@ -35,6 +35,6 @@ extern odp_testinfo_t time_suite_time[];
extern odp_suiteinfo_t time_suites[];
/* main test program: */
-int time_main(void);
+int time_main(int argc, char *argv[]);
#endif
@@ -6,7 +6,7 @@
#include "time.h"
-int main(void)
+int main(int argc, char *argv[])
{
- return time_main();
+ return time_main(argc, argv);
}
@@ -572,8 +572,12 @@ odp_suiteinfo_t timer_suites[] = {
ODP_SUITE_INFO_NULL,
};
-int timer_main(void)
+int timer_main(int argc, char *argv[])
{
+ /* parse common options: */
+ if (odp_cunit_parse_options(argc, argv))
+ return -1;
+
int ret = odp_cunit_register(timer_suites);
if (ret == 0)
@@ -22,6 +22,6 @@ extern odp_testinfo_t timer_suite[];
extern odp_suiteinfo_t timer_suites[];
/* main test program: */
-int timer_main(void);
+int timer_main(int argc, char *argv[]);
#endif
@@ -6,7 +6,7 @@
#include "timer.h"
-int main(void)
+int main(int argc, char *argv[])
{
- return timer_main();
+ return timer_main(argc, argv);
}
@@ -3836,8 +3836,12 @@ odp_suiteinfo_t traffic_mngr_suites[] = {
ODP_SUITE_INFO_NULL
};
-int traffic_mngr_main(void)
+int traffic_mngr_main(int argc, char *argv[])
{
+ /* parse common options: */
+ if (odp_cunit_parse_options(argc, argv))
+ return -1;
+
int ret = odp_cunit_register(traffic_mngr_suites);
if (ret == 0)
@@ -37,6 +37,6 @@ int traffic_mngr_suite_term(void);
extern odp_suiteinfo_t traffic_mngr_suites[];
/* main test program: */
-int traffic_mngr_main(void);
+int traffic_mngr_main(int argc, char *argv[]);
#endif
@@ -6,7 +6,7 @@
#include "traffic_mngr.h"
-int main(void)
+int main(int argc, char *argv[])
{
- return traffic_mngr_main();
+ return traffic_mngr_main(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. This was originally many patches, now squashed on maintener's request. init and pktio tests are still separated as they have specificities Signed-off-by: Christophe Milard <christophe.milard@linaro.org> --- test/validation/atomic/atomic.c | 6 +++++- test/validation/atomic/atomic.h | 2 +- test/validation/atomic/atomic_main.c | 4 ++-- test/validation/barrier/barrier.c | 6 +++++- test/validation/barrier/barrier.h | 2 +- test/validation/barrier/barrier_main.c | 4 ++-- test/validation/buffer/buffer.c | 10 ++++++++-- test/validation/buffer/buffer.h | 2 +- test/validation/buffer/buffer_main.c | 4 ++-- test/validation/classification/classification.c | 10 ++++++++-- test/validation/classification/classification.h | 2 +- test/validation/classification/classification_main.c | 4 ++-- test/validation/cpumask/cpumask.c | 10 ++++++++-- test/validation/cpumask/cpumask.h | 2 +- test/validation/cpumask/cpumask_main.c | 4 ++-- test/validation/crypto/crypto.c | 6 +++++- test/validation/crypto/crypto.h | 2 +- test/validation/crypto/crypto_main.c | 4 ++-- test/validation/errno/errno.c | 10 ++++++++-- test/validation/errno/errno.h | 2 +- test/validation/errno/errno_main.c | 4 ++-- test/validation/hash/hash.c | 10 ++++++++-- test/validation/hash/hash.h | 2 +- test/validation/hash/hash_main.c | 4 ++-- test/validation/lock/lock.c | 6 +++++- test/validation/lock/lock.h | 2 +- test/validation/lock/lock_main.c | 4 ++-- test/validation/packet/packet.c | 10 ++++++++-- test/validation/packet/packet.h | 2 +- test/validation/packet/packet_main.c | 4 ++-- test/validation/pool/pool.c | 10 ++++++++-- test/validation/pool/pool.h | 2 +- test/validation/pool/pool_main.c | 4 ++-- test/validation/queue/queue.c | 10 ++++++++-- test/validation/queue/queue.h | 2 +- test/validation/queue/queue_main.c | 4 ++-- test/validation/random/random.c | 10 ++++++++-- test/validation/random/random.h | 2 +- test/validation/random/random_main.c | 4 ++-- test/validation/scheduler/scheduler.c | 10 ++++++++-- test/validation/scheduler/scheduler.h | 2 +- test/validation/scheduler/scheduler_main.c | 4 ++-- test/validation/std_clib/std_clib.c | 10 ++++++++-- test/validation/std_clib/std_clib.h | 2 +- test/validation/std_clib/std_clib_main.c | 4 ++-- test/validation/system/system.c | 10 ++++++++-- test/validation/system/system.h | 2 +- test/validation/system/system_main.c | 4 ++-- test/validation/thread/thread.c | 10 ++++++++-- test/validation/thread/thread.h | 2 +- test/validation/thread/thread_main.c | 4 ++-- test/validation/time/time.c | 10 ++++++++-- test/validation/time/time.h | 2 +- test/validation/time/time_main.c | 4 ++-- test/validation/timer/timer.c | 6 +++++- test/validation/timer/timer.h | 2 +- test/validation/timer/timer_main.c | 4 ++-- test/validation/traffic_mngr/traffic_mngr.c | 6 +++++- test/validation/traffic_mngr/traffic_mngr.h | 2 +- test/validation/traffic_mngr/traffic_mngr_main.c | 4 ++-- 60 files changed, 202 insertions(+), 94 deletions(-)