]> git.droids-corp.org - dpdk.git/commitdiff
app/test: rework command registration
authorThomas Monjalon <thomas.monjalon@6wind.com>
Wed, 13 Jul 2016 12:38:13 +0000 (14:38 +0200)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Fri, 15 Jul 2016 15:25:02 +0000 (17:25 +0200)
The tests are registered with their command name by adding a structure
to a list. The structure of each test was declared in each test file
and passed to the register macro.
This rework generate the structure inside the register macro.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Reviewed-by: Jan Viktorin <viktorin@rehivetech.com>
71 files changed:
app/test/test.h
app/test/test_acl.c
app/test/test_alarm.c
app/test/test_atomic.c
app/test/test_byteorder.c
app/test/test_cmdline.c
app/test/test_common.c
app/test/test_cpuflags.c
app/test/test_cryptodev.c
app/test/test_cryptodev_perf.c
app/test/test_cycles.c
app/test/test_debug.c
app/test/test_devargs.c
app/test/test_distributor.c
app/test/test_distributor_perf.c
app/test/test_eal_flags.c
app/test/test_eal_fs.c
app/test/test_errno.c
app/test/test_func_reentrancy.c
app/test/test_hash.c
app/test/test_hash_functions.c
app/test/test_hash_multiwriter.c
app/test/test_hash_perf.c
app/test/test_hash_scaling.c
app/test/test_interrupts.c
app/test/test_ivshmem.c
app/test/test_kni.c
app/test/test_kvargs.c
app/test/test_link_bonding.c
app/test/test_link_bonding_mode4.c
app/test/test_link_bonding_rssconf.c
app/test/test_logs.c
app/test/test_lpm.c
app/test/test_lpm6.c
app/test/test_lpm6_perf.c
app/test/test_lpm_perf.c
app/test/test_malloc.c
app/test/test_mbuf.c
app/test/test_memcpy.c
app/test/test_memcpy_perf.c
app/test/test_memory.c
app/test/test_mempool.c
app/test/test_mempool_perf.c
app/test/test_memzone.c
app/test/test_meter.c
app/test/test_mp_secondary.c
app/test/test_pci.c
app/test/test_per_lcore.c
app/test/test_pmd_perf.c
app/test/test_pmd_ring.c
app/test/test_pmd_ring_perf.c
app/test/test_power.c
app/test/test_power_acpi_cpufreq.c
app/test/test_power_kvm_vm.c
app/test/test_prefetch.c
app/test/test_red.c
app/test/test_reorder.c
app/test/test_resource.c
app/test/test_ring.c
app/test/test_ring_perf.c
app/test/test_rwlock.c
app/test/test_sched.c
app/test/test_spinlock.c
app/test/test_string_fns.c
app/test/test_table.c
app/test/test_tailq.c
app/test/test_thash.c
app/test/test_timer.c
app/test/test_timer_perf.c
app/test/test_timer_racecond.c
app/test/test_version.c

index 81828bee7720a8dfd5f5c001eed674ff1d491910..467b9c07232f5e356a661e3d34505036ba60fec2 100644 (file)
@@ -250,11 +250,16 @@ struct test_command {
 
 void add_test_command(struct test_command *t);
 
-#define REGISTER_TEST_COMMAND(t) \
-static void __attribute__((used)) testfn_##t(void);\
-void __attribute__((constructor, used)) testfn_##t(void)\
-{\
-       add_test_command(&t);\
-}
+/* Register a test function with its command string */
+#define REGISTER_TEST_COMMAND(cmd, func) \
+       static struct test_command test_struct_##cmd = { \
+               .command = RTE_STR(cmd), \
+               .callback = func, \
+       }; \
+       static void __attribute__((constructor, used)) \
+       test_register_##cmd(void) \
+       { \
+               add_test_command(&test_struct_##cmd); \
+       }
 
 #endif
index 2b8279044a3421d11dba612806177d25f44298be..28955f08a9acde98ae964437ef515f18854740ca 100644 (file)
@@ -1682,8 +1682,4 @@ test_acl(void)
        return 0;
 }
 
-static struct test_command acl_cmd = {
-       .command = "acl_autotest",
-       .callback = test_acl,
-};
-REGISTER_TEST_COMMAND(acl_cmd);
+REGISTER_TEST_COMMAND(acl_autotest, test_acl);
index d83591c9783196f002af34acc5c4bdf8a9030410..ecb2f6d457707051b4d46fae926601af82f3ad6f 100644 (file)
@@ -253,8 +253,4 @@ test_alarm(void)
        return 0;
 }
 
-static struct test_command alarm_cmd = {
-       .command = "alarm_autotest",
-       .callback = test_alarm,
-};
-REGISTER_TEST_COMMAND(alarm_cmd);
+REGISTER_TEST_COMMAND(alarm_autotest, test_alarm);
index 588f53094d10de26ca2e7051cce75372e79dbc9b..b5e7e1b78f53d0da83bc0b8ddb83a0698d163f69 100644 (file)
@@ -374,8 +374,4 @@ test_atomic(void)
        return 0;
 }
 
-static struct test_command atomic_cmd = {
-       .command = "atomic_autotest",
-       .callback = test_atomic,
-};
-REGISTER_TEST_COMMAND(atomic_cmd);
+REGISTER_TEST_COMMAND(atomic_autotest, test_atomic);
index a088489bdb32af102a6b6db58c17ebb95549c012..8ae311420ba7e872caab5ee5d4f49d0b97b66b3e 100644 (file)
@@ -92,8 +92,4 @@ test_byteorder(void)
        return 0;
 }
 
