From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wg0-f49.google.com (mail-wg0-f49.google.com [74.125.82.49]) by dpdk.org (Postfix) with ESMTP id 6BBA1B385 for ; Mon, 18 Aug 2014 13:26:27 +0200 (CEST) Received: by mail-wg0-f49.google.com with SMTP id k14so4914456wgh.32 for ; Mon, 18 Aug 2014 04:29:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=kUA1o5UMUoiGWJDdMQ94gIF5YhLiZd1LWTa/V7f9LL4=; b=fPkEXfL2HS/pAutwmNCEu8G2TyRCyN6X8RSZdpzY2D+oylGdjx+UGp+8Aj+uezM+ew w0FycbfYAfUNTmIiWjXJEeB1yZ7zsSUMoqCppfH1iDUuBKYbz7Ru2gC80IWvYg12aVmt VPE0exUI88tnc+lLcT+DlUC9pMyMIR3/h3ySXsn+EiFFt5s00TV/b/J6tevwCwq4qKaU dAPrG/pj6GSgwQ4ePCz3g1sJp01cDoZXHiqqZ3Ic8GGvqtWjRB4lE5xR5VombQrunTz+ +5rPAlpUDMcl499pssqxR6bnxq2GdLABHfiaqlc2PcOXlUfFe3yFLss5LtTHTQIp4n/f WegA== X-Gm-Message-State: ALoCoQkPvvCPFXH7rmg8WQ4+BhhNbASHRI7d6kAdrDOfbwGe0q2yEZFAIph91UyQ3A0hHdSlvhFt X-Received: by 10.194.206.67 with SMTP id lm3mr42200836wjc.70.1408361390168; Mon, 18 Aug 2014 04:29:50 -0700 (PDT) Received: from alcyon.dev.6wind.com (guy78-3-82-239-227-177.fbx.proxad.net. [82.239.227.177]) by mx.google.com with ESMTPSA id es9sm41617207wjd.1.2014.08.18.04.29.48 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Aug 2014 04:29:49 -0700 (PDT) From: David Marchand To: dev@dpdk.org Date: Mon, 18 Aug 2014 13:29:23 +0200 Message-Id: <1408361365-12988-6-git-send-email-david.marchand@6wind.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1408361365-12988-1-git-send-email-david.marchand@6wind.com> References: <1408361365-12988-1-git-send-email-david.marchand@6wind.com> Subject: [dpdk-dev] [PATCH v2 5/7] app/test: convert all tests to register system X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Aug 2014 11:26:27 -0000 Remove all tests from the builtin commands list and use the dynamic commands list register macro. Signed-off-by: David Marchand --- app/test/commands.c | 157 +------------------------------------- app/test/test.c | 2 + app/test/test.h | 55 +------------ app/test/test_acl.c | 15 ++-- app/test/test_alarm.c | 7 +- app/test/test_atomic.c | 7 +- app/test/test_byteorder.c | 8 +- app/test/test_cmdline.c | 13 ++-- app/test/test_common.c | 8 +- app/test/test_cpuflags.c | 8 +- app/test/test_cycles.c | 8 +- app/test/test_debug.c | 8 +- app/test/test_devargs.c | 8 +- app/test/test_distributor.c | 18 ++--- app/test/test_distributor_perf.c | 18 ++--- app/test/test_eal_flags.c | 18 ++--- app/test/test_eal_fs.c | 15 ++-- app/test/test_errno.c | 8 +- app/test/test_func_reentrancy.c | 8 +- app/test/test_hash.c | 16 ++-- app/test/test_hash_perf.c | 16 ++-- app/test/test_interrupts.c | 7 +- app/test/test_ivshmem.c | 12 ++- app/test/test_kni.c | 16 ++-- app/test/test_kvargs.c | 9 ++- app/test/test_link_bonding.c | 8 +- app/test/test_logs.c | 8 +- app/test/test_lpm.c | 16 ++-- app/test/test_lpm6.c | 16 ++-- app/test/test_malloc.c | 8 +- app/test/test_mbuf.c | 8 +- app/test/test_memcpy.c | 8 +- app/test/test_memcpy_perf.c | 8 +- app/test/test_memory.c | 8 +- app/test/test_mempool.c | 8 +- app/test/test_mempool_perf.c | 8 +- app/test/test_memzone.c | 8 +- app/test/test_meter.c | 15 ++-- app/test/test_mp_secondary.c | 17 ++--- app/test/test_pci.c | 6 ++ app/test/test_per_lcore.c | 8 +- app/test/test_pmd_ring.c | 15 ++-- app/test/test_power.c | 16 ++-- app/test/test_prefetch.c | 8 +- app/test/test_red.c | 17 ++--- app/test/test_ring.c | 8 +- app/test/test_ring_perf.c | 8 +- app/test/test_rwlock.c | 8 +- app/test/test_sched.c | 15 ++-- app/test/test_spinlock.c | 8 +- app/test/test_string_fns.c | 8 +- app/test/test_table.c | 19 ++--- app/test/test_table.h | 1 - app/test/test_tailq.c | 8 +- app/test/test_timer.c | 15 ++-- app/test/test_timer_perf.c | 15 ++-- app/test/test_version.c | 8 +- 57 files changed, 358 insertions(+), 442 deletions(-) diff --git a/app/test/commands.c b/app/test/commands.c index a1ffd43..0640ac9 100644 --- a/app/test/commands.c +++ b/app/test/commands.c @@ -104,122 +104,6 @@ static void cmd_autotest_parsed(void *parsed_result, ret = t->callback(); } - if (!strcmp(res->autotest, "version_autotest")) - ret = test_version(); - if (!strcmp(res->autotest, "eal_fs_autotest")) - ret = test_eal_fs(); - if (!strcmp(res->autotest, "debug_autotest")) - ret = test_debug(); - if (!strcmp(res->autotest, "pci_autotest")) - ret = test_pci(); - if (!strcmp(res->autotest, "prefetch_autotest")) - ret = test_prefetch(); - if (!strcmp(res->autotest, "byteorder_autotest")) - ret = test_byteorder(); - if (!strcmp(res->autotest, "per_lcore_autotest")) - ret = test_per_lcore(); - if (!strcmp(res->autotest, "atomic_autotest")) - ret = test_atomic(); - if (!strcmp(res->autotest, "malloc_autotest")) - ret = test_malloc(); - if (!strcmp(res->autotest, "spinlock_autotest")) - ret = test_spinlock(); - if (!strcmp(res->autotest, "memory_autotest")) - ret = test_memory(); - if (!strcmp(res->autotest, "memzone_autotest")) - ret = test_memzone(); - if (!strcmp(res->autotest, "rwlock_autotest")) - ret = test_rwlock(); - if (!strcmp(res->autotest, "mbuf_autotest")) - ret = test_mbuf(); - if (!strcmp(res->autotest, "logs_autotest")) - ret = test_logs(); - if (!strcmp(res->autotest, "errno_autotest")) - ret = test_errno(); - if (!strcmp(res->autotest, "hash_autotest")) - ret = test_hash(); - if (!strcmp(res->autotest, "hash_perf_autotest")) - ret = test_hash_perf(); - if (!strcmp(res->autotest, "lpm_autotest")) - ret = test_lpm(); - if (!strcmp(res->autotest, "lpm6_autotest")) - ret = test_lpm6(); - if (!strcmp(res->autotest, "cpuflags_autotest")) - ret = test_cpuflags(); - if (!strcmp(res->autotest, "cmdline_autotest")) - ret = test_cmdline(); - if (!strcmp(res->autotest, "tailq_autotest")) - ret = test_tailq(); - if (!strcmp(res->autotest, "multiprocess_autotest")) - ret = test_mp_secondary(); - if (!strcmp(res->autotest, "memcpy_autotest")) - ret = test_memcpy(); - if (!strcmp(res->autotest, "string_autotest")) - ret = test_string_fns(); - if (!strcmp(res->autotest, "eal_flags_autotest")) - ret = test_eal_flags(); - if (!strcmp(res->autotest, "alarm_autotest")) - ret = test_alarm(); - if (!strcmp(res->autotest, "interrupt_autotest")) - ret = test_interrupt(); - if (!strcmp(res->autotest, "cycles_autotest")) - ret = test_cycles(); - if (!strcmp(res->autotest, "ring_autotest")) - ret = test_ring(); - if (!strcmp(res->autotest, "table_autotest")) - ret = test_table(); - if (!strcmp(res->autotest, "ring_perf_autotest")) - ret = test_ring_perf(); - if (!strcmp(res->autotest, "timer_autotest")) - ret = test_timer(); - if (!strcmp(res->autotest, "timer_perf_autotest")) - ret = test_timer_perf(); -#ifdef RTE_LIBRTE_PMD_BOND - if (!strcmp(res->autotest, "link_bonding_autotest")) - ret = test_link_bonding(); -#endif - if (!strcmp(res->autotest, "mempool_autotest")) - ret = test_mempool(); - if (!strcmp(res->autotest, "mempool_perf_autotest")) - ret = test_mempool_perf(); - if (!strcmp(res->autotest, "memcpy_perf_autotest")) - ret = test_memcpy_perf(); - if (!strcmp(res->autotest, "func_reentrancy_autotest")) - ret = test_func_reentrancy(); - if (!strcmp(res->autotest, "red_autotest")) - ret = test_red(); - if (!strcmp(res->autotest, "sched_autotest")) - ret = test_sched(); - if (!strcmp(res->autotest, "meter_autotest")) - ret = test_meter(); - if (!strcmp(res->autotest, "kni_autotest")) - ret = test_kni(); - if (!strcmp(res->autotest, "power_autotest")) - ret = test_power(); - if (!strcmp(res->autotest, "common_autotest")) - ret = test_common(); - if (!strcmp(res->autotest, "ivshmem_autotest")) - ret = test_ivshmem(); - if (!strcmp(res->autotest, "distributor_autotest")) - ret = test_distributor(); - if (!strcmp(res->autotest, "distributor_perf_autotest")) - ret = test_distributor_perf(); - if (!strcmp(res->autotest, "devargs_autotest")) - ret = test_devargs(); -#ifdef RTE_LIBRTE_PMD_RING - if (!strcmp(res->autotest, "ring_pmd_autotest")) - ret = test_pmd_ring(); -#endif /* RTE_LIBRTE_PMD_RING */ - -#ifdef RTE_LIBRTE_ACL - if (!strcmp(res->autotest, "acl_autotest")) - ret = test_acl(); -#endif /* RTE_LIBRTE_ACL */ -#ifdef RTE_LIBRTE_KVARGS - if (!strcmp(res->autotest, "kvargs_autotest")) - ret |= test_kvargs(); -#endif /* RTE_LIBRTE_KVARGS */ - if (ret == 0) printf("Test OK\n"); else @@ -440,46 +324,7 @@ cmdline_parse_ctx_t main_ctx[] = { int commands_init(void) { struct test_command *t; - char builtin_commands[] = - "pci_autotest#memory_autotest#" - "per_lcore_autotest#spinlock_autotest#" - "rwlock_autotest#atomic_autotest#" - "byteorder_autotest#prefetch_autotest#" - "cycles_autotest#logs_autotest#" - "memzone_autotest#ring_autotest#" - "mempool_autotest#mbuf_autotest#" - "timer_autotest#malloc_autotest#" - "memcpy_autotest#hash_autotest#" - "lpm_autotest#debug_autotest#" - "lpm6_autotest#" - "errno_autotest#tailq_autotest#" - "string_autotest#multiprocess_autotest#" - "cpuflags_autotest#eal_flags_autotest#" - "alarm_autotest#interrupt_autotest#" - "version_autotest#eal_fs_autotest#" - "cmdline_autotest#func_reentrancy_autotest#" -#ifdef RTE_LIBRTE_PMD_BOND - "link_bonding_autotest#" -#endif - "mempool_perf_autotest#hash_perf_autotest#" - "memcpy_perf_autotest#ring_perf_autotest#" - "red_autotest#meter_autotest#sched_autotest#" - "memcpy_perf_autotest#kni_autotest#" - "ivshmem_autotest#" - "devargs_autotest#table_autotest#" -#ifdef RTE_LIBRTE_ACL - "acl_autotest#" -#endif - "power_autotest#" - "timer_perf_autotest#" -#ifdef RTE_LIBRTE_PMD_RING - "ring_pmd_autotest#" -#endif -#ifdef RTE_LIBRTE_KVARGS - "kvargs_autotest#" -#endif - "common_autotest#" - "distributor_autotest#distributor_perf_autotest"; + char builtin_commands[] = ""; char *commands, *ptr; int commands_len = strlen(builtin_commands) + 1; diff --git a/app/test/test.c b/app/test/test.c index a33b2b5..9bee6bb 100644 --- a/app/test/test.c +++ b/app/test/test.c @@ -96,7 +96,9 @@ do_recursive_call(void) { "test_memory_flags", no_action }, { "test_file_prefix", no_action }, { "test_no_huge_flag", no_action }, +#ifdef RTE_LIBRTE_IVSHMEM { "test_ivshmem", test_ivshmem }, +#endif }; if (recursive_call == NULL) diff --git a/app/test/test.h b/app/test/test.h index bba0ec5..98ab804 100644 --- a/app/test/test.h +++ b/app/test/test.h @@ -132,60 +132,11 @@ int commands_init(void); int main(int argc, char **argv); int test_pci(void); -int test_memory(void); -int test_per_lcore(void); -int test_spinlock(void); -int test_rwlock(void); -int test_atomic(void); -int test_byteorder(void); -int test_prefetch(void); -int test_cycles(void); -int test_logs(void); -int test_memzone(void); -int test_ring(void); -int test_table(void); -int test_ring_perf(void); -int test_mempool(void); -int test_mempool_perf(void); -int test_mbuf(void); -int test_timer(void); -int test_timer_perf(void); -int test_malloc(void); -int test_memcpy(void); -int test_memcpy_perf(void); -int test_hash(void); -int test_hash_perf(void); -int test_lpm(void); -int test_lpm6(void); -int test_debug(void); -int test_errno(void); -int test_tailq(void); -int test_string_fns(void); +int test_pci_run; + int test_mp_secondary(void); -int test_cpuflags(void); -int test_eal_flags(void); -int test_alarm(void); -int test_interrupt(void); -int test_version(void); -int test_eal_fs(void); -int test_cmdline(void); -int test_func_reentrancy(void); -int test_red(void); -int test_sched(void); -int test_meter(void); -int test_acl(void); -int test_kni(void); -int test_power(void); -int test_common(void); -int test_pmd_ring(void); -int test_ivshmem(void); -int test_distributor(void); -int test_distributor_perf(void); -int test_kvargs(void); -int test_devargs(void); -int test_link_bonding(void); -int test_pci_run; +int test_ivshmem(void); typedef int (test_callback)(void); TAILQ_HEAD(test_commands_list, test_command); diff --git a/app/test/test_acl.c b/app/test/test_acl.c index 869f6d3..4e7b470 100644 --- a/app/test/test_acl.c +++ b/app/test/test_acl.c @@ -910,7 +910,7 @@ test_misc(void) return 0; } -int +static int test_acl(void) { if (test_invalid_parameters() < 0) @@ -928,13 +928,10 @@ test_acl(void) return 0; } -#else - -int -test_acl(void) -{ - printf("This binary was not compiled with ACL support!\n"); - return 0; -} +static struct test_command acl_cmd = { + .command = "acl_autotest", + .callback = test_acl, +}; +REGISTER_TEST_COMMAND(acl_cmd); #endif /* RTE_LIBRTE_ACL */ diff --git a/app/test/test_alarm.c b/app/test/test_alarm.c index d5bea5e..5d6f4a2 100644 --- a/app/test/test_alarm.c +++ b/app/test/test_alarm.c @@ -199,7 +199,7 @@ test_multi_alarms(void) return 0; } -int +static int test_alarm(void) { int count = 0; @@ -253,3 +253,8 @@ test_alarm(void) return 0; } +static struct test_command alarm_cmd = { + .command = "alarm_autotest", + .callback = test_alarm, +}; +REGISTER_TEST_COMMAND(alarm_cmd); diff --git a/app/test/test_atomic.c b/app/test/test_atomic.c index 141cc22..3347413 100644 --- a/app/test/test_atomic.c +++ b/app/test/test_atomic.c @@ -248,7 +248,7 @@ test_atomic_dec_and_test(__attribute__((unused)) void *arg) return 0; } -int +static int test_atomic(void) { rte_atomic16_init(&a16); @@ -375,3 +375,8 @@ test_atomic(void) return 0; } +static struct test_command atomic_cmd = { + .command = "atomic_autotest", + .callback = test_atomic, +}; +REGISTER_TEST_COMMAND(atomic_cmd); diff --git a/app/test/test_byteorder.c b/app/test/test_byteorder.c index 38f8d39..a088489 100644 --- a/app/test/test_byteorder.c +++ b/app/test/test_byteorder.c @@ -52,7 +52,7 @@ static volatile uint64_t u64 = 0xdeadcafebabefaceULL; * size (16, 32, 64 bits) */ -int +static int test_byteorder(void) { uint16_t res_u16; @@ -91,3 +91,9 @@ test_byteorder(void) return 0; } + +static struct test_command byteorder_cmd = { + .command = "byteorder_autotest", + .callback = test_byteorder, +}; +REGISTER_TEST_COMMAND(byteorder_cmd); diff --git a/app/test/test_cmdline.c b/app/test/test_cmdline.c index 10a3f77..9b8bd5c 100644 --- a/app/test/test_cmdline.c +++ b/app/test/test_cmdline.c @@ -36,10 +36,10 @@ #include "test.h" #include "test_cmdline.h" -int +#ifdef RTE_LIBRTE_CMDLINE +static int test_cmdline(void) { -#ifdef RTE_LIBRTE_CMDLINE printf("Testind parsing ethernet addresses...\n"); if (test_parse_etheraddr_valid() < 0) return -1; @@ -87,9 +87,12 @@ test_cmdline(void) printf("Testing library functions...\n"); if (test_cmdline_lib() < 0) return -1; -#else - printf("The cmdline library is not included in this build\n"); -#endif return 0; } +static struct test_command cmdline_cmd = { + .command = "cmdline_autotest", + .callback = test_cmdline, +}; +REGISTER_TEST_COMMAND(cmdline_cmd); +#endif diff --git a/app/test/test_common.c b/app/test/test_common.c index 628201b..4b71e7b 100644 --- a/app/test/test_common.c +++ b/app/test/test_common.c @@ -158,7 +158,7 @@ test_align(void) return 0; } -int +static int test_common(void) { int ret = 0; @@ -168,3 +168,9 @@ test_common(void) return ret; } + +static struct test_command common_cmd = { + .command = "common_autotest", + .callback = test_common, +}; +REGISTER_TEST_COMMAND(common_cmd); diff --git a/app/test/test_cpuflags.c b/app/test/test_cpuflags.c index cb49384..82c0197 100644 --- a/app/test/test_cpuflags.c +++ b/app/test/test_cpuflags.c @@ -74,7 +74,7 @@ cpu_flag_result(int result) * - Check if register and CPUID functions fail properly */ -int +static int test_cpuflags(void) { int result; @@ -129,3 +129,9 @@ test_cpuflags(void) return 0; } + +static struct test_command cpuflags_cmd = { + .command = "cpuflags_autotest", + .callback = test_cpuflags, +}; +REGISTER_TEST_COMMAND(cpuflags_cmd); diff --git a/app/test/test_cycles.c b/app/test/test_cycles.c index b8d66a0..d8fa517 100644 --- a/app/test/test_cycles.c +++ b/app/test/test_cycles.c @@ -52,7 +52,7 @@ * of cycles is correct with regard to the frequency of the timer. */ -int +static int test_cycles(void) { unsigned i; @@ -88,3 +88,9 @@ test_cycles(void) return 0; } + +static struct test_command cycles_cmd = { + .command = "cycles_autotest", + .callback = test_cycles, +}; +REGISTER_TEST_COMMAND(cycles_cmd); diff --git a/app/test/test_debug.c b/app/test/test_debug.c index 135b75d..4659e46 100644 --- a/app/test/test_debug.c +++ b/app/test/test_debug.c @@ -156,7 +156,7 @@ test_usage(void) return 0; } -int +static int test_debug(void) { rte_dump_stack(); @@ -169,3 +169,9 @@ test_debug(void) return -1; return 0; } + +static struct test_command debug_cmd = { + .command = "debug_autotest", + .callback = test_debug, +}; +REGISTER_TEST_COMMAND(debug_cmd); diff --git a/app/test/test_devargs.c b/app/test/test_devargs.c index 63eee0b..f0acf8e 100644 --- a/app/test/test_devargs.c +++ b/app/test/test_devargs.c @@ -52,7 +52,7 @@ static void free_devargs_list(void) } } -int +static int test_devargs(void) { struct rte_devargs_list save_devargs_list; @@ -129,3 +129,9 @@ test_devargs(void) devargs_list = save_devargs_list; return -1; } + +static struct test_command devargs_cmd = { + .command = "devargs_autotest", + .callback = test_devargs, +}; +REGISTER_TEST_COMMAND(devargs_cmd); diff --git a/app/test/test_distributor.c b/app/test/test_distributor.c index 7648ed1..b29bef8 100644 --- a/app/test/test_distributor.c +++ b/app/test/test_distributor.c @@ -503,7 +503,7 @@ quit_workers(struct rte_distributor *d, struct rte_mempool *p) #define MBUF_SIZE (2048 + sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM) -int +static int test_distributor(void) { static struct rte_distributor *d; @@ -581,15 +581,9 @@ err: return -1; } -#else - -#include - -int -test_distributor(void) -{ - printf("Distributor is not enabled in configuration\n"); - return 0; -} - +static struct test_command distributor_cmd = { + .command = "distributor_autotest", + .callback = test_distributor, +}; +REGISTER_TEST_COMMAND(distributor_cmd); #endif diff --git a/app/test/test_distributor_perf.c b/app/test/test_distributor_perf.c index 1031baa..8a6b855 100644 --- a/app/test/test_distributor_perf.c +++ b/app/test/test_distributor_perf.c @@ -212,7 +212,7 @@ quit_workers(struct rte_distributor *d, struct rte_mempool *p) #define MBUF_SIZE (2048 + sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM) -int +static int test_distributor_perf(void) { static struct rte_distributor *d; @@ -261,15 +261,9 @@ test_distributor_perf(void) return 0; } -#else - -#include - -int -test_distributor_perf(void) -{ - printf("Distributor is not enabled in configuration\n"); - return 0; -} - +static struct test_command distributor_perf_cmd = { + .command = "distributor_perf_autotest", + .callback = test_distributor_perf, +}; +REGISTER_TEST_COMMAND(distributor_perf_cmd); #endif diff --git a/app/test/test_eal_flags.c b/app/test/test_eal_flags.c index 729d4ee..2d81764 100644 --- a/app/test/test_eal_flags.c +++ b/app/test/test_eal_flags.c @@ -1204,7 +1204,7 @@ test_memory_flags(void) return 0; } -int +static int test_eal_flags(void) { int ret = 0; @@ -1283,15 +1283,9 @@ test_eal_flags(void) return ret; } -#else -/* Baremetal version - * Multiprocess not applicable, so just return 0 always - */ -int -test_eal_flags(void) -{ - printf("Multi-process not possible for baremetal, cannot test EAL flags\n"); - return 0; -} - +static struct test_command eal_flags_cmd = { + .command = "eal_flags_autotest", + .callback = test_eal_flags, +}; +REGISTER_TEST_COMMAND(eal_flags_cmd); #endif diff --git a/app/test/test_eal_fs.c b/app/test/test_eal_fs.c index b28ca6c..8d4edc1 100644 --- a/app/test/test_eal_fs.c +++ b/app/test/test_eal_fs.c @@ -196,18 +196,17 @@ error: return -1; } -int +static int test_eal_fs(void) { if (test_parse_sysfs_value() < 0) return -1; return 0; } -#else -/* baremetal does not have a filesystem */ -int -test_eal_fs(void) -{ - return 0; -} + +static struct test_command eal_fs_cmd = { + .command = "eal_fs_autotest", + .callback = test_eal_fs, +}; +REGISTER_TEST_COMMAND(eal_fs_cmd); #endif diff --git a/app/test/test_errno.c b/app/test/test_errno.c index 93ad0b5..c903b19 100644 --- a/app/test/test_errno.c +++ b/app/test/test_errno.c @@ -42,7 +42,7 @@ #include "test.h" -int +static int test_errno(void) { const char *rte_retval; @@ -112,3 +112,9 @@ test_errno(void) return 0; } + +static struct test_command errno_cmd = { + .command = "errno_autotest", + .callback = test_errno, +}; +REGISTER_TEST_COMMAND(errno_cmd); diff --git a/app/test/test_func_reentrancy.c b/app/test/test_func_reentrancy.c index 0955b0a..45928fa 100644 --- a/app/test/test_func_reentrancy.c +++ b/app/test/test_func_reentrancy.c @@ -465,7 +465,7 @@ launch_test(struct test_case *pt_case) /** * Main entry of func_reentrancy test */ -int +static int test_func_reentrancy(void) { uint32_t case_id; @@ -492,3 +492,9 @@ test_func_reentrancy(void) return 0; } + +static struct test_command func_reentrancy_cmd = { + .command = "func_reentrancy_autotest", + .callback = test_func_reentrancy, +}; +REGISTER_TEST_COMMAND(func_reentrancy_cmd); diff --git a/app/test/test_hash.c b/app/test/test_hash.c index 87de3c6..ae3238b 100644 --- a/app/test/test_hash.c +++ b/app/test/test_hash.c @@ -1330,7 +1330,8 @@ fail_jhash_3word: /* * Do all unit and performance tests. */ -int test_hash(void) +static int +test_hash(void) { if (test_add_delete() < 0) return -1; @@ -1366,13 +1367,10 @@ int test_hash(void) return 0; } -#else /* RTE_LIBRTE_HASH */ - -int -test_hash(void) -{ - printf("The Hash library is not included in this build\n"); - return 0; -} +static struct test_command hash_cmd = { + .command = "hash_autotest", + .callback = test_hash, +}; +REGISTER_TEST_COMMAND(hash_cmd); #endif /* RTE_LIBRTE_HASH */ diff --git a/app/test/test_hash_perf.c b/app/test/test_hash_perf.c index 1e9c16e..d3e9990 100644 --- a/app/test/test_hash_perf.c +++ b/app/test/test_hash_perf.c @@ -761,7 +761,8 @@ fbk_hash_perf_test(void) /* * Do all unit and performance tests. */ -int test_hash_perf(void) +static int +test_hash_perf(void) { if (run_all_tbl_perf_tests() < 0) return -1; @@ -771,13 +772,10 @@ int test_hash_perf(void) return -1; return 0; } -#else /* RTE_LIBRTE_HASH */ - -int -test_hash_perf(void) -{ - printf("The Hash library is not included in this build\n"); - return 0; -} +static struct test_command hash_perf_cmd = { + .command = "hash_perf_autotest", + .callback = test_hash_perf, +}; +REGISTER_TEST_COMMAND(hash_perf_cmd); #endif /* RTE_LIBRTE_HASH */ diff --git a/app/test/test_interrupts.c b/app/test/test_interrupts.c index 4563e2b..61fdc56 100644 --- a/app/test/test_interrupts.c +++ b/app/test/test_interrupts.c @@ -395,7 +395,7 @@ test_interrupt_full_path_check(enum test_interrupt_handle_type intr_type) /** * Main function of testing interrupt. */ -int +static int test_interrupt(void) { int ret = -1; @@ -548,3 +548,8 @@ out: return ret; } +static struct test_command interrupt_cmd = { + .command = "interrupt_autotest", + .callback = test_interrupt, +}; +REGISTER_TEST_COMMAND(interrupt_cmd); diff --git a/app/test/test_ivshmem.c b/app/test/test_ivshmem.c index 1404ada..e759939 100644 --- a/app/test/test_ivshmem.c +++ b/app/test/test_ivshmem.c @@ -431,12 +431,10 @@ test_ivshmem(void) return -1; } -#else /* RTE_LIBRTE_IVSHMEM */ -int -test_ivshmem(void) -{ - printf("This binary was not compiled with IVSHMEM support!\n"); - return 0; -} +static struct test_command ivshmem_cmd = { + .command = "ivshmem_autotest", + .callback = test_ivshmem, +}; +REGISTER_TEST_COMMAND(ivshmem_cmd); #endif /* RTE_LIBRTE_IVSHMEM */ diff --git a/app/test/test_kni.c b/app/test/test_kni.c index 962bfad..60683d2 100644 --- a/app/test/test_kni.c +++ b/app/test/test_kni.c @@ -488,7 +488,7 @@ fail_kni: return ret; } -int +static int test_kni(void) { int ret = -1; @@ -680,13 +680,9 @@ fail: return ret; } -#else /* RTE_LIBRTE_KNI */ - -int -test_kni(void) -{ - printf("The KNI library is not included in this build\n"); - return 0; -} - +static struct test_command kni_cmd = { + .command = "kni_autotest", + .callback = test_kni, +}; +REGISTER_TEST_COMMAND(kni_cmd); #endif /* RTE_LIBRTE_KNI */ diff --git a/app/test/test_kvargs.c b/app/test/test_kvargs.c index c417ba2..b8f5e5c 100644 --- a/app/test/test_kvargs.c +++ b/app/test/test_kvargs.c @@ -223,7 +223,8 @@ static int test_invalid_kvargs(void) return -1; } -int test_kvargs(void) +static int +test_kvargs(void) { printf("== test valid case ==\n"); if (test_valid_kvargs() < 0) @@ -233,3 +234,9 @@ int test_kvargs(void) return -1; return 0; } + +static struct test_command kvargs_cmd = { + .command = "kvargs_autotest", + .callback = test_kvargs, +}; +REGISTER_TEST_COMMAND(kvargs_cmd); diff --git a/app/test/test_link_bonding.c b/app/test/test_link_bonding.c index 5c1303e..db5b180 100644 --- a/app/test/test_link_bonding.c +++ b/app/test/test_link_bonding.c @@ -3810,8 +3810,14 @@ static struct unit_test_suite link_bonding_test_suite = { }; -int +static int test_link_bonding(void) { return unit_test_suite_runner(&link_bonding_test_suite); } + +static struct test_command link_bonding_cmd = { + .command = "link_bonding_autotest", + .callback = test_link_bonding, +}; +REGISTER_TEST_COMMAND(link_bonding_cmd); diff --git a/app/test/test_logs.c b/app/test/test_logs.c index 67daa5b..2063c74 100644 --- a/app/test/test_logs.c +++ b/app/test/test_logs.c @@ -59,7 +59,7 @@ * - Send logs with different types and levels, some should not be displayed. */ -int +static int test_logs(void) { /* enable these logs type */ @@ -90,3 +90,9 @@ test_logs(void) return 0; } + +static struct test_command logs_cmd = { + .command = "logs_autotest", + .callback = test_logs, +}; +REGISTER_TEST_COMMAND(logs_cmd); diff --git a/app/test/test_lpm.c b/app/test/test_lpm.c index 05f0a93..087d97a 100644 --- a/app/test/test_lpm.c +++ b/app/test/test_lpm.c @@ -1332,7 +1332,7 @@ perf_test(void) * Do all unit and performance tests. */ -int +static int test_lpm(void) { unsigned i; @@ -1349,13 +1349,9 @@ test_lpm(void) return global_status; } -#else /* RTE_LIBRTE_LPM */ - -int -test_lpm(void) -{ - printf("The LPM library is not included in this build\n"); - return 0; -} - +static struct test_command lpm_cmd = { + .command = "lpm_autotest", + .callback = test_lpm, +}; +REGISTER_TEST_COMMAND(lpm_cmd); #endif /* RTE_LIBRTE_LPM */ diff --git a/app/test/test_lpm6.c b/app/test/test_lpm6.c index 982930b..bd99125 100644 --- a/app/test/test_lpm6.c +++ b/app/test/test_lpm6.c @@ -1902,7 +1902,7 @@ perf_test(void) /* * Do all unit and performance tests. */ -int +static int test_lpm6(void) { unsigned i; @@ -1920,13 +1920,9 @@ test_lpm6(void) return global_status; } -#else /* RTE_LIBRTE_LPM */ - -int -test_lpm6(void) -{ - printf("The LPM library is not included in this build\n"); - return 0; -} - +static struct test_command lpm6_cmd = { + .command = "lpm6_autotest", + .callback = test_lpm6, +}; +REGISTER_TEST_COMMAND(lpm6_cmd); #endif /* RTE_LIBRTE_LPM */ diff --git a/app/test/test_malloc.c b/app/test/test_malloc.c index 0817151..ee34ca3 100644 --- a/app/test/test_malloc.c +++ b/app/test/test_malloc.c @@ -924,7 +924,7 @@ test_alloc_socket(void) return 0; } -int +static int test_malloc(void) { unsigned lcore_id; @@ -1045,3 +1045,9 @@ test_malloc(void) return 0; } + +static struct test_command malloc_cmd = { + .command = "malloc_autotest", + .callback = test_malloc, +}; +REGISTER_TEST_COMMAND(malloc_cmd); diff --git a/app/test/test_mbuf.c b/app/test/test_mbuf.c index 2b87521..21024e7 100644 --- a/app/test/test_mbuf.c +++ b/app/test/test_mbuf.c @@ -829,7 +829,7 @@ test_failing_mbuf_sanity_check(void) #endif -int +static int test_mbuf(void) { RTE_BUILD_BUG_ON(sizeof(struct rte_mbuf) != 64); @@ -927,3 +927,9 @@ test_mbuf(void) } return 0; } + +static struct test_command mbuf_cmd = { + .command = "mbuf_autotest", + .callback = test_mbuf, +}; +REGISTER_TEST_COMMAND(mbuf_cmd); diff --git a/app/test/test_memcpy.c b/app/test/test_memcpy.c index ee0b0da..56b8e1e 100644 --- a/app/test/test_memcpy.c +++ b/app/test/test_memcpy.c @@ -210,7 +210,7 @@ func_test(void) return 0; } -int +static int test_memcpy(void) { int ret; @@ -223,3 +223,9 @@ test_memcpy(void) return -1; return 0; } + +static struct test_command memcpy_cmd = { + .command = "memcpy_autotest", + .callback = test_memcpy, +}; +REGISTER_TEST_COMMAND(memcpy_cmd); diff --git a/app/test/test_memcpy_perf.c b/app/test/test_memcpy_perf.c index f6b95c9..7809610 100644 --- a/app/test/test_memcpy_perf.c +++ b/app/test/test_memcpy_perf.c @@ -278,7 +278,7 @@ perf_test(void) } -int +static int test_memcpy_perf(void) { int ret; @@ -288,3 +288,9 @@ test_memcpy_perf(void) return -1; return 0; } + +static struct test_command memcpy_perf_cmd = { + .command = "memcpy_perf_autotest", + .callback = test_memcpy_perf, +}; +REGISTER_TEST_COMMAND(memcpy_perf_cmd); diff --git a/app/test/test_memory.c b/app/test/test_memory.c index 6c62de8..02ef3cf 100644 --- a/app/test/test_memory.c +++ b/app/test/test_memory.c @@ -51,7 +51,7 @@ * - Try to read all memory; it should not segfault. */ -int +static int test_memory(void) { uint64_t s; @@ -84,3 +84,9 @@ test_memory(void) return 0; } + +static struct test_command memory_cmd = { + .command = "memory_autotest", + .callback = test_memory, +}; +REGISTER_TEST_COMMAND(memory_cmd); diff --git a/app/test/test_mempool.c b/app/test/test_mempool.c index a83b2ee..303d2b3 100644 --- a/app/test/test_mempool.c +++ b/app/test/test_mempool.c @@ -455,7 +455,7 @@ test_mempool_xmem_misc(void) return (0); } -int +static int test_mempool(void) { rte_atomic32_init(&synchro); @@ -521,3 +521,9 @@ test_mempool(void) return 0; } + +static struct test_command mempool_cmd = { + .command = "mempool_autotest", + .callback = test_mempool, +}; +REGISTER_TEST_COMMAND(mempool_cmd); diff --git a/app/test/test_mempool_perf.c b/app/test/test_mempool_perf.c index d3141fe..57c0e5e 100644 --- a/app/test/test_mempool_perf.c +++ b/app/test/test_mempool_perf.c @@ -273,7 +273,7 @@ do_one_mempool_test(unsigned cores) return 0; } -int +static int test_mempool_perf(void) { rte_atomic32_init(&synchro); @@ -329,3 +329,9 @@ test_mempool_perf(void) return 0; } + +static struct test_command mempool_perf_cmd = { + .command = "mempool_perf_autotest", + .callback = test_mempool_perf, +}; +REGISTER_TEST_COMMAND(mempool_perf_cmd); diff --git a/app/test/test_memzone.c b/app/test/test_memzone.c index 42c7601..381f643 100644 --- a/app/test/test_memzone.c +++ b/app/test/test_memzone.c @@ -922,7 +922,7 @@ test_memzone_reserve_remainder(void) return 0; } -int +static int test_memzone(void) { const struct rte_memzone *memzone1; @@ -1044,3 +1044,9 @@ test_memzone(void) return 0; } + +static struct test_command memzone_cmd = { + .command = "memzone_autotest", + .callback = test_memzone, +}; +REGISTER_TEST_COMMAND(memzone_cmd); diff --git a/app/test/test_meter.c b/app/test/test_meter.c index 226b231..215cbf8 100644 --- a/app/test/test_meter.c +++ b/app/test/test_meter.c @@ -471,7 +471,7 @@ tm_test_trtcm_color_aware_check(void) /** * test main entrance for library meter */ -int +static int test_meter(void) { if(tm_test_srtcm_config() != 0 ) @@ -496,12 +496,9 @@ test_meter(void) } -#else /* RTE_LIBRTE_METER */ - -int -test_meter(void) -{ - printf("The meter library is not included in this build\n"); - return 0; -} +static struct test_command meter_cmd = { + .command = "meter_autotest", + .callback = test_meter, +}; +REGISTER_TEST_COMMAND(meter_cmd); #endif /* RTE_LIBRTE_METER */ diff --git a/app/test/test_mp_secondary.c b/app/test/test_mp_secondary.c index e739765..7579e20 100644 --- a/app/test/test_mp_secondary.c +++ b/app/test/test_mp_secondary.c @@ -265,16 +265,9 @@ test_mp_secondary(void) return run_object_creation_tests(); } -#else - -/* Baremetal version - * Multiprocess not applicable, so just return 0 always - */ -int -test_mp_secondary(void) -{ - printf("Multi-process not applicable for baremetal\n"); - return 0; -} - +static struct test_command multiprocess_cmd = { + .command = "multiprocess_autotest", + .callback = test_mp_secondary, +}; +REGISTER_TEST_COMMAND(multiprocess_cmd); #endif diff --git a/app/test/test_pci.c b/app/test/test_pci.c index 40095c6..e834c4d 100644 --- a/app/test/test_pci.c +++ b/app/test/test_pci.c @@ -195,3 +195,9 @@ test_pci(void) return 0; } + +static struct test_command pci_cmd = { + .command = "pci_autotest", + .callback = test_pci, +}; +REGISTER_TEST_COMMAND(pci_cmd); diff --git a/app/test/test_per_lcore.c b/app/test/test_per_lcore.c index 2241ed5..1a5a232 100644 --- a/app/test/test_per_lcore.c +++ b/app/test/test_per_lcore.c @@ -99,7 +99,7 @@ test_per_lcore_delay(__attribute__((unused)) void *arg) return 0; } -int +static int test_per_lcore(void) { unsigned lcore_id; @@ -136,3 +136,9 @@ test_per_lcore(void) return 0; } + +static struct test_command per_lcore_cmd = { + .command = "per_lcore_autotest", + .callback = test_per_lcore, +}; +REGISTER_TEST_COMMAND(per_lcore_cmd); diff --git a/app/test/test_pmd_ring.c b/app/test/test_pmd_ring.c index 19ad0e9..6364495 100644 --- a/app/test/test_pmd_ring.c +++ b/app/test/test_pmd_ring.c @@ -405,7 +405,7 @@ test_pmd_ring_pair_create_attach(void) return 0; } -int +static int test_pmd_ring(void) { mp = rte_mempool_create("mbuf_pool", NB_MBUF, @@ -445,13 +445,10 @@ test_pmd_ring(void) return 0; } -#else - -int -test_pmd_ring(void) -{ - return 0; -} - +static struct test_command ring_pmd_cmd = { + .command = "ring_pmd_autotest", + .callback = test_pmd_ring, +}; +REGISTER_TEST_COMMAND(ring_pmd_cmd); #endif diff --git a/app/test/test_power.c b/app/test/test_power.c index 94c1cac..123b199 100644 --- a/app/test/test_power.c +++ b/app/test/test_power.c @@ -379,7 +379,7 @@ check_power_freq_min(void) return 0; } -int +static int test_power(void) { int ret = -1; @@ -477,14 +477,10 @@ fail_all: return -1; } -#else /* RTE_LIBRTE_POWER */ - -int -test_power(void) -{ - printf("The power library is not included in this build\n"); - return 0; -} - +static struct test_command power_cmd = { + .command = "power_autotest", + .callback = test_power, +}; +REGISTER_TEST_COMMAND(power_cmd); #endif /* RTE_LIBRTE_POWER */ diff --git a/app/test/test_prefetch.c b/app/test/test_prefetch.c index 10039b7..f8615e2 100644 --- a/app/test/test_prefetch.c +++ b/app/test/test_prefetch.c @@ -46,7 +46,7 @@ * The test always return success. */ -int +static int test_prefetch(void) { int a; @@ -57,3 +57,9 @@ test_prefetch(void) return 0; } + +static struct test_command prefetch_cmd = { + .command = "prefetch_autotest", + .callback = test_prefetch, +}; +REGISTER_TEST_COMMAND(prefetch_cmd); diff --git a/app/test/test_red.c b/app/test/test_red.c index bb62aba..7cf2221 100644 --- a/app/test/test_red.c +++ b/app/test/test_red.c @@ -1861,7 +1861,8 @@ test_invalid_parameters(void) return 0; } -int test_red(void) +static int +test_red(void) { uint32_t num_tests = 0; uint32_t num_pass = 0; @@ -1883,13 +1884,9 @@ int test_red(void) return (ret); } -#else - -int -test_red(void) -{ - printf("The SCHED library is not included in this build\n"); - return 0; -} - +static struct test_command red_cmd = { + .command = "red_autotest", + .callback = test_red, +}; +REGISTER_TEST_COMMAND(red_cmd); #endif diff --git a/app/test/test_ring.c b/app/test/test_ring.c index be588f2..2cd8e77 100644 --- a/app/test/test_ring.c +++ b/app/test/test_ring.c @@ -1322,7 +1322,7 @@ fail_test: return ret; } -int +static int test_ring(void) { /* some more basic operations */ @@ -1392,3 +1392,9 @@ test_ring(void) return 0; } + +static struct test_command ring_cmd = { + .command = "ring_autotest", + .callback = test_ring, +}; +REGISTER_TEST_COMMAND(ring_cmd); diff --git a/app/test/test_ring_perf.c b/app/test/test_ring_perf.c index 9ec6932..44dda4d 100644 --- a/app/test/test_ring_perf.c +++ b/app/test/test_ring_perf.c @@ -381,7 +381,7 @@ test_bulk_enqueue_dequeue(void) } } -int +static int test_ring_perf(void) { struct lcore_pair cores; @@ -413,3 +413,9 @@ test_ring_perf(void) } return 0; } + +static struct test_command ring_perf_cmd = { + .command = "ring_perf_autotest", + .callback = test_ring_perf, +}; +REGISTER_TEST_COMMAND(ring_perf_cmd); diff --git a/app/test/test_rwlock.c b/app/test/test_rwlock.c index 89fc594..c4e6e95 100644 --- a/app/test/test_rwlock.c +++ b/app/test/test_rwlock.c @@ -97,7 +97,7 @@ test_rwlock_per_core(__attribute__((unused)) void *arg) return 0; } -int +static int test_rwlock(void) { int i; @@ -129,3 +129,9 @@ test_rwlock(void) return 0; } + +static struct test_command rwlock_cmd = { + .command = "rwlock_autotest", + .callback = test_rwlock, +}; +REGISTER_TEST_COMMAND(rwlock_cmd); diff --git a/app/test/test_sched.c b/app/test/test_sched.c index d9abb51..2cc9df5 100644 --- a/app/test/test_sched.c +++ b/app/test/test_sched.c @@ -155,7 +155,7 @@ prepare_pkt(struct rte_mbuf *mbuf) /** * test main entrance for library sched */ -int +static int test_sched(void) { struct rte_mempool *mp = NULL; @@ -229,12 +229,9 @@ test_sched(void) return 0; } -#else /* RTE_LIBRTE_SCHED */ - -int -test_sched(void) -{ - printf("The Scheduler library is not included in this build\n"); - return 0; -} +static struct test_command sched_cmd = { + .command = "sched_autotest", + .callback = test_sched, +}; +REGISTER_TEST_COMMAND(sched_cmd); #endif /* RTE_LIBRTE_SCHED */ diff --git a/app/test/test_spinlock.c b/app/test/test_spinlock.c index 9b45d8e..c95b0c0 100644 --- a/app/test/test_spinlock.c +++ b/app/test/test_spinlock.c @@ -225,7 +225,7 @@ test_spinlock_try(__attribute__((unused)) void *arg) * Test rte_eal_get_lcore_state() in addition to spinlocks * as we have "waiting" then "running" lcores. */ -int +static int test_spinlock(void) { int ret = 0; @@ -333,3 +333,9 @@ test_spinlock(void) return ret; } + +static struct test_command spinlock_cmd = { + .command = "spinlock_autotest", + .callback = test_spinlock, +}; +REGISTER_TEST_COMMAND(spinlock_cmd); diff --git a/app/test/test_string_fns.c b/app/test/test_string_fns.c index 223797c..29bfe5b 100644 --- a/app/test/test_string_fns.c +++ b/app/test/test_string_fns.c @@ -291,7 +291,7 @@ test_rte_strsplit(void) return 0; } -int +static int test_string_fns(void) { if (test_rte_snprintf() < 0 || @@ -299,3 +299,9 @@ test_string_fns(void) return -1; return 0; } + +static struct test_command string_cmd = { + .command = "string_autotest", + .callback = test_string_fns, +}; +REGISTER_TEST_COMMAND(string_cmd); diff --git a/app/test/test_table.c b/app/test/test_table.c index 970d15c..33e2efc 100644 --- a/app/test/test_table.c +++ b/app/test/test_table.c @@ -32,17 +32,7 @@ */ -#ifndef RTE_LIBRTE_TABLE - -#include "test.h" - -int -test_table(void) -{ - return 0; -} - -#else +#ifdef RTE_LIBRTE_TABLE #include #include @@ -156,7 +146,7 @@ app_init_rings(void) } -int +static int test_table(void) { int status, failures; @@ -217,4 +207,9 @@ test_table(void) return 0; } +static struct test_command table_cmd = { + .command = "table_autotest", + .callback = test_table, +}; +REGISTER_TEST_COMMAND(table_cmd); #endif diff --git a/app/test/test_table.h b/app/test/test_table.h index afea738..40e50db 100644 --- a/app/test/test_table.h +++ b/app/test/test_table.h @@ -126,7 +126,6 @@ } while (0) /* Function definitions */ -int test_table(void); uint64_t pipeline_test_hash( void *key, __attribute__((unused)) uint32_t key_size, diff --git a/app/test/test_tailq.c b/app/test/test_tailq.c index c9b53ee..4d32c6f 100644 --- a/app/test/test_tailq.c +++ b/app/test/test_tailq.c @@ -153,7 +153,7 @@ test_tailq_deprecated(void) return 0; } -int +static int test_tailq(void) { int ret = 0; @@ -162,3 +162,9 @@ test_tailq(void) ret |= test_tailq_deprecated(); return ret; } + +static struct test_command tailq_cmd = { + .command = "tailq_autotest", + .callback = test_tailq, +}; +REGISTER_TEST_COMMAND(tailq_cmd); diff --git a/app/test/test_timer.c b/app/test/test_timer.c index 57b722c..ec826c0 100644 --- a/app/test/test_timer.c +++ b/app/test/test_timer.c @@ -457,7 +457,7 @@ timer_sanity_check(void) return 0; } -int +static int test_timer(void) { unsigned i; @@ -520,12 +520,9 @@ test_timer(void) return 0; } -#else - -int -test_timer(void) -{ - return 0; -} - +static struct test_command timer_cmd = { + .command = "timer_autotest", + .callback = test_timer, +}; +REGISTER_TEST_COMMAND(timer_cmd); #endif diff --git a/app/test/test_timer_perf.c b/app/test/test_timer_perf.c index 83bd45d..da92473 100644 --- a/app/test/test_timer_perf.c +++ b/app/test/test_timer_perf.c @@ -62,7 +62,7 @@ timer_cb(struct rte_timer *t __rte_unused, void *param __rte_unused) #define do_delay() rte_pause() #endif -int +static int test_timer_perf(void) { unsigned iterations = 100; @@ -159,12 +159,9 @@ test_timer_perf(void) return 0; } -#else - -int -test_timer_perf(void) -{ - return 0; -} - +static struct test_command timer_perf_cmd = { + .command = "timer_perf_autotest", + .callback = test_timer_perf, +}; +REGISTER_TEST_COMMAND(timer_perf_cmd); #endif diff --git a/app/test/test_version.c b/app/test/test_version.c index ac6ffa0..f66827d 100644 --- a/app/test/test_version.c +++ b/app/test/test_version.c @@ -41,7 +41,7 @@ #include "test.h" -int +static int test_version(void) { const char *version = rte_version(); @@ -53,3 +53,9 @@ test_version(void) return -1; return 0; } + +static struct test_command version_cmd = { + .command = "version_autotest", + .callback = test_version, +}; +REGISTER_TEST_COMMAND(version_cmd); -- 1.7.10.4