From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0080.outbound.protection.outlook.com [104.47.37.80]) by dpdk.org (Postfix) with ESMTP id 2D39969A5 for ; Sun, 19 Mar 2017 14:38:11 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=SrTC1+5Vyubgy/1d2fWiBPpgVsANnMTaLcOHFWTOUQ8=; b=XzUBMQMcFFVwRTUeKorYWSMGymLBpdZE8xgmJs0ERW/GNYjhEgxlHU3zOIGd1HjCIKu83WUfvMvNqIk4bz1kVmjefdQKrWQXLBzYB9fqLFYcK5KjbdDJBg3RWsKLFZr9rGis4fJVvge2yTNSb2e9dKJA4hLaRCTvR/ACB1ntmOI= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=caviumnetworks.com; Received: from localhost.localdomain (106.201.104.48) by BN3PR0701MB1719.namprd07.prod.outlook.com (10.163.39.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.977.11; Sun, 19 Mar 2017 13:38:07 +0000 From: Jerin Jacob To: dev@dpdk.org Cc: thomas.monjalon@6wind.com, harry.van.haaren@intel.com, Jerin Jacob Date: Sun, 19 Mar 2017 19:07:33 +0530 Message-Id: <1489930654-16827-2-git-send-email-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1489930654-16827-1-git-send-email-jerin.jacob@caviumnetworks.com> References: <1489930654-16827-1-git-send-email-jerin.jacob@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [106.201.104.48] X-ClientProxiedBy: BM1PR01CA0055.INDPRD01.PROD.OUTLOOK.COM (10.163.199.27) To BN3PR0701MB1719.namprd07.prod.outlook.com (10.163.39.18) X-MS-Office365-Filtering-Correlation-Id: 4b2f8138-06fb-490e-c901-08d46ecd2e70 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BN3PR0701MB1719; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 3:21M2/xxuQNKZ7DmxMLHL8sSWNLu2ejfvIMdDvksj+b3A81tfLO0SCgkbZEUQbbQS/jcUiQ6+/+lX4baB7VwDqm5730+lOB/Ep+3O7Cd2Jx5nOoYYt6MMSImBZViM90hgTMfQJ7xQMlhHTCw4eKNtriracp7r6WxYasq/AmMXHjk0zQYJ97pP2DS8RUL0Fpeh4Zyf41vplZGwAVri/VYIlemX8h1oNtCjDx6UOfDcLQ8FiKzakJ0P+iC/VWzbnRFMctnXYnRSGhYWEsI36ejHKg==; 25:gteg31ajOPiurHONqm4FP4sjZykfjwVN1PxZDZc+2ewtXyETL/SvG3UcKPXrEDv6P3Z+EYvYRk8Uvs/jWrjKE5cc4eIJkeWxqFPCua2jmHBzfpdMYkG+2FIg82cZk3dA2zLRPXCQ65aM5aGPieQvrkFlOSe/QtBjGLMI8aRwYlArfoY2B/+2bB9i/foOFtPixJb0A4PpvhhctgTeY6FqOrNutCeI3/N3h5CWMB57/WxMkpfGDG+9bsjDezK/m12W393p6gJxWjASpViEqpBtPj5MTzrklX6Dv1cGqsHuQth/FbLNYmUoP4BZ1pli3GvkRm7h/5nMhxIhgeOGb2d7IElX7xDcydAIvmAjPw90IHuzGmBguPXQi/qQ24KG2m0L5XvWeUhJLdeYgqXGyNG2RXKyreKY9gFElyXLaiaIn38fKha+9odU71OOsLQpCN7OevqouDOYXsMboL5dUW3dAA== X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 31:UVChKc6oZSuetLxrtJU+oOVGZYb+dzVqaTNJoaa4ppz76GHjF7iEtJ+CKA6PgnjJcDGYo/KwXj8uNAQtKNzl4/V5Dw4FwtIzDsDnkYg4gNW2PdEcnGgr4aSgCOmrDYFtW0v8ldaJxyOnm3GCTI+tj7ZSeg8XpofvxscwJNXE06CYMb0Y6tppVYDKtZlrHh+cFX5ci4r8Sg4m2vmVn1HRaJO4OwDG116fKpN1UG5vCZo=; 20:CEDMxQflNUHyfGrDAewwiMy94RHSPhAqReWtGpw+xDQXRmAyzq4ku8p41C88g1XKp6AgbQ5Ub6AJ6zC9vdQLp60NZAb3t+yf0HvfCvy/BVUPB9Uh/LV2tXo97glQ+RQe25dNzkdSfHJWOpWjl9HoPBkqCGy4T7HoUIUaLCxAVoedBP1yi4T7QrWAI5UXtx63YKC9AoEZGQLEJqxBTNhmus2r5cNLAaM3hXASIe5pD3Qr0s5iWPHxB6E09A8z4FLo4tpz4jBgN+buQrPAQjZZCq2dZznx0S13PZhTg2N6ZAWhsINxCd8z/1Su9iYmGMMhNitAJg7L9peHGQlRJlkc66e+UnN5nIZDxwO7I/CTZDOE7W9WhvVwW/6fN1Tbdsqbv+uuGPunFsqbqTSi7/VHAP77HptFFxNlAKn+jlYC18+qyfUpRDl6oLO4XyIf0JENbw2BKvLsdsUvwIqiIbtS+4nrHsztALIEG30gjwbxp7QTl4h0uRldmWQZWD3LZboqxEZQUZBmTgUEya0ciTC6Rby8mUU+FUHkGA0wTJAIoUJ64yjIb2mJyJYxnQR7Z9U2rZ9PS1nuCiNEvBhWpawCtc72meaCJJ1T7xJSysRGjEU= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6041248)(20161123562025)(20161123564025)(20161123555025)(20161123560025)(20161123558025)(6072148); SRVR:BN3PR0701MB1719; BCL:0; PCL:0; RULEID:; SRVR:BN3PR0701MB1719; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 4:RUHAFIbJaO07Odl7vI0s2B5L2I+cKeIZl2CboqaDQbbreZtSpoQA3a0BigtE3ZXaexFkfqzIGgXJbYyAYRFC0aXoFrEPIjMR4656j5M+bPnakWTbifYzl0V5Gg8U3lNz1TISJN+JJtuF9FdU5f3js8LBysLk2+Abwqf3xmdNA+ZtcfqXuoK3YTizrXW+pa8n71vMzSyb4cG4N7SoKy8AGSoiCJ202guCT7Vrl0vQDA9gqoXKfV6yFBowpLjiUXq/Kyk8cjIdC4wN/VD6u9EsWoJ8PraDc/1d/0APUXzvI8uRq9UyKlT98h0oVI0hsemUOz9RRc8FRO/zgI+JutO7WJGCVxpVazUMPU3/9QbsIn4HA6LKL9mtTWOBkJpkMJSaFv5lfM0SOvFMKf9jYYRRUDLP4oTXk5PyLM9P7CIZaeZNkhInTs5q5PZuCza8u8KKRdEkwJ2ZkZ87w8521eESR2Y2dLJuzTKfcymz82qv1LqXiANv/3m3aUxlh/SxcOo/NFJY75PgiPnlf1rWz3VXfkdsW8DJXOTAKY3tS1v5/UO7rw4qpYxZT63anEOYbHwpraqFYviIgB6Rn4eU2+Mb/SREbCZox2HIj+RI15IujOw= X-Forefront-PRVS: 025100C802 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(6069001)(39410400002)(39830400002)(39450400003)(7736002)(305945005)(6116002)(3846002)(50986999)(76176999)(5009440100003)(42186005)(36756003)(2361001)(33646002)(42882006)(6916009)(6666003)(2950100002)(66066001)(47776003)(2351001)(6506006)(5003940100001)(189998001)(50226002)(4326008)(8676002)(81166006)(53936002)(6512007)(5660300001)(25786008)(575784001)(6486002)(110136004)(38730400002)(107886003)(2906002)(50466002)(48376002); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR0701MB1719; H:localhost.localdomain; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN3PR0701MB1719; 23:6WZKfAN8DcmvzeYLJyg7KWYLQVld9VDCZY1YmJ7?= =?us-ascii?Q?DKPvHenhkthetxCyawwgFeei6e5LoBlHXDzcPj8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mM9jMQYbX4TWi8mPEkxjKcfn1bWHy2EUt3MPDYdxY2?= =?us-ascii?Q?rTP6oFFC6+eE3AvfX7Q+Dmtgh+WwfnY2SltShABU04z8yfq2YKe6O54/rcxa?= =?us-ascii?Q?vfCRQtUm2hDuh0F8DY/33PvSCrYWb?= X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 6:roLGSsezOt4ntwQddzm3uS2eLPWbMU0KjauA9nUCBvF+HKRP5S3jWQdufVvb8P+8XYjjqNTJGboDCB9dmB6RuJMWj4eERT9IoMkFz8+L1A6R1C2p0zoBgYdv3NXvcKnFo+JQgASsDn0fyKBcKd7a4z6+TBDoRzMyvySTfSSD5NLL2ft5xeWYP2GeGObIUXrbvcg9omTJIBPGs98oFD4pgGvQq9tt7EK01SC1oJOtowdU2dQT5uF1lJs3plJD5E6ByAZ1COLy8ZOufL8HhYfeXmxy5WuIYYS1UC/kqJ6RMNUzc2h98X7ys3/FJDdw7hdKFFU2svWv2SBfYQ5BtMr9A38N+MGBYRhes7F9t15O9PcrA1xT9DKc5amLWjXEZHfqjaseKYYH/8LAvgb889+eHg==; 5:Mr5DpoqnbRi210dt6ihT5EKOBtiNLWJBUsG0Qui3tOJruBRjnQkDrp6N5+vnnfreqr5ndru2BDo4mXHcuYqUqhkWF9JIG2ZT7XjtjVZnwfjnJtLnoBn/o4u0dgocnwbB1hvOL422O0c+szX7zY/9uA==; 24:iWgjRH++se6zH3TSecbQXihWdLipBiDrdoAGCyXDM02IIM3DtsnfCt2Ct5zV/JSpk6QVneXXVzalQX+YuWoHtZU3XKVIPm8hhoe+htFwX+Q= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 7:kn0g5hKt6YQ8YRkYV5YZXXoTH2ZD+Dp7gMsPVbDM0u3XPINL6iEOP3rLpUe3zGSDIvn1qW36WUIVKyjG3NIliJExgeUwLRwy1gQadjY6FOTTchfSlYWcm2bJFNQTns+tIUIzCN0Mx4e22lf2A7gPcSMRG5Q5GcnxteyLGZUnAQsSxt9gGJTFPCxGgQHndKtZl8eav6xpldlxx7QTVhxEH7Rfm7M1wklL5BmzsmPP6NbMrQRvLOBHP8mDkLCiMGs/Un7G0N+mf6xJnI0AjiCT68W3AZfZ1IpMu0SPPwuFUlWG8q3sCOajEIVczIHhu0i8Q7EWmCbY16vnhIEd+/h65Q== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Mar 2017 13:38:07.5353 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR0701MB1719 Subject: [dpdk-dev] [PATCH 1/2] test: store only the test case name X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Mar 2017 13:38:11 -0000 Store only the test case name in unit test case structure.The actor who renders the test status can add appropriate test status. This enables adding the new test case status without storing the additional information in the unit test case structure. Signed-off-by: Jerin Jacob --- test/test/test.c | 14 ++++++-------- test/test/test.h | 23 +++++++++-------------- 2 files changed, 15 insertions(+), 22 deletions(-) diff --git a/test/test/test.c b/test/test/test.c index cd0e784..a86dc86 100644 --- a/test/test/test.c +++ b/test/test/test.c @@ -158,6 +158,7 @@ unit_test_suite_runner(struct unit_test_suite *suite) { int test_success; unsigned total = 0, executed = 0, skipped = 0, succeeded = 0, failed = 0; + const char *status; if (suite->suite_name) { printf(" + ------------------------------------------------------- +\n"); @@ -201,15 +202,12 @@ unit_test_suite_runner(struct unit_test_suite *suite) suite->unit_test_cases[total].teardown(); if (test_success == TEST_SUCCESS) - printf(" + TestCase [%2d] : %s\n", total, - suite->unit_test_cases[total].success_msg ? - suite->unit_test_cases[total].success_msg : - "passed"); + status = "succeeded"; else - printf(" + TestCase [%2d] : %s\n", total, - suite->unit_test_cases[total].fail_msg ? - suite->unit_test_cases[total].fail_msg : - "failed"); + status = "failed"; + + printf(" + TestCase [%2d] : %s %s\n", total, + suite->unit_test_cases[total].name, status); total++; } diff --git a/test/test/test.h b/test/test/test.h index 82831f4..9a979d3 100644 --- a/test/test/test.h +++ b/test/test/test.h @@ -185,29 +185,24 @@ struct unit_test_case { int (*setup)(void); void (*teardown)(void); int (*testcase)(void); - const char *success_msg; - const char *fail_msg; + const char *name; unsigned enabled; }; -#define TEST_CASE(fn) { NULL, NULL, fn, #fn " succeeded", #fn " failed", 1 } +#define TEST_CASE(fn) { NULL, NULL, fn, #fn, 1 } -#define TEST_CASE_NAMED(name, fn) { NULL, NULL, fn, name " succeeded", \ - name " failed", 1 } +#define TEST_CASE_NAMED(name, fn) { NULL, NULL, fn, name, 1 } -#define TEST_CASE_ST(setup, teardown, testcase) \ - { setup, teardown, testcase, #testcase " succeeded", \ - #testcase " failed ", 1 } +#define TEST_CASE_ST(setup, teardown, testcase) \ + { setup, teardown, testcase, #testcase, 1 } -#define TEST_CASE_DISABLED(fn) { NULL, NULL, fn, #fn " succeeded", \ - #fn " failed", 0 } +#define TEST_CASE_DISABLED(fn) { NULL, NULL, fn, #fn, 0 } -#define TEST_CASE_ST_DISABLED(setup, teardown, testcase) \ - { setup, teardown, testcase, #testcase " succeeded", \ - #testcase " failed ", 0 } +#define TEST_CASE_ST_DISABLED(setup, teardown, testcase) \ + { setup, teardown, testcase, #testcase, 0 } -#define TEST_CASES_END() { NULL, NULL, NULL, NULL, NULL, 0 } +#define TEST_CASES_END() { NULL, NULL, NULL, NULL, 0 } #if RTE_LOG_LEVEL >= RTE_LOG_DEBUG #define TEST_HEXDUMP(file, title, buf, len) rte_hexdump(file, title, buf, len) -- 2.5.5