get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/166/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

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