get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 92087,
    "url": "http://patches.dpdk.org/api/patches/92087/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20210423161820.2135053-3-ciara.power@intel.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": "<20210423161820.2135053-3-ciara.power@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210423161820.2135053-3-ciara.power@intel.com",
    "date": "2021-04-23T16:18:15",
    "name": "[v3,2/7] test: introduce parent testsuite format",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "5ec3a35fcc1b9e42eb75c080462992f8056ae4bd",
    "submitter": {
        "id": 978,
        "url": "http://patches.dpdk.org/api/people/978/?format=api",
        "name": "Power, Ciara",
        "email": "ciara.power@intel.com"
    },
    "delegate": {
        "id": 6690,
        "url": "http://patches.dpdk.org/api/users/6690/?format=api",
        "username": "akhil",
        "first_name": "akhil",
        "last_name": "goyal",
        "email": "gakhil@marvell.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20210423161820.2135053-3-ciara.power@intel.com/mbox/",
    "series": [
        {
            "id": 16638,
            "url": "http://patches.dpdk.org/api/series/16638/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=16638",
            "date": "2021-04-23T16:18:13",
            "name": "test: refactor crypto unit test framework",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/16638/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/92087/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/92087/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id F40F5A0547;\n\tFri, 23 Apr 2021 18:18:58 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 9FE9641103;\n\tFri, 23 Apr 2021 18:18:53 +0200 (CEST)",
            "from mga18.intel.com (mga18.intel.com [134.134.136.126])\n by mails.dpdk.org (Postfix) with ESMTP id A9442410FE\n for <dev@dpdk.org>; Fri, 23 Apr 2021 18:18:50 +0200 (CEST)",
            "from orsmga008.jf.intel.com ([10.7.209.65])\n by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 23 Apr 2021 09:18:50 -0700",
            "from silpixa00400355.ir.intel.com (HELO\n silpixa00400355.ger.corp.intel.com) ([10.237.223.148])\n by orsmga008.jf.intel.com with ESMTP; 23 Apr 2021 09:18:47 -0700"
        ],
        "IronPort-SDR": [
            "\n iLshPO4hcyk4+WO2c2piEjI24TqXvbzWtIpnvDJUaqzFaeyAo3vO7An/fSAL4Ce6wsC2auzvzK\n 2wXh8d/2E9YQ==",
            "\n yO2Aq/Fyzr8uOPiRrm4qdKbefm4vFSaPMhXLoc7cKPfe2MCfl6BbthYU1qH9LNOzwAEsIchiv7\n +72UssgeKiQA=="
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6200,9189,9963\"; a=\"183572762\"",
            "E=Sophos;i=\"5.82,246,1613462400\"; d=\"scan'208\";a=\"183572762\"",
            "E=Sophos;i=\"5.82,246,1613462400\"; d=\"scan'208\";a=\"428442311\""
        ],
        "X-ExtLoop1": "1",
        "From": "Ciara Power <ciara.power@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "thomas@monjalon.net, declan.doherty@intel.com, gakhil@marvell.com,\n aconole@redhat.com, hemant.agrawal@nxp.com, anoobj@marvell.com,\n ruifeng.wang@arm.com, asomalap@amd.com, ajit.khaparde@broadcom.com,\n g.singh@nxp.com, Ciara Power <ciara.power@intel.com>",
        "Date": "Fri, 23 Apr 2021 16:18:15 +0000",
        "Message-Id": "<20210423161820.2135053-3-ciara.power@intel.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20210423161820.2135053-1-ciara.power@intel.com>",
        "References": "<20210423161820.2135053-1-ciara.power@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v3 2/7] test: introduce parent testsuite format",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "The current structure for unit testing only allows for running a\ntest suite with nested test cases. This means all test cases for an\nautotest must be in one suite, which is not ideal.\nFor example, in some cases we may want to run multiple lists of test\ncases that each require different setup, so should be in separate suites.\n\nThe unit test suite struct is modified to hold a pointer to a list of\nsub-testsuite pointers, along with the list of testcases as before.\n\nSigned-off-by: Ciara Power <ciara.power@intel.com>\n\n---\nv3:\n  - Added condition check to macro that loops sub-testsuites.\n  - Changed execution to allow for mixture of sub-testsuites and\n    testcases, by removing the if/else condition.\n  - Moved testcase execution above sub-testsuite execution,\n    to improve output readability.\nv2:\n  - Added macro to loop sub-testsuites.\n  - Added sub-testsuite summary detail.\n---\n app/test/test.c | 70 ++++++++++++++++++++++++++++++++++++++++++++++---\n app/test/test.h |  1 +\n 2 files changed, 68 insertions(+), 3 deletions(-)",
    "diff": "diff --git a/app/test/test.c b/app/test/test.c\nindex 2fb99d0855..ac0a66392a 100644\n--- a/app/test/test.c\n+++ b/app/test/test.c\n@@ -41,6 +41,12 @@ extern cmdline_parse_ctx_t main_ctx[];\n \t\tsuite->unit_test_cases[iter].testcase;\t\t\t\\\n \t\titer++, case = suite->unit_test_cases[iter])\n \n+#define FOR_EACH_SUITE_TESTSUITE(iter, suite, sub_ts)\t\t\t\\\n+\tfor (iter = 0, sub_ts = suite->unit_test_suites ?\t\t\\\n+\t\tsuite->unit_test_suites[0]:NULL; sub_ts &&\t\t\\\n+\t\tsuite->unit_test_suites[iter]->suite_name != NULL;\t\\\n+\t\titer++, sub_ts = suite->unit_test_suites[iter])\n+\n const char *prgname; /* to be set to argv[0] */\n \n static const char *recursive_call; /* used in linux for MP and other tests */\n@@ -241,11 +247,26 @@ main(int argc, char **argv)\n \n static void\n unit_test_suite_count_tcs_on_setup_fail(struct unit_test_suite *suite,\n-\t\tint test_success)\n+\t\tint test_success, unsigned int *sub_ts_failed,\n+\t\tunsigned int *sub_ts_skipped, unsigned int *sub_ts_total)\n {\n \tstruct unit_test_case tc;\n+\tstruct unit_test_suite *ts;\n \tint i;\n \n+\tFOR_EACH_SUITE_TESTSUITE(i, suite, ts) {\n+\t\tunit_test_suite_count_tcs_on_setup_fail(\n+\t\t\tts, test_success, sub_ts_failed,\n+\t\t\tsub_ts_skipped, sub_ts_total);\n+\t\tsuite->total += ts->total;\n+\t\tsuite->failed += ts->failed;\n+\t\tsuite->skipped += ts->skipped;\n+\t\tif (ts->failed)\n+\t\t\t(*sub_ts_failed)++;\n+\t\telse\n+\t\t\t(*sub_ts_skipped)++;\n+\t\t(*sub_ts_total)++;\n+\t}\n \tFOR_EACH_SUITE_TESTCASE(i, suite, tc) {\n \t\tsuite->total++;\n \t\tif (!tc.enabled || test_success == TEST_SKIPPED)\n@@ -258,6 +279,11 @@ unit_test_suite_count_tcs_on_setup_fail(struct unit_test_suite *suite,\n static void\n unit_test_suite_reset_counts(struct unit_test_suite *suite)\n {\n+\tstruct unit_test_suite *ts;\n+\tint i;\n+\n+\tFOR_EACH_SUITE_TESTSUITE(i, suite, ts)\n+\t\tunit_test_suite_reset_counts(ts);\n \tsuite->total = 0;\n \tsuite->executed = 0;\n \tsuite->succeeded = 0;\n@@ -269,9 +295,12 @@ unit_test_suite_reset_counts(struct unit_test_suite *suite)\n int\n unit_test_suite_runner(struct unit_test_suite *suite)\n {\n-\tint test_success;\n+\tint test_success, i, ret;\n \tconst char *status;\n \tstruct unit_test_case tc;\n+\tstruct unit_test_suite *ts;\n+\tunsigned int sub_ts_succeeded = 0, sub_ts_failed = 0;\n+\tunsigned int sub_ts_skipped = 0, sub_ts_total = 0;\n \n \tunit_test_suite_reset_counts(suite);\n \n@@ -288,7 +317,8 @@ unit_test_suite_runner(struct unit_test_suite *suite)\n \t\t\t * mark them as failed/skipped\n \t\t\t */\n \t\t\tunit_test_suite_count_tcs_on_setup_fail(suite,\n-\t\t\t\t\ttest_success);\n+\t\t\t\t\ttest_success, &sub_ts_failed,\n+\t\t\t\t\t&sub_ts_skipped, &sub_ts_total);\n \t\t\tgoto suite_summary;\n \t\t}\n \t}\n@@ -342,6 +372,23 @@ unit_test_suite_runner(struct unit_test_suite *suite)\n \t\tprintf(\" + TestCase [%2d] : %s %s\\n\", suite->total,\n \t\t\t\ttc.name, status);\n \t}\n+\tFOR_EACH_SUITE_TESTSUITE(i, suite, ts) {\n+\t\tret = unit_test_suite_runner(ts);\n+\t\tif (ret == TEST_SUCCESS)\n+\t\t\tsub_ts_succeeded++;\n+\t\telse if (ret == TEST_SKIPPED)\n+\t\t\tsub_ts_skipped++;\n+\t\telse\n+\t\t\tsub_ts_failed++;\n+\t\tsub_ts_total++;\n+\n+\t\tsuite->total += ts->total;\n+\t\tsuite->succeeded += ts->succeeded;\n+\t\tsuite->failed += ts->failed;\n+\t\tsuite->skipped += ts->skipped;\n+\t\tsuite->unsupported += ts->unsupported;\n+\t\tsuite->executed += ts->executed;\n+\t}\n \n \t/* Run test suite teardown */\n \tif (suite->teardown)\n@@ -352,6 +399,23 @@ unit_test_suite_runner(struct unit_test_suite *suite)\n suite_summary:\n \tprintf(\" + ------------------------------------------------------- +\\n\");\n \tprintf(\" + Test Suite Summary : %s\\n\", suite->suite_name);\n+\tprintf(\" + ------------------------------------------------------- +\\n\");\n+\n+\tFOR_EACH_SUITE_TESTSUITE(i, suite, ts)\n+\t\tprintf(\" + %s : %d/%d passed, %d/%d skipped, \"\n+\t\t\t\"%d/%d failed, %d/%d unsupported\\n\", ts->suite_name,\n+\t\t\tts->succeeded, ts->total, ts->skipped, ts->total,\n+\t\t\tts->failed, ts->total, ts->unsupported, ts->total);\n+\n+\tif (suite->unit_test_suites) {\n+\t\tprintf(\" + ------------------------------------------------------- +\\n\");\n+\t\tprintf(\" + Sub Testsuites Total :     %2d\\n\", sub_ts_total);\n+\t\tprintf(\" + Sub Testsuites Skipped :   %2d\\n\", sub_ts_skipped);\n+\t\tprintf(\" + Sub Testsuites Passed :    %2d\\n\", sub_ts_succeeded);\n+\t\tprintf(\" + Sub Testsuites Failed :    %2d\\n\", sub_ts_failed);\n+\t\tprintf(\" + ------------------------------------------------------- +\\n\");\n+\t}\n+\n \tprintf(\" + Tests Total :       %2d\\n\", suite->total);\n \tprintf(\" + Tests Skipped :     %2d\\n\", suite->skipped);\n \tprintf(\" + Tests Executed :    %2d\\n\", suite->executed);\ndiff --git a/app/test/test.h b/app/test/test.h\nindex 55f2850fed..f277df7c9d 100644\n--- a/app/test/test.h\n+++ b/app/test/test.h\n@@ -144,6 +144,7 @@ struct unit_test_suite {\n \tunsigned int skipped;\n \tunsigned int failed;\n \tunsigned int unsupported;\n+\tstruct unit_test_suite **unit_test_suites;\n \tstruct unit_test_case unit_test_cases[];\n };\n \n",
    "prefixes": [
        "v3",
        "2/7"
    ]
}