From patchwork Mon Dec 1 17:05:28 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Taras Kondratiuk X-Patchwork-Id: 41800 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f199.google.com (mail-lb0-f199.google.com [209.85.217.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5AA0E24001 for ; Mon, 1 Dec 2014 17:06:23 +0000 (UTC) Received: by mail-lb0-f199.google.com with SMTP id u10sf6877031lbd.10 for ; Mon, 01 Dec 2014 09:06:22 -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=troBMXtZwv8PM2k561G6tHXd8ub6XCSn+oHTX/5IOrg=; b=h9go/ohqLfhlb+wwMB5OrqniEzWKbdPG9gcK4IW3fkf0hgFNa8GnJl910etG/oFzlN Hh/5bxDA1sIP7YDbEFEbWa7vbL4lEYN2lGjJZVDYZ7R2yzF2H2nkWfwucOfhZaTSEiG2 sYFGRqp44Ft4zn2Uv5coLIuffo1EG1sudqQ5sIyZAOW6ZH96gTTYs60Nigfiw/2/k2AM PHY7cJEOnrVjSVPfPVY8NwJ4Z2GgYhDK0MqFvoraqgB+/6HpM17f/wL22Bwzzm0xGqMa kzPJf0y67SwEoL1u78wtvLM1rTnSnyG+oV+tsdYe37M8Pp1JmDMz62F+ygl/lqQjPjJ3 HB0A== X-Gm-Message-State: ALoCoQlg8aXiIW1zigY4/3xZSanY8HKL1BBwhzXouRTZ0U0bDmfus9kH7bd8spOUXQTezUm6EDYB X-Received: by 10.180.98.39 with SMTP id ef7mr3024542wib.6.1417453582276; Mon, 01 Dec 2014 09:06:22 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.19.227 with SMTP id i3ls220796lae.28.gmail; Mon, 01 Dec 2014 09:06:22 -0800 (PST) X-Received: by 10.112.142.197 with SMTP id ry5mr58697497lbb.26.1417453582115; Mon, 01 Dec 2014 09:06:22 -0800 (PST) Received: from mail-lb0-f178.google.com (mail-lb0-f178.google.com. [209.85.217.178]) by mx.google.com with ESMTPS id i7si18263020lbc.8.2014.12.01.09.06.22 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 01 Dec 2014 09:06:22 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.178 as permitted sender) client-ip=209.85.217.178; Received: by mail-lb0-f178.google.com with SMTP id f15so9760583lbj.23 for ; Mon, 01 Dec 2014 09:06:22 -0800 (PST) X-Received: by 10.152.43.12 with SMTP id s12mr5016666lal.67.1417453582014; Mon, 01 Dec 2014 09:06:22 -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 ew9csp330493lbc; Mon, 1 Dec 2014 09:06:20 -0800 (PST) X-Received: by 10.170.82.66 with SMTP id y63mr68741635yky.68.1417453579441; Mon, 01 Dec 2014 09:06:19 -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 f4si21085358qgf.125.2014.12.01.09.06.18 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 01 Dec 2014 09:06:19 -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 1XvUQT-00011A-Gx; Mon, 01 Dec 2014 17:06:17 +0000 Received: from mail-la0-f52.google.com ([209.85.215.52]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XvUPy-0000zH-CL for lng-odp@lists.linaro.org; Mon, 01 Dec 2014 17:05:46 +0000 Received: by mail-la0-f52.google.com with SMTP id hs14so4340552lab.25 for ; Mon, 01 Dec 2014 09:05:40 -0800 (PST) X-Received: by 10.112.130.132 with SMTP id oe4mr57797848lbb.82.1417453540777; Mon, 01 Dec 2014 09:05:40 -0800 (PST) Received: from uglx0153363.synapse.com ([195.238.92.128]) by mx.google.com with ESMTPSA id kw10sm1228243lac.45.2014.12.01.09.05.39 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 01 Dec 2014 09:05:40 -0800 (PST) From: Taras Kondratiuk To: lng-odp@lists.linaro.org Date: Mon, 1 Dec 2014 19:05:28 +0200 Message-Id: <1417453530-18743-4-git-send-email-taras.kondratiuk@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1417453530-18743-1-git-send-email-taras.kondratiuk@linaro.org> References: <1417453530-18743-1-git-send-email-taras.kondratiuk@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCH 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.217.178 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 --- test/validation/Makefile.am | 2 +- test/validation/odp_queue.c | 53 ++++++++----------------------------------- 2 files changed, 10 insertions(+), 45 deletions(-) diff --git a/test/validation/Makefile.am b/test/validation/Makefile.am index 8b55bad..1f5eed4 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..50df6d4 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) @@ -107,17 +107,6 @@ static void test_odp_queue_sunnyday(void) 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; @@ -125,36 +114,12 @@ static int init_suite(void) 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(); - - /* 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(); - } +CU_TestInfo test_odp_queue[] = { + {"queue sunnyday", test_odp_queue_sunnyday}, + CU_TEST_INFO_NULL, +}; - /* 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_suite, NULL, NULL, NULL, test_odp_queue}, + CU_SUITE_INFO_NULL, +};