-static struct test_command byteorder_cmd = {
-       .command = "byteorder_autotest",
-       .callback = test_byteorder,
-};
-REGISTER_TEST_COMMAND(byteorder_cmd);
+REGISTER_TEST_COMMAND(byteorder_autotest, test_byteorder);
index 2b5840fb30d70fc05787a8a65890428c0109ab29..38c7256f822bdc45d61aca73d3f9930f20d99a2b 100644 (file)
@@ -89,8 +89,4 @@ test_cmdline(void)
        return 0;
 }
 
-static struct test_command cmdline_cmd = {
-       .command = "cmdline_autotest",
-       .callback = test_cmdline,
-};
-REGISTER_TEST_COMMAND(cmdline_cmd);
+REGISTER_TEST_COMMAND(cmdline_autotest, test_cmdline);
index 66e910985d82b1bce459fffd96726682bd892f58..8effa2f9edf38ac2cd8dd6754eb27031d551b795 100644 (file)
@@ -169,8 +169,4 @@ test_common(void)
        return ret;
 }
 
-static struct test_command common_cmd = {
-       .command = "common_autotest",
-       .callback = test_common,
-};
-REGISTER_TEST_COMMAND(common_cmd);
+REGISTER_TEST_COMMAND(common_autotest, test_common);
index d083c869f62f06c5a5af4d21bbcdeeaf2bb2d239..0e5ebe788ad2d9a37775d5686d0682877529e697 100644 (file)
@@ -199,8 +199,4 @@ test_cpuflags(void)
        return 0;
 }
 
-static struct test_command cpuflags_cmd = {
-       .command = "cpuflags_autotest",
-       .callback = test_cpuflags,
-};
-REGISTER_TEST_COMMAND(cpuflags_cmd);
+REGISTER_TEST_COMMAND(cpuflags_autotest, test_cpuflags);
index 33325a8ba0769522040ab6217099613f7f1eaa0d..647787d29ff9a7585a69965af51de8254902e041 100644 (file)
@@ -4164,10 +4164,6 @@ test_cryptodev_qat(void /*argv __rte_unused, int argc __rte_unused*/)
        gbl_cryptodev_type = RTE_CRYPTODEV_QAT_SYM_PMD;
        return unit_test_suite_runner(&cryptodev_qat_testsuite);
 }
-static struct test_command cryptodev_qat_cmd = {
-       .command = "cryptodev_qat_autotest",
-       .callback = test_cryptodev_qat,
-};
 
 static int
 test_cryptodev_aesni_mb(void /*argv __rte_unused, int argc __rte_unused*/)
@@ -4177,11 +4173,6 @@ test_cryptodev_aesni_mb(void /*argv __rte_unused, int argc __rte_unused*/)
        return unit_test_suite_runner(&cryptodev_aesni_mb_testsuite);
 }
 
-static struct test_command cryptodev_aesni_mb_cmd = {
-       .command = "cryptodev_aesni_mb_autotest",
-       .callback = test_cryptodev_aesni_mb,
-};
-
 static int
 test_cryptodev_aesni_gcm(void)
 {
@@ -4190,11 +4181,6 @@ test_cryptodev_aesni_gcm(void)
        return unit_test_suite_runner(&cryptodev_aesni_gcm_testsuite);
 }
 
-static struct test_command cryptodev_aesni_gcm_cmd = {
-       .command = "cryptodev_aesni_gcm_autotest",
-       .callback = test_cryptodev_aesni_gcm,
-};
-
 static int
 test_cryptodev_null(void)
 {
@@ -4203,11 +4189,6 @@ test_cryptodev_null(void)
        return unit_test_suite_runner(&cryptodev_null_testsuite);
 }
 
-static struct test_command cryptodev_null_cmd = {
-       .command = "cryptodev_null_autotest",
-       .callback = test_cryptodev_null,
-};
-
 static int
 test_cryptodev_sw_snow3g(void /*argv __rte_unused, int argc __rte_unused*/)
 {
@@ -4216,11 +4197,6 @@ test_cryptodev_sw_snow3g(void /*argv __rte_unused, int argc __rte_unused*/)
        return unit_test_suite_runner(&cryptodev_sw_snow3g_testsuite);
 }
 
-static struct test_command cryptodev_sw_snow3g_cmd = {
-       .command = "cryptodev_sw_snow3g_autotest",
-       .callback = test_cryptodev_sw_snow3g,
-};
-
 static int
 test_cryptodev_sw_kasumi(void /*argv __rte_unused, int argc __rte_unused*/)
 {
@@ -4229,14 +4205,9 @@ test_cryptodev_sw_kasumi(void /*argv __rte_unused, int argc __rte_unused*/)
        return unit_test_suite_runner(&cryptodev_sw_kasumi_testsuite);
 }
 
-static struct test_command cryptodev_sw_kasumi_cmd = {
-       .command = "cryptodev_sw_kasumi_autotest",
-       .callback = test_cryptodev_sw_kasumi,
-};
-
-REGISTER_TEST_COMMAND(cryptodev_qat_cmd);
-REGISTER_TEST_COMMAND(cryptodev_aesni_mb_cmd);
-REGISTER_TEST_COMMAND(cryptodev_aesni_gcm_cmd);
-REGISTER_TEST_COMMAND(cryptodev_null_cmd);
-REGISTER_TEST_COMMAND(cryptodev_sw_snow3g_cmd);
-REGISTER_TEST_COMMAND(cryptodev_sw_kasumi_cmd);
+REGISTER_TEST_COMMAND(cryptodev_qat_autotest, test_cryptodev_qat);
+REGISTER_TEST_COMMAND(cryptodev_aesni_mb_autotest, test_cryptodev_aesni_mb);
+REGISTER_TEST_COMMAND(cryptodev_aesni_gcm_autotest, test_cryptodev_aesni_gcm);
+REGISTER_TEST_COMMAND(cryptodev_null_autotest, test_cryptodev_null);
+REGISTER_TEST_COMMAND(cryptodev_sw_snow3g_autotest, test_cryptodev_sw_snow3g);
+REGISTER_TEST_COMMAND(cryptodev_sw_kasumi_autotest, test_cryptodev_sw_kasumi);
index 815c41fffa168cd7c9b51bd8ecd1e72f6aaaec8f..2398d844267a7b8270be28b9ee618738a54b646a 100644 (file)
@@ -2919,27 +2919,7 @@ perftest_qat_snow3g_cryptodev(void /*argv __rte_unused, int argc __rte_unused*/)
        return unit_test_suite_runner(&cryptodev_snow3g_testsuite);
 }
 
