From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 22F0A426E6; Sun, 8 Oct 2023 03:51:21 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8D4D440263; Sun, 8 Oct 2023 03:51:20 +0200 (CEST) Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by mails.dpdk.org (Postfix) with ESMTP id D04944021F for ; Sun, 8 Oct 2023 03:51:18 +0200 (CEST) Received: from dggpeml100024.china.huawei.com (unknown [172.30.72.55]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4S34lR0SGjztT8L; Sun, 8 Oct 2023 09:46:43 +0800 (CST) Received: from [10.67.121.161] (10.67.121.161) by dggpeml100024.china.huawei.com (7.185.36.115) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Sun, 8 Oct 2023 09:51:16 +0800 Subject: Re: [PATCH] test/dma: add test skip status To: Gowrishankar Muthukrishnan , CC: , Vamsi Attunuru References: <20230810115933.2164-1-gmuthukrishn@marvell.com> From: fengchengwen Message-ID: Date: Sun, 8 Oct 2023 09:51:16 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <20230810115933.2164-1-gmuthukrishn@marvell.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.121.161] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To dggpeml100024.china.huawei.com (7.185.36.115) X-CFilter-Loop: Reflected X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Hi Gowrishankar, It was already support in test framework (unit_test_suite), I suggest not invent. Could you help refactoring the test_dmadev (use the test framework) ? PS: could refer test_fbarray.c Thanks. On 2023/8/10 19:59, Gowrishankar Muthukrishnan wrote: > Add status on skipped tests. > > Signed-off-by: Gowrishankar Muthukrishnan > --- > app/test/test_dmadev_api.c | 26 +++++++++++++++++++------- > 1 file changed, 19 insertions(+), 7 deletions(-) > > diff --git a/app/test/test_dmadev_api.c b/app/test/test_dmadev_api.c > index 4a181af90a..a1646472b0 100644 > --- a/app/test/test_dmadev_api.c > +++ b/app/test/test_dmadev_api.c > @@ -9,6 +9,8 @@ > #include > #include > > +#include "test.h" > + > extern int test_dma_api(uint16_t dev_id); > > #define DMA_TEST_API_RUN(test) \ > @@ -17,9 +19,6 @@ extern int test_dma_api(uint16_t dev_id); > #define TEST_MEMCPY_SIZE 1024 > #define TEST_WAIT_US_VAL 50000 > > -#define TEST_SUCCESS 0 > -#define TEST_FAILED -1 > - > static int16_t test_dev_id; > static int16_t invalid_dev_id; > > @@ -29,6 +28,7 @@ static char *dst; > static int total; > static int passed; > static int failed; > +static int skipped; > > static int > testsuite_setup(int16_t dev_id) > @@ -49,6 +49,7 @@ testsuite_setup(int16_t dev_id) > total = 0; > passed = 0; > failed = 0; > + skipped = 0; > > /* Set dmadev log level to critical to suppress unnecessary output > * during API tests. > @@ -78,12 +79,22 @@ testsuite_run_test(int (*test)(void), const char *name) > > if (test) { > ret = test(); > - if (ret < 0) { > - failed++; > - printf("%s Failed\n", name); > - } else { > + switch (ret) { > + case TEST_SUCCESS: > passed++; > printf("%s Passed\n", name); > + break; > + case TEST_FAILED: > + failed++; > + printf("%s Failed\n", name); > + break; > + case TEST_SKIPPED: > + skipped++; > + printf("%s Skipped\n", name); > + break; > + default: > + printf("Invalid test status\n"); > + break; > } > } > > @@ -566,6 +577,7 @@ test_dma_api(uint16_t dev_id) > printf("Total tests : %d\n", total); > printf("Passed : %d\n", passed); > printf("Failed : %d\n", failed); > + printf("Skipped : %d\n", skipped); > > if (failed) > return -1; >