From patchwork Wed Dec 3 09:22:19 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Taras Kondratiuk X-Patchwork-Id: 41837 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id CB8D125E66 for ; Wed, 3 Dec 2014 09:22:59 +0000 (UTC) Received: by mail-wi0-f199.google.com with SMTP id bs8sf9395429wib.10 for ; Wed, 03 Dec 2014 01:22:59 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:subject:precedence:list-id:list-unsubscribe:list-archive :list-post:list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=UaD0OntpS5ezUy91DTkCBnIovyPd3RJajVGjyYAlybA=; b=OrUopwbAm/+bPRWxsyJbuwK+n3aES3+hPrDwcuSA48trryZtHzGp7J6vtrpndRKNQr 3nhE+DQcJvfUqK9w13Y0zxo0aAMm9y/8UiKzjhVLT17oJogYhESAOhummA67iGenR70e 5BwjnrroYIJtm43fVy1n0qv6Nv13lcEHM6XY7Lbt32fzY7DtcUWaL30LQy26RGmhiLZB tXLGu8bsqgkcg2AltmKjcKMNdZRCdEpOHwb+b3124GF3GwvGBqWqt5EBGX8VilPfPoFP 6tZJUGeYrTW0M72wQe63yVtjShzGqifr9zcNfaQSx/TTwklvTEKQGf/8FG0FktykSNqC JMvQ== X-Gm-Message-State: ALoCoQkWGPD0HzIJc9O1SRYo4iKOXlXI/Jr6ydkeqPlLyQ+Xt86s9caIAc3GWpO56Xhkxe/zT/bL X-Received: by 10.194.173.97 with SMTP id bj1mr139009wjc.2.1417598579155; Wed, 03 Dec 2014 01:22:59 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.7.193 with SMTP id l1ls147110laa.79.gmail; Wed, 03 Dec 2014 01:22:58 -0800 (PST) X-Received: by 10.112.17.1 with SMTP id k1mr3198941lbd.39.1417598578925; Wed, 03 Dec 2014 01:22:58 -0800 (PST) Received: from mail-la0-f41.google.com (mail-la0-f41.google.com. [209.85.215.41]) by mx.google.com with ESMTPS id zl4si6741496lbb.125.2014.12.03.01.22.58 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 03 Dec 2014 01:22:58 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.41 as permitted sender) client-ip=209.85.215.41; Received: by mail-la0-f41.google.com with SMTP id hv19so7571274lab.28 for ; Wed, 03 Dec 2014 01:22:58 -0800 (PST) X-Received: by 10.153.7.170 with SMTP id dd10mr3329266lad.44.1417598578802; Wed, 03 Dec 2014 01:22:58 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.184.201 with SMTP id ew9csp633464lbc; Wed, 3 Dec 2014 01:22:58 -0800 (PST) X-Received: by 10.229.105.196 with SMTP id u4mr6377524qco.27.1417598577616; Wed, 03 Dec 2014 01:22:57 -0800 (PST) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id q5si27347182qat.17.2014.12.03.01.22.56 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 03 Dec 2014 01:22:57 -0800 (PST) Received-SPF: none (google.com: lng-odp-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-35-177-41.ec2.internal) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1Xw699-0005yX-4K; Wed, 03 Dec 2014 09:22:55 +0000 Received: from mail-wi0-f180.google.com ([209.85.212.180]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1Xw68s-0005vZ-Ng for lng-odp@lists.linaro.org; Wed, 03 Dec 2014 09:22:38 +0000 Received: by mail-wi0-f180.google.com with SMTP id n3so23653692wiv.1 for ; Wed, 03 Dec 2014 01:22:33 -0800 (PST) X-Received: by 10.180.73.108 with SMTP id k12mr2714457wiv.24.1417598553317; Wed, 03 Dec 2014 01:22:33 -0800 (PST) Received: from uglx0153363.synapse.com ([195.238.92.128]) by mx.google.com with ESMTPSA id mc10sm49901450wic.24.2014.12.03.01.22.31 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 03 Dec 2014 01:22:32 -0800 (PST) From: Taras Kondratiuk To: lng-odp@lists.linaro.org Date: Wed, 3 Dec 2014 11:22:19 +0200 Message-Id: <1417598541-31897-4-git-send-email-taras.kondratiuk@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1417598541-31897-1-git-send-email-taras.kondratiuk@linaro.org> References: <1417598541-31897-1-git-send-email-taras.kondratiuk@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCHv2 3/5] validation: queue: reuse common main() function X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: lng-odp-bounces@lists.linaro.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: taras.kondratiuk@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.41 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Signed-off-by: Taras Kondratiuk Reviewed-by: Mike Holmes --- test/validation/Makefile.am | 2 +- test/validation/odp_queue.c | 64 +++++++------------------------------------ 2 files changed, 11 insertions(+), 55 deletions(-) diff --git a/test/validation/Makefile.am b/test/validation/Makefile.am index 837ae95..183fb0c 100644 --- a/test/validation/Makefile.am +++ b/test/validation/Makefile.am @@ -16,7 +16,7 @@ odp_shm_LDFLAGS = $(AM_LDFLAGS) endif dist_odp_init_SOURCES = odp_init.c -dist_odp_queue_SOURCES = odp_queue.c +dist_odp_queue_SOURCES = odp_queue.c common/odp_cunit_common.c dist_odp_crypto_SOURCES = crypto/odp_crypto_test_async_inp.c \ crypto/odp_crypto_test_sync_inp.c \ odp_crypto.c diff --git a/test/validation/odp_queue.c b/test/validation/odp_queue.c index 09dba0e..2c8fe80 100644 --- a/test/validation/odp_queue.c +++ b/test/validation/odp_queue.c @@ -5,7 +5,7 @@ */ #include "odp.h" -#include "CUnit/Basic.h" +#include "odp_cunit_common.h" #define MAX_BUFFER_QUEUE (8) #define MSG_POOL_SIZE (4*1024*1024) @@ -13,7 +13,7 @@ static int queue_contest = 0xff; -static int test_odp_buffer_pool_init(void) +static int init_queue_suite(void) { odp_buffer_pool_t pool; void *pool_base; @@ -105,56 +105,12 @@ static void test_odp_queue_sunnyday(void) return; } -static int init_suite(void) -{ - printf("\tODP API version: %s\n", odp_version_api_str()); - printf("\tODP implementation version: %s\n", odp_version_impl_str()); - - if (0 != odp_init_global(NULL, NULL)) { - printf("odp_init_global fail.\n"); - return -1; - } - if (0 != odp_init_local()) { - printf("odp_init_local fail.\n"); - return -1; - } - if (0 != test_odp_buffer_pool_init()) { - printf("test_odp_buffer_pool_init fail.\n"); - return -1; - } - return 0; -} - -static int finalize(void) -{ - odp_term_local(); - odp_term_global(); - return 0; -} - -int main(void) -{ - CU_pSuite ptr_suite = NULL; - - /* initialize the CUnit test registry */ - if (CUE_SUCCESS != CU_initialize_registry()) - return CU_get_error(); +CU_TestInfo test_odp_queue[] = { + {"queue sunnyday", test_odp_queue_sunnyday}, + CU_TEST_INFO_NULL, +}; - /* add the tests to the queue suite */ - ptr_suite = CU_add_suite(__FILE__, init_suite, finalize); - if (NULL == ptr_suite) { - CU_cleanup_registry(); - return CU_get_error(); - } - - if (NULL == CU_ADD_TEST(ptr_suite, test_odp_queue_sunnyday)) { - CU_cleanup_registry(); - return CU_get_error(); - } - - /* Run all tests using the CUnit Basic interface */ - CU_basic_set_mode(CU_BRM_VERBOSE); - CU_basic_run_tests(); - CU_cleanup_registry(); - return CU_get_error(); -} +CU_SuiteInfo odp_testsuites[] = { + {"Queue", init_queue_suite, NULL, NULL, NULL, test_odp_queue}, + CU_SUITE_INFO_NULL, +};