-static struct test_command cryptodev_aesni_mb_perf_cmd = {
-       .command = "cryptodev_aesni_mb_perftest",
-       .callback = perftest_aesni_mb_cryptodev,
-};
-
-static struct test_command cryptodev_qat_perf_cmd = {
-       .command = "cryptodev_qat_perftest",
-       .callback = perftest_qat_cryptodev,
-};
-
-static struct test_command cryptodev_sw_snow3g_perf_cmd = {
-       .command = "cryptodev_sw_snow3g_perftest",
-       .callback = perftest_sw_snow3g_cryptodev,
-};
-
-static struct test_command cryptodev_qat_snow3g_perf_cmd = {
-       .command = "cryptodev_qat_snow3g_perftest",
-       .callback = perftest_qat_snow3g_cryptodev,
-};
-
-REGISTER_TEST_COMMAND(cryptodev_aesni_mb_perf_cmd);
-REGISTER_TEST_COMMAND(cryptodev_qat_perf_cmd);
-REGISTER_TEST_COMMAND(cryptodev_sw_snow3g_perf_cmd);
-REGISTER_TEST_COMMAND(cryptodev_qat_snow3g_perf_cmd);
+REGISTER_TEST_COMMAND(cryptodev_aesni_mb_perftest, perftest_aesni_mb_cryptodev);
+REGISTER_TEST_COMMAND(cryptodev_qat_perftest, perftest_qat_cryptodev);
+REGISTER_TEST_COMMAND(cryptodev_sw_snow3g_perftest, perftest_sw_snow3g_cryptodev);
+REGISTER_TEST_COMMAND(cryptodev_qat_snow3g_perftest, perftest_qat_snow3g_cryptodev);
index d8fa5171be66da28108f0142e50c58a9060da6be..f6c043a463748adb9bd036ca4978a9fbcfdd3b5f 100644 (file)
@@ -89,8 +89,4 @@ test_cycles(void)
        return 0;
 }
 
-static struct test_command cycles_cmd = {
-       .command = "cycles_autotest",
-       .callback = test_cycles,
-};
-REGISTER_TEST_COMMAND(cycles_cmd);
+REGISTER_TEST_COMMAND(cycles_autotest, test_cycles);
index 7c3ee926c67b327455fdfaa0a948c085eeca2300..0a3b2c468ad7d1ea6f0c3c878f1c632c2ab3951a 100644 (file)
@@ -146,8 +146,4 @@ test_debug(void)
        return 0;
 }
 
-static struct test_command debug_cmd = {
-       .command = "debug_autotest",
-       .callback = test_debug,
-};
-REGISTER_TEST_COMMAND(debug_cmd);
+REGISTER_TEST_COMMAND(debug_autotest, test_debug);
index e5a9aa0bac7697472c784a1d278d89b7d1b490f0..151ac2ac045ed5b28ab635b649754ed5563178bc 100644 (file)
@@ -131,8 +131,4 @@ test_devargs(void)
        return -1;
 }
 
-static struct test_command devargs_cmd = {
-       .command = "devargs_autotest",
-       .callback = test_devargs,
-};
-REGISTER_TEST_COMMAND(devargs_cmd);
+REGISTER_TEST_COMMAND(devargs_autotest, test_devargs);
index 00b1d41387b491d4b007a059ba511667fd1cfdef..85cb8f3919ece8bacdeff713b5c4806f794e67ba 100644 (file)
@@ -576,8 +576,4 @@ err:
        return -1;
 }
 
-static struct test_command distributor_cmd = {
-       .command = "distributor_autotest",
-       .callback = test_distributor,
-};
-REGISTER_TEST_COMMAND(distributor_cmd);
+REGISTER_TEST_COMMAND(distributor_autotest, test_distributor);
index 92b222010f4f1df8c430ee540a42b8619ca50296..7947fe9b16783b98276e9ab326b639fdf585ccca 100644 (file)
@@ -257,8 +257,4 @@ test_distributor_perf(void)
        return 0;
 }
 
-static struct test_command distributor_perf_cmd = {
-       .command = "distributor_perf_autotest",
-       .callback = test_distributor_perf,
-};
-REGISTER_TEST_COMMAND(distributor_perf_cmd);
+REGISTER_TEST_COMMAND(distributor_perf_autotest, test_distributor_perf);
index 93ae6e765d23fc13e124bd277ac9814aad5af36c..6202f0576b06abe5cef5a4b9690472d87962357b 100644 (file)
@@ -1441,8 +1441,4 @@ test_eal_flags(void)
        return ret;
 }
 
