From patchwork Wed Dec 3 09:22:21 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Taras Kondratiuk X-Patchwork-Id: 41839 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 15DBA25E66 for ; Wed, 3 Dec 2014 09:23:13 +0000 (UTC) Received: by mail-la0-f69.google.com with SMTP id ge10sf5720387lab.8 for ; Wed, 03 Dec 2014 01:23:12 -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=FR9/Wm6Lshp0zfHBUTPBpk/JetpicGTJP/IXymZ1Hj4=; b=Qi6E573FemI7sj9nPRdPB+M1BghhawagnfWv2cu287IeLVnBcukDHV80on6Wwr5dNH I0/S9gDti9QB7/V9rkhrRkOdwhYJEzPu5JUsEAbwe/rMoFPHK6BcaVmnO393DLnL66Rb b6267M4XGd8DMl2Xz7JQMJgBJTm1PmV1/9+7c7L0WIfOALOFnpj7MdJHKEU41Gucn1EE A8M0XWwJ7HTuGsGjl42csfmK95Cv3CarJbtRRuibQJO6JEfL87lUlAeZHbR4F2Oe1JOd 35ePRG6Pftqm1hNM7o2F2JtvBU7shEOet9NyfYXLoolWDtkK1Gpz1Yen4mlIWIbQq0oq 2s2Q== X-Gm-Message-State: ALoCoQlW6TEQ/RkMwBk2N1o29XyEuAHxiuYaOPXLwkh3mAXs83tk55ia6ABf3CJgjEV3nK39ifYe X-Received: by 10.112.166.102 with SMTP id zf6mr188423lbb.12.1417598592062; Wed, 03 Dec 2014 01:23:12 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.87.205 with SMTP id ba13ls143610lab.33.gmail; Wed, 03 Dec 2014 01:23:11 -0800 (PST) X-Received: by 10.152.5.132 with SMTP id s4mr3272249las.39.1417598591760; Wed, 03 Dec 2014 01:23:11 -0800 (PST) Received: from mail-la0-f53.google.com (mail-la0-f53.google.com. [209.85.215.53]) by mx.google.com with ESMTPS id df8si22540943lac.23.2014.12.03.01.23.11 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 03 Dec 2014 01:23:11 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) client-ip=209.85.215.53; Received: by mail-la0-f53.google.com with SMTP id gm9so12364361lab.12 for ; Wed, 03 Dec 2014 01:23:11 -0800 (PST) X-Received: by 10.152.87.100 with SMTP id w4mr3234918laz.71.1417598591636; Wed, 03 Dec 2014 01:23:11 -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 ew9csp633486lbc; Wed, 3 Dec 2014 01:23:10 -0800 (PST) X-Received: by 10.140.28.73 with SMTP id 67mr6245403qgy.53.1417598590385; Wed, 03 Dec 2014 01:23:10 -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 63si24730153qgf.122.2014.12.03.01.23.09 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 03 Dec 2014 01:23:10 -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 1Xw69M-0005zz-8t; Wed, 03 Dec 2014 09:23:08 +0000 Received: from mail-wg0-f41.google.com ([74.125.82.41]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1Xw68w-0005vn-U5 for lng-odp@lists.linaro.org; Wed, 03 Dec 2014 09:22:43 +0000 Received: by mail-wg0-f41.google.com with SMTP id y19so19219048wgg.14 for ; Wed, 03 Dec 2014 01:22:37 -0800 (PST) X-Received: by 10.194.87.100 with SMTP id w4mr5636287wjz.65.1417598557460; Wed, 03 Dec 2014 01:22:37 -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.35 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 03 Dec 2014 01:22:36 -0800 (PST) From: Taras Kondratiuk To: lng-odp@lists.linaro.org Date: Wed, 3 Dec 2014 11:22:21 +0200 Message-Id: <1417598541-31897-6-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 5/5] validation: init: use CU_register_suites() for tests registration 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.53 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/odp_init.c | 47 ++++++++++++++++++++------------------------ 1 file changed, 21 insertions(+), 26 deletions(-) diff --git a/test/validation/odp_init.c b/test/validation/odp_init.c index aa7439d..477aa12 100644 --- a/test/validation/odp_init.c +++ b/test/validation/odp_init.c @@ -20,38 +20,33 @@ static void test_odp_init_global(void) CU_ASSERT(status == 0); } -static int init_suite(void) +CU_TestInfo test_odp_init[] = { + {"test_odp_init_global", test_odp_init_global}, + CU_TEST_INFO_NULL, +}; + +CU_SuiteInfo odp_testsuites[] = { + {"Init", NULL, NULL, NULL, NULL, test_odp_init}, + CU_SUITE_INFO_NULL, +}; + +int main(void) { + int ret; + printf("\tODP API version: %s\n", odp_version_api_str()); printf("\tODP implementation version: %s\n", odp_version_impl_str()); - return 0; -} -static int finalise(void) -{ - return 0; -} + CU_set_error_action(CUEA_ABORT); -int main(void) -{ - CU_pSuite ptr_suite = NULL; - /* initialize the CUnit test registry */ - if (CUE_SUCCESS != CU_initialize_registry()) - return CU_get_error(); - /* add a suite to the registry */ - ptr_suite = CU_add_suite(__FILE__, init_suite, finalise); - if (NULL == ptr_suite) { - CU_cleanup_registry(); - return CU_get_error(); - } - /* add the tests to the suite */ - if (NULL == CU_ADD_TEST(ptr_suite, test_odp_init_global)) { - CU_cleanup_registry(); - return CU_get_error(); - } - /* Run all tests using the CUnit Basic interface */ + CU_initialize_registry(); + CU_register_suites(odp_testsuites); CU_basic_set_mode(CU_BRM_VERBOSE); CU_basic_run_tests(); + + ret = CU_get_number_of_failure_records(); + CU_cleanup_registry(); - return CU_get_error(); + + return ret; }