From patchwork Mon Dec 1 17:05:30 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Taras Kondratiuk X-Patchwork-Id: 41802 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id CE35E24001 for ; Mon, 1 Dec 2014 17:06:33 +0000 (UTC) Received: by mail-wi0-f198.google.com with SMTP id r20sf7055166wiv.9 for ; Mon, 01 Dec 2014 09:06:33 -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=L1/ghBoxjx1AEr9QesH2ETS+2hY2LFzcnd9g4ex89CQ=; b=cp97KwyaNvecKtaK/ZE5OQJ0MHvIFR4WvEEGY3Nz86TyrwOilfuvznoBmhV0dICAvv PUJUQZ97ctaBg+LB0ZsqZRsukCDRSyXtQSjlrr7FBFW3LjapkTTV4hK0j74bXatXxtXx RcSB4TmpnChfWxqPZ/rX0FZbhrUZTLZnP60IU1kvvhBCJEo3P+McaCls35ITQyaOP/Js 1EnXjbrWs2iTkTMAHDcsrGLbiGGvR9oqgrsNlYaCSQ4KioC4hU7tw7cGFzTuNs70iU61 D4/HpQOIs8qvGsTG2PDntLh+5qpVCYOaVGwiB6nYaItktO+dtM/2ldtWGtrXKElZbakQ ZnCQ== X-Gm-Message-State: ALoCoQlG3ZkAmoOIBsMFk+pZtaP6rmvOpWyIFum2VS3GfoHD6CVCKL5uJUiA7lC3JRxTflryLmzc X-Received: by 10.152.42.196 with SMTP id q4mr876436lal.6.1417453593130; Mon, 01 Dec 2014 09:06:33 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.8.133 with SMTP id r5ls1082533laa.65.gmail; Mon, 01 Dec 2014 09:06:33 -0800 (PST) X-Received: by 10.112.199.138 with SMTP id jk10mr12710200lbc.86.1417453592981; Mon, 01 Dec 2014 09:06:32 -0800 (PST) Received: from mail-la0-f42.google.com (mail-la0-f42.google.com. [209.85.215.42]) by mx.google.com with ESMTPS id sd7si18227529lbb.51.2014.12.01.09.06.32 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 01 Dec 2014 09:06:32 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.42 as permitted sender) client-ip=209.85.215.42; Received: by mail-la0-f42.google.com with SMTP id s18so9282858lam.1 for ; Mon, 01 Dec 2014 09:06:32 -0800 (PST) X-Received: by 10.152.2.165 with SMTP id 5mr10215339lav.40.1417453592891; Mon, 01 Dec 2014 09:06:32 -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 ew9csp330535lbc; Mon, 1 Dec 2014 09:06:31 -0800 (PST) X-Received: by 10.220.82.199 with SMTP id c7mr29745819vcl.61.1417453590414; Mon, 01 Dec 2014 09:06:30 -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 w67si21173816qge.33.2014.12.01.09.06.29 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 01 Dec 2014 09:06:30 -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 1XvUQe-00012H-DG; Mon, 01 Dec 2014 17:06:28 +0000 Received: from mail-la0-f41.google.com ([209.85.215.41]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XvUQ0-0000zJ-Jv for lng-odp@lists.linaro.org; Mon, 01 Dec 2014 17:05:48 +0000 Received: by mail-la0-f41.google.com with SMTP id hv19so4474146lab.14 for ; Mon, 01 Dec 2014 09:05:43 -0800 (PST) X-Received: by 10.112.160.137 with SMTP id xk9mr15366256lbb.99.1417453543006; Mon, 01 Dec 2014 09:05:43 -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.41 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 01 Dec 2014 09:05:42 -0800 (PST) From: Taras Kondratiuk To: lng-odp@lists.linaro.org Date: Mon, 1 Dec 2014 19:05:30 +0200 Message-Id: <1417453530-18743-6-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 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.42 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; }