-static struct test_command eal_flags_cmd = {
-       .command = "eal_flags_autotest",
-       .callback = test_eal_flags,
-};
-REGISTER_TEST_COMMAND(eal_flags_cmd);
+REGISTER_TEST_COMMAND(eal_flags_autotest, test_eal_flags);
index 1cbcb9d983af4476ef0a6edf085fe6b9a1461967..78978120cdbc2fb23c1ea9641127085a32495e4d 100644 (file)
@@ -203,8 +203,4 @@ 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);
+REGISTER_TEST_COMMAND(eal_fs_autotest, test_eal_fs);
index f221eac73dcb9c8c1d6427c74c412be785160685..388decbb2a85a55cb72ef884ec541c402fdeb6ab 100644 (file)
@@ -113,8 +113,4 @@ test_errno(void)
        return 0;
 }
 
-static struct test_command errno_cmd = {
-       .command = "errno_autotest",
-       .callback = test_errno,
-};
-REGISTER_TEST_COMMAND(errno_cmd);
+REGISTER_TEST_COMMAND(errno_autotest, test_errno);
index d6e9dd8feb0b10a8d1fca484739e7771fe04e497..baa01ffc2c00a2b35bb0a6247ca0a800afc9aa60 100644 (file)
@@ -507,8 +507,4 @@ 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);
+REGISTER_TEST_COMMAND(func_reentrancy_autotest, test_func_reentrancy);
index 29abcd9ea1e7b11c8e8ca8ce9f83f83194eab280..94300e1912172cf17331bc139f930d08cf9426b5 100644 (file)
@@ -1514,8 +1514,4 @@ test_hash(void)
        return 0;
 }
 
-static struct test_command hash_cmd = {
-       .command = "hash_autotest",
-       .callback = test_hash,
-};
-REGISTER_TEST_COMMAND(hash_cmd);
+REGISTER_TEST_COMMAND(hash_autotest, test_hash);
index f767a486109fa5520de58e8f806015d2c1f2f2fa..9652b04d45fffc9ff28286807d00d0680920db0f 100644 (file)
@@ -319,8 +319,4 @@ test_hash_functions(void)
        return 0;
 }
 
-static struct test_command hash_functions_cmd = {
-       .command = "hash_functions_autotest",
-       .callback = test_hash_functions,
-};
-REGISTER_TEST_COMMAND(hash_functions_cmd);
+REGISTER_TEST_COMMAND(hash_functions_autotest, test_hash_functions);
index b0f31b002c890044f64dd493264e010a926809b0..40af95d4d4c014df1baf3d497029df3b2a9bd71f 100644 (file)
@@ -278,10 +278,4 @@ test_hash_multiwriter_main(void)
        return r;
 }
 
-
-static struct test_command hash_scaling_cmd = {
-       .command = "hash_multiwriter_autotest",
-       .callback = test_hash_multiwriter_main,
-};
-
-REGISTER_TEST_COMMAND(hash_scaling_cmd);
+REGISTER_TEST_COMMAND(hash_multiwriter_autotest, test_hash_multiwriter_main);
index 9d53c1412d81a62d4032a9aed9803283364467d7..c0051b20fbe2c70d21642ef89c5a237e5ac096e6 100644 (file)
@@ -656,8 +656,4 @@ test_hash_perf(void)
        return 0;
 }
 
-static struct test_command hash_perf_cmd = {
-               .command = "hash_perf_autotest",
-               .callback = test_hash_perf,
-};
-REGISTER_TEST_COMMAND(hash_perf_cmd);
+REGISTER_TEST_COMMAND(hash_perf_autotest, test_hash_perf);
index 1c4c75d634ef7a304cf0011fda310cd2850eb8ee..46c48e549b00b9897daeb08bbb1ca0d44cc61175 100644 (file)
@@ -217,9 +217,4 @@ test_hash_scaling_main(void)
        return r;
 }
 
-
-static struct test_command hash_scaling_cmd = {
-       .command = "hash_scaling_autotest",
-       .callback = test_hash_scaling_main,
-};
-REGISTER_TEST_COMMAND(hash_scaling_cmd);
+REGISTER_TEST_COMMAND(hash_scaling_autotest, test_hash_scaling_main);
index df6d26180c83dd5d5e67c60c36f2336066f407e0..371101f0885ef9dadd7b2819983602f736e98495 100644 (file)
@@ -548,8 +548,4 @@ out:
        return ret;
 }
 
-static struct test_command interrupt_cmd = {
-       .command = "interrupt_autotest",
-       .callback = test_interrupt,
-};
-REGISTER_TEST_COMMAND(interrupt_cmd);
+REGISTER_TEST_COMMAND(interrupt_autotest, test_interrupt);
index 4e6148841594aeaac33ab2978053b2ce2acca062..ae9fd6cccc0a3f79f19f1447ed269475b0ec23ea 100644 (file)
@@ -430,8 +430,4 @@ test_ivshmem(void)
        return -1;
 }
 
-static struct test_command ivshmem_cmd = {
-       .command = "ivshmem_autotest",
-       .callback = test_ivshmem,
-};
-REGISTER_TEST_COMMAND(ivshmem_cmd);
+REGISTER_TEST_COMMAND(ivshmem_autotest, test_ivshmem);
index 7243ade100cf5c385b60f0d07f257b2c96169d86..309741cb353e741e4b55864075fce718427c3518 100644 (file)
@@ -633,8 +633,4 @@ fail:
        return ret;
 }
 
-static struct test_command kni_cmd = {
-       .command = "kni_autotest",
-       .callback = test_kni,
-};
-REGISTER_TEST_COMMAND(kni_cmd);
+REGISTER_TEST_COMMAND(kni_autotest, test_kni);
index 6be85122d17020fa58a82a1db5c5f0946cd81f38..4d9e805b3a8c312439e16f54fc6dc33aada2760d 100644 (file)
@@ -232,8 +232,4 @@ test_kvargs(void)
        return 0;
 }
 
