From patchwork Fri Nov 28 16:05:38 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Taras Kondratiuk X-Patchwork-Id: 41701 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f71.google.com (mail-ee0-f71.google.com [74.125.83.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B278A244C2 for ; Fri, 28 Nov 2014 16:06:19 +0000 (UTC) Received: by mail-ee0-f71.google.com with SMTP id c13sf4519921eek.2 for ; Fri, 28 Nov 2014 08:06:19 -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=j4JbL/SvJwrnIMB/XE2EiXjJSh1SdPNrHtPYdkfc+lVkhSLDk1XdD4EFsWVc9huuNJ 3KiAO0XnifdeFjP0v7SXCUm33HOjySHr3vV4koGz+Ugf66LIjHB8Akp1jQhYh2mpuQYp MEQhw00vNumpJGyJCTwrvR5ftnSWdVVcP+WZMGbxtV4eaN0EciUae+5f5zHWGt9S9hQU K0C9gVRs9h/3TdXQxZiiViDKedzUjximnJI8KSmla5t2U4IzcNK1PenKZKLWesaYryGW 7f+9T7tnqbtHKidneyK+u5529xAi2mf7OqnS5XREC9fXb6cudFJxnJXmZz7sJplEEjLS 1txg== X-Gm-Message-State: ALoCoQnJNbG9Fn7jp9zwW/D2/MA2VU85ZEOUAYEaABgZCK3/8K/PQM23SnRQtHEtjZc4K9vls0Nf X-Received: by 10.112.89.195 with SMTP id bq3mr12507936lbb.9.1417190779005; Fri, 28 Nov 2014 08:06:19 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.5.39 with SMTP id p7ls963795lap.5.gmail; Fri, 28 Nov 2014 08:06:18 -0800 (PST) X-Received: by 10.152.120.133 with SMTP id lc5mr44890515lab.62.1417190778724; Fri, 28 Nov 2014 08:06:18 -0800 (PST) Received: from mail-lb0-f175.google.com (mail-lb0-f175.google.com. [209.85.217.175]) by mx.google.com with ESMTPS id 4si5195077lat.76.2014.11.28.08.06.18 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 28 Nov 2014 08:06:18 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.175 as permitted sender) client-ip=209.85.217.175; Received: by mail-lb0-f175.google.com with SMTP id u10so5653495lbd.20 for ; Fri, 28 Nov 2014 08:06:18 -0800 (PST) X-Received: by 10.152.43.103 with SMTP id v7mr21132104lal.29.1417190778619; Fri, 28 Nov 2014 08:06:18 -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 ew9csp115805lbc; Fri, 28 Nov 2014 08:06:17 -0800 (PST) X-Received: by 10.224.25.79 with SMTP id y15mr15961221qab.78.1417190776085; Fri, 28 Nov 2014 08:06:16 -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 s104si1709299qge.78.2014.11.28.08.06.14 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 28 Nov 2014 08:06:16 -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 1XuO3h-0002XU-TL; Fri, 28 Nov 2014 16:06:13 +0000 Received: from mail-wi0-f171.google.com ([209.85.212.171]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XuO3Q-0002UG-Gf for lng-odp@lists.linaro.org; Fri, 28 Nov 2014 16:05:56 +0000 Received: by mail-wi0-f171.google.com with SMTP id bs8so18972837wib.10 for ; Fri, 28 Nov 2014 08:05:51 -0800 (PST) X-Received: by 10.180.104.234 with SMTP id gh10mr60830049wib.3.1417190751068; Fri, 28 Nov 2014 08:05:51 -0800 (PST) Received: from uglx0153363.synapse.com ([195.238.92.128]) by mx.google.com with ESMTPSA id r10sm16438043wiy.19.2014.11.28.08.05.50 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 28 Nov 2014 08:05:50 -0800 (PST) From: Taras Kondratiuk To: lng-odp@lists.linaro.org Date: Fri, 28 Nov 2014 18:05:38 +0200 Message-Id: <1417190740-1212-4-git-send-email-taras.kondratiuk@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1417190740-1212-1-git-send-email-taras.kondratiuk@linaro.org> References: <1417190740-1212-1-git-send-email-taras.kondratiuk@linaro.org> Subject: [lng-odp] [RFC 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.175 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, +};