-static struct test_command kvargs_cmd = {
-       .command = "kvargs_autotest",
-       .callback = test_kvargs,
-};
-REGISTER_TEST_COMMAND(kvargs_cmd);
+REGISTER_TEST_COMMAND(kvargs_autotest, test_kvargs);
index eeb139546f76c4af9c8b45428c203394686a1b03..32296604d23d363f71e9010b30a37a32ffb76e8f 100644 (file)
@@ -5002,8 +5002,4 @@ 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);
+REGISTER_TEST_COMMAND(link_bonding_autotest, test_link_bonding);
index a3f1f0884b454810b3b36a7daf75b832e8e6f8bc..53caa3e980877c90c344fab65dc58e5cadcd61dc 100644 (file)
@@ -1599,9 +1599,4 @@ test_link_bonding_mode4(void)
        return unit_test_suite_runner(&link_bonding_mode4_test_suite);
 }
 
-static struct test_command link_bonding_cmd = {
-       .command = "link_bonding_mode4_autotest",
-       .callback = test_link_bonding_mode4,
-};
-
-REGISTER_TEST_COMMAND(link_bonding_cmd);
+REGISTER_TEST_COMMAND(link_bonding_mode4_autotest, test_link_bonding_mode4);
index 0a3162ea8b999607b62bfa1a9b59687afe07f05f..34f1c166ba985385e7ae0692426057855467a497 100644 (file)
@@ -670,9 +670,4 @@ test_link_bonding_rssconf(void)
        return unit_test_suite_runner(&link_bonding_rssconf_test_suite);
 }
 
-static struct test_command test_link_bonding_rssconf_cmd = {
-       .command = "link_bonding_rssconf_autotest",
-       .callback = test_link_bonding_rssconf,
-};
-
-REGISTER_TEST_COMMAND(test_link_bonding_rssconf_cmd);
+REGISTER_TEST_COMMAND(link_bonding_rssconf_autotest, test_link_bonding_rssconf);
index d0a9962369057141e2051de305120cfdd54e1256..6985ddde3beee3341da10eac5ed7747cd64335ea 100644 (file)
@@ -86,8 +86,4 @@ test_logs(void)
        return 0;
 }
 
-static struct test_command logs_cmd = {
-       .command = "logs_autotest",
-       .callback = test_logs,
-};
-REGISTER_TEST_COMMAND(logs_cmd);
+REGISTER_TEST_COMMAND(logs_autotest, test_logs);
index f6930fbd1eaf764171b51a0eecff81b4eae374e3..b6ad2ebd3e6baca768d9ac457e88b6b2c6f1c95a 100644 (file)
@@ -1238,8 +1238,4 @@ test_lpm(void)
        return global_status;
 }
 
-static struct test_command lpm_cmd = {
-       .command = "lpm_autotest",
-       .callback = test_lpm,
-};
-REGISTER_TEST_COMMAND(lpm_cmd);
+REGISTER_TEST_COMMAND(lpm_autotest, test_lpm);
index 458a10bfdc2b673a50f1fa84bf2b369aebfbfaa1..0fd0ef71c64ebdba71b2e6fbd744cefeeb0d05fc 100644 (file)
@@ -1764,8 +1764,4 @@ test_lpm6(void)
        return global_status;
 }
 
-static struct test_command lpm6_cmd = {
-       .command = "lpm6_autotest",
-       .callback = test_lpm6,
-};
-REGISTER_TEST_COMMAND(lpm6_cmd);
+REGISTER_TEST_COMMAND(lpm6_autotest, test_lpm6);
index b7d46314cefae03e88e0eec4e1b4f92369a29545..be47d4a18de70f0b2c3405fe04183a3b63393451 100644 (file)
@@ -184,8 +184,4 @@ test_lpm6_perf(void)
        return 0;
 }
 
-static struct test_command lpm6_perf_cmd = {
-       .command = "lpm6_perf_autotest",
-       .callback = test_lpm6_perf,
-};
-REGISTER_TEST_COMMAND(lpm6_perf_cmd);
+REGISTER_TEST_COMMAND(lpm6_perf_autotest, test_lpm6_perf);
index 41da811c75c511d02883a0d251ac00b768f8514e..58eb415e477e8da8dfa2ba6b1ecdfc039c3b6e82 100644 (file)
@@ -242,8 +242,4 @@ test_lpm_perf(void)
        return 0;
 }
 
-static struct test_command lpm_perf_cmd = {
-       .command = "lpm_perf_autotest",
-       .callback = test_lpm_perf,
-};
-REGISTER_TEST_COMMAND(lpm_perf_cmd);
+REGISTER_TEST_COMMAND(lpm_perf_autotest, test_lpm_perf);
index a04a751ad8f2f947952863740c91afd9fbc0272f..0673d85b7ebd51fa4134eb9f29ec4ecbe209d9ac 100644 (file)
@@ -959,8 +959,4 @@ test_malloc(void)
        return 0;
 }
 
-static struct test_command malloc_cmd = {
-       .command = "malloc_autotest",
-       .callback = test_malloc,
-};
-REGISTER_TEST_COMMAND(malloc_cmd);
+REGISTER_TEST_COMMAND(malloc_autotest, test_malloc);
index 8664885dd9d4cf2d5173cea562f7e74f9ad4619d..684ad80f932866559f05261679a84936d65c29ff 100644 (file)
@@ -1026,8 +1026,4 @@ test_mbuf(void)
        return 0;
 }
 
-static struct test_command mbuf_cmd = {
-       .command = "mbuf_autotest",
-       .callback = test_mbuf,
-};
-REGISTER_TEST_COMMAND(mbuf_cmd);
+REGISTER_TEST_COMMAND(mbuf_autotest, test_mbuf);
index 8195e209929ff1673f4c280371a3f16834c23084..1d93dd53b12516b603c48a8b0f6fe08f2935eedc 100644 (file)
@@ -159,8 +159,4 @@ test_memcpy(void)
        return 0;
 }
 
-static struct test_command memcpy_cmd = {
-       .command = "memcpy_autotest",
-       .callback = test_memcpy,
-};
-REGISTER_TEST_COMMAND(memcpy_cmd);
+REGISTER_TEST_COMMAND(memcpy_autotest, test_memcpy);
index be69eada84d75eb0060b6951e499fde380df4a26..ff3aaaacad35223788f4b769e7f7fbc98442be14 100644 (file)
@@ -351,8 +351,4 @@ test_memcpy_perf(void)
        return 0;
 }
 
-static struct test_command memcpy_perf_cmd = {
-       .command = "memcpy_perf_autotest",
-       .callback = test_memcpy_perf,
-};
-REGISTER_TEST_COMMAND(memcpy_perf_cmd);
+REGISTER_TEST_COMMAND(memcpy_perf_autotest, test_memcpy_perf);
index 6816385ba7e17fea5161c17595d6e3c46528f338..921bdc88338721b745ef0ff96e981b03d2a29222 100644 (file)
@@ -86,8 +86,4 @@ test_memory(void)
        return 0;
 }
 
-static struct test_command memory_cmd = {
-       .command = "memory_autotest",
-       .callback = test_memory,
-};
-REGISTER_TEST_COMMAND(memory_cmd);
+REGISTER_TEST_COMMAND(memory_autotest, test_memory);
index 9ea9831461dbced521fa3e2f279069889886caaa..46ad6702f5a5a72165e73c098d1861a12f4528a8 100644 (file)
@@ -609,8 +609,4 @@ err:
        return -1;
 }
 
-static struct test_command mempool_cmd = {
-       .command = "mempool_autotest",
-       .callback = test_mempool,
-};
-REGISTER_TEST_COMMAND(mempool_cmd);
+REGISTER_TEST_COMMAND(mempool_autotest, test_mempool);
index 4fac04cd06f761214214ba0a2532c325b32c1d1b..c0b3f5ce5e407813f6400bb80ef3ce086a32fbd5 100644 (file)
@@ -381,8 +381,4 @@ 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);
+REGISTER_TEST_COMMAND(mempool_perf_autotest, test_mempool_perf);
index cadd86f667a689b8628f75b8b7f5e385667ce9a3..7ae31cf7461579ea8e6471f88e56b1ecbb05654d 100644 (file)
@@ -872,8 +872,4 @@ test_memzone(void)
        return 0;
 }
 
-static struct test_command memzone_cmd = {
-       .command = "memzone_autotest",
-       .callback = test_memzone,
-};
-REGISTER_TEST_COMMAND(memzone_cmd);
+REGISTER_TEST_COMMAND(memzone_autotest, test_memzone);
index bc76391fcde8f51adde6882d751addbc9d986de4..26b0565788591713d72e4dec60c3125cfe7186f3 100644 (file)
@@ -494,8 +494,4 @@ test_meter(void)
 
 }
 
-static struct test_command meter_cmd = {
-       .command = "meter_autotest",
-       .callback = test_meter,
-};
-REGISTER_TEST_COMMAND(meter_cmd);
+REGISTER_TEST_COMMAND(meter_autotest, test_meter);
index f66b68f22aae89283a0ff51654a92e6e106dc9f4..26c4afd67fd47b564f8b1fc6bff31f513f01d3b7 100644 (file)
@@ -282,8 +282,4 @@ test_mp_secondary(void)
        return run_object_creation_tests();
 }
 
-static struct test_command multiprocess_cmd = {
-       .command = "multiprocess_autotest",
-       .callback = test_mp_secondary,
-};
-REGISTER_TEST_COMMAND(multiprocess_cmd);
+REGISTER_TEST_COMMAND(multiprocess_autotest, test_mp_secondary);
index 354a0ad90e9ded2a69d8ec087cfac2b1d2c3e7da..69f78d9263012a7be599babc2615dc6f8b461a09 100644 (file)
@@ -315,8 +315,4 @@ test_pci(void)
        return 0;
 }
 
-static struct test_command pci_cmd = {
-       .command = "pci_autotest",
-       .callback = test_pci,
-};
-REGISTER_TEST_COMMAND(pci_cmd);
+REGISTER_TEST_COMMAND(pci_autotest, test_pci);
index f452cdb071faa01dafa62e8c1fb6354f25a920cc..747513d47ba04bd3f558b5c6c4a2142bc17e3819 100644 (file)
@@ -136,8 +136,4 @@ 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);
+REGISTER_TEST_COMMAND(per_lcore_autotest, test_per_lcore);
index 3d56cd29a5dbcd7468ebdac580b17d680c2c0a2c..e055aa07260d7340d883a69a78aa4fa19b55f82d 100644 (file)
@@ -910,8 +910,4 @@ test_set_rxtx_sc(cmdline_fixed_string_t type)
        return -1;
 }
 
-static struct test_command pmd_perf_cmd = {
-       .command = "pmd_perf_autotest",
-       .callback = test_pmd_perf,
-};
-REGISTER_TEST_COMMAND(pmd_perf_cmd);
+REGISTER_TEST_COMMAND(pmd_perf_autotest, test_pmd_perf);
index 34fea09c5427809e9b4b7acf2936d70298487b1b..47374db254cc58130af0dd4cd6a6eca671bcae87 100644 (file)
@@ -526,8 +526,4 @@ 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);
+REGISTER_TEST_COMMAND(ring_pmd_autotest, test_pmd_ring);
index 3077dbad79cdaae12c2d07565d92c4e35fc7fb2d..af011f7db5c415e0a340ba7836f31de3327f64dc 100644 (file)
@@ -181,8 +181,4 @@ test_ring_pmd_perf(void)
        return 0;
 }
 
-static struct test_command ring_pmd_perf_cmd = {
-       .command = "ring_pmd_perf_autotest",
-       .callback = test_ring_pmd_perf,
-};
-REGISTER_TEST_COMMAND(ring_pmd_perf_cmd);
+REGISTER_TEST_COMMAND(ring_pmd_perf_autotest, test_ring_pmd_perf);
index 64a230545a4eb4aa3bc0312dcd05e66fa9878d57..b2e1344c3d6c34b8a66716de2cce1e184893d20c 100644 (file)
@@ -104,8 +104,4 @@ fail_all:
        return -1;
 }
 
-static struct test_command power_cmd = {
-       .command = "power_autotest",
-       .callback = test_power,
-};
-REGISTER_TEST_COMMAND(power_cmd);
+REGISTER_TEST_COMMAND(power_autotest, test_power);
index 0fb1569984cfd2e7efe082264d5574177afe115b..64f5dd567935b9dd41e1227da0b176a1c1a0dfcd 100644 (file)
@@ -537,8 +537,4 @@ fail_all:
        return -1;
 }
 
-static struct test_command power_acpi_cpufreq_cmd = {
-       .command = "power_acpi_cpufreq_autotest",
-       .callback = test_power_acpi_cpufreq,
-};
-REGISTER_TEST_COMMAND(power_acpi_cpufreq_cmd);
+REGISTER_TEST_COMMAND(power_acpi_cpufreq_autotest, test_power_acpi_cpufreq);
index ff468c1e5b27469475074481cee073a784b20545..253a5f8b6f425df161705f84d5b6d96de88f535a 100644 (file)
@@ -300,8 +300,4 @@ fail_all:
        return -1;
 }
 
-static struct test_command power_kvm_vm_cmd = {
-       .command = "power_kvm_vm_autotest",
-       .callback = test_power_kvm_vm,
-};
-REGISTER_TEST_COMMAND(power_kvm_vm_cmd);
+REGISTER_TEST_COMMAND(power_kvm_vm_autotest, test_power_kvm_vm);
index f8615e2451ae5da6d055cf8d9d988186f3b76050..80afaaf345b36774566fdb52d403c129ee289d25 100644 (file)
@@ -58,8 +58,4 @@ test_prefetch(void)
        return 0;
 }
 
-static struct test_command prefetch_cmd = {
-       .command = "prefetch_autotest",
-       .callback = test_prefetch,
-};
-REGISTER_TEST_COMMAND(prefetch_cmd);
+REGISTER_TEST_COMMAND(prefetch_autotest, test_prefetch);
index 7d1c32c4dea54bde895d37726cbe12cf6d066eb5..348075dc396e4a154d7935722abdaf0a2de2e2f9 100644 (file)
@@ -1880,20 +1880,6 @@ test_red_all(void)
        return tell_the_result(num_tests, num_pass);
 }
 
-static struct test_command red_cmd = {
-       .command = "red_autotest",
-       .callback = test_red,
-};
-REGISTER_TEST_COMMAND(red_cmd);
-
-static struct test_command red_cmd_perf = {
-       .command = "red_perf",
-       .callback = test_red_perf,
-};
-REGISTER_TEST_COMMAND(red_cmd_perf);
-
-static struct test_command red_cmd_all = {
-       .command = "red_all",
-       .callback = test_red_all,
-};
-REGISTER_TEST_COMMAND(red_cmd_all);
+REGISTER_TEST_COMMAND(red_autotest, test_red);
+REGISTER_TEST_COMMAND(red_perf, test_red_perf);
+REGISTER_TEST_COMMAND(red_all, test_red_all);
index 67f3151bcb0fecf3faca90aef626ff3f08e169a4..e8a0a2f2341e7a8272d5ea814ebf6d946203d10e 100644 (file)
@@ -383,8 +383,4 @@ test_reorder(void)
        return unit_test_suite_runner(&reorder_test_suite);
 }
 
-static struct test_command reorder_cmd = {
-       .command = "reorder_autotest",
-       .callback = test_reorder,
-};
-REGISTER_TEST_COMMAND(reorder_cmd);
+REGISTER_TEST_COMMAND(reorder_autotest, test_reorder);
index 39a6468909f87c65471c3d92138c84d390eb9340..a3a82f13a5a56ad10dec1bb3aefe977d0f17f7b2 100644 (file)
@@ -130,8 +130,4 @@ static int test_resource(void)
        return 0;
 }
 
-static struct test_command resource_cmd = {
-       .command = "resource_autotest",
-       .callback = test_resource,
-};
-REGISTER_TEST_COMMAND(resource_cmd);
+REGISTER_TEST_COMMAND(resource_autotest, test_resource);
index 9095e5976768177e8ae61b3ae45278392d79f125..ebcb8964155336d04ce6220468cfcf4513a8c3af 100644 (file)
@@ -1378,8 +1378,4 @@ test_ring(void)
        return 0;
 }
 
-static struct test_command ring_cmd = {
-       .command = "ring_autotest",
-       .callback = test_ring,
-};
-REGISTER_TEST_COMMAND(ring_cmd);
+REGISTER_TEST_COMMAND(ring_autotest, test_ring);
index 8c47ccb7e883fe81586d5c55996c981d7451e3e6..320c20cd2cb4c0918bdf207372f7cc9ca49f9ee6 100644 (file)
@@ -414,8 +414,4 @@ 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);
+REGISTER_TEST_COMMAND(ring_perf_autotest, test_ring_perf);
index b383bba20da33d6c08166c60c34df84257982e0a..50f58adec284bd344bc8e5985c0fdc512bd8ea3e 100644 (file)
@@ -129,8 +129,4 @@ test_rwlock(void)
        return 0;
 }
 
-static struct test_command rwlock_cmd = {
-       .command = "rwlock_autotest",
-       .callback = test_rwlock,
-};
-REGISTER_TEST_COMMAND(rwlock_cmd);
+REGISTER_TEST_COMMAND(rwlock_autotest, test_rwlock);
index 9712f9f0994662c0e6d21cbed97da0d61ef28657..63ab084f52804135866fb09887a695e4ff00a2e0 100644 (file)
@@ -213,8 +213,4 @@ test_sched(void)
        return 0;
 }
 
-static struct test_command sched_cmd = {
-       .command = "sched_autotest",
-       .callback = test_sched,
-};
-REGISTER_TEST_COMMAND(sched_cmd);
+REGISTER_TEST_COMMAND(sched_autotest, test_sched);
index 180d6deb3b45f7f56f06df38d2ca25741b2cade8..2d94eecc21a99a299423002043d36b43886df864 100644 (file)
@@ -333,8 +333,4 @@ test_spinlock(void)
        return ret;
 }
 
-static struct test_command spinlock_cmd = {
-       .command = "spinlock_autotest",
-       .callback = test_spinlock,
-};
-REGISTER_TEST_COMMAND(spinlock_cmd);
+REGISTER_TEST_COMMAND(spinlock_autotest, test_spinlock);
index 39e6a9dac36d6a1ce42e08dac217f7bacb1de659..8b4359aa7946c9ded423dfa005621eb2acd5caad 100644 (file)
@@ -166,8 +166,4 @@ test_string_fns(void)
        return 0;
 }
 
-static struct test_command string_cmd = {
-       .command = "string_autotest",
-       .callback = test_string_fns,
-};
-REGISTER_TEST_COMMAND(string_cmd);
+REGISTER_TEST_COMMAND(string_autotest, test_string_fns);
index 676dab23dc3171a2b78c1d911d8c06f74775949f..1faa0a6d80a511c2e671655a63b20224736ce9dd 100644 (file)
@@ -199,8 +199,4 @@ test_table(void)
        return 0;
 }
 
-static struct test_command table_cmd = {
-       .command = "table_autotest",
-       .callback = test_table,
-};
-REGISTER_TEST_COMMAND(table_cmd);
+REGISTER_TEST_COMMAND(table_autotest, test_table);
index c046a8ac5371534f5033429cf3a47abd54bb0c66..33a3e8a9c841b8d1835d652cfeceb0b6d889d223 100644 (file)
@@ -154,8 +154,4 @@ test_tailq(void)
        return ret;
 }
 
-static struct test_command tailq_cmd = {
-       .command = "tailq_autotest",
-       .callback = test_tailq,
-};
-REGISTER_TEST_COMMAND(tailq_cmd);
+REGISTER_TEST_COMMAND(tailq_autotest, test_tailq);
index 8e9dca0576f68655b659bdbe99e1e8298050bb76..61754a947506c40fb4b86706ef441b28a204e111 100644 (file)
@@ -169,8 +169,4 @@ test_thash(void)
        return 0;
 }
 
-static struct test_command thash_cmd = {
-       .command = "thash_autotest",
-       .callback = test_thash,
-};
-REGISTER_TEST_COMMAND(thash_cmd);
+REGISTER_TEST_COMMAND(thash_autotest, test_thash);
index bc07925e2409910315c5931368b24e62c52a8823..2f6525a50622917fa5986eb86f32f49109146876 100644 (file)
@@ -626,8 +626,4 @@ test_timer(void)
        return TEST_SUCCESS;
 }
 
-static struct test_command timer_cmd = {
-       .command = "timer_autotest",
-       .callback = test_timer,
-};
-REGISTER_TEST_COMMAND(timer_cmd);
+REGISTER_TEST_COMMAND(timer_autotest, test_timer);
index 3f7ddd30371682e63bf5da5a8da7d4477a791dfa..fa77efbd25fe2a5631a30761acceef8cd38b9eb7 100644 (file)
@@ -158,8 +158,4 @@ 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);
+REGISTER_TEST_COMMAND(timer_perf_autotest, test_timer_perf);
index aef320372a659550c7132a5bf8f2c1ec36b5f6f3..7824ec4bf6191f9b76300102e5f20d44d51811ba 100644 (file)
@@ -202,8 +202,4 @@ test_timer_racecond(void)
        return TEST_SUCCESS;
 }
 
-static struct test_command timer_racecond_cmd = {
-       .command = "timer_racecond_autotest",
-       .callback = test_timer_racecond,
-};
-REGISTER_TEST_COMMAND(timer_racecond_cmd);
+REGISTER_TEST_COMMAND(timer_racecond_autotest, test_timer_racecond);
index f66827d086f58ae8e4754a1df306531442ead3cf..afc0d0b888dde834acb2d2cbff4a2a9b8e2cb17c 100644 (file)
@@ -54,8 +54,4 @@ test_version(void)
        return 0;
 }
 
-static struct test_command version_cmd = {
-       .command = "version_autotest",
-       .callback = test_version,
-};
-REGISTER_TEST_COMMAND(version_cmd);
+REGISTER_TEST_COMMAND(version_autotest, test_version);