From patchwork Fri Nov 28 16:05:40 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Taras Kondratiuk X-Patchwork-Id: 41703 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f70.google.com (mail-wg0-f70.google.com [74.125.82.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4CD7A244C2 for ; Fri, 28 Nov 2014 16:06:30 +0000 (UTC) Received: by mail-wg0-f70.google.com with SMTP id b13sf4369506wgh.1 for ; Fri, 28 Nov 2014 08:06:29 -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=AKGKhXFeRkgXnbBkNqJlD4V+BHCouSHNrxH+e26MFIYnayWVH8ddLHF+3z5hSgDXsj R9A2L5Xjt27gpHXYyqbIElhcu7Oc59NJmHwTa8TtDjYalfQjnePXxYzN72X5aABu/+6A t9RwLr5O4YAra03ry52E7iolSqFQLQ9ED0IbvoVm5ccH7KIc+NXosOsoWM3mnu8eevly /UW8hT/mPBCHY+76EotD8Lwkn0qbBCEscmZhVYejqwywiWef6Ml1XWxcLqzQVj4C71p9 grTlQBEsJBUQ8TMowDHXT9AC83FjhP/Qr3IqiaeMhSQubblycNEeMGmQeAMlYQZt/e51 dcOw== X-Gm-Message-State: ALoCoQna7SD3d+BdsSxg+OeRqlmpCjueJz4qJ38XCFBynLiNBZp1TT4O7a2J2+YSlnXs4mrwlasC X-Received: by 10.112.130.8 with SMTP id oa8mr945124lbb.11.1417190789540; Fri, 28 Nov 2014 08:06:29 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.42.170 with SMTP id p10ls946994lal.35.gmail; Fri, 28 Nov 2014 08:06:29 -0800 (PST) X-Received: by 10.152.88.44 with SMTP id bd12mr29190772lab.88.1417190789399; Fri, 28 Nov 2014 08:06:29 -0800 (PST) Received: from mail-lb0-f169.google.com (mail-lb0-f169.google.com. [209.85.217.169]) by mx.google.com with ESMTPS id um10si10336875lbb.117.2014.11.28.08.06.29 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 28 Nov 2014 08:06:29 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.169 as permitted sender) client-ip=209.85.217.169; Received: by mail-lb0-f169.google.com with SMTP id p9so5835539lbv.0 for ; Fri, 28 Nov 2014 08:06:29 -0800 (PST) X-Received: by 10.152.3.67 with SMTP id a3mr475407laa.56.1417190789278; Fri, 28 Nov 2014 08:06:29 -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 ew9csp115830lbc; Fri, 28 Nov 2014 08:06:26 -0800 (PST) X-Received: by 10.224.69.200 with SMTP id a8mr30721513qaj.40.1417190786461; Fri, 28 Nov 2014 08:06:26 -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 y20si12178347qay.132.2014.11.28.08.06.25 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 28 Nov 2014 08:06:26 -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 1XuO3s-0002YV-K9; Fri, 28 Nov 2014 16:06:24 +0000 Received: from mail-wg0-f49.google.com ([74.125.82.49]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XuO3T-0002UM-GP for lng-odp@lists.linaro.org; Fri, 28 Nov 2014 16:05:59 +0000 Received: by mail-wg0-f49.google.com with SMTP id n12so938828wgh.22 for ; Fri, 28 Nov 2014 08:05:54 -0800 (PST) X-Received: by 10.180.218.39 with SMTP id pd7mr41613862wic.21.1417190753870; Fri, 28 Nov 2014 08:05:53 -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.52 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 28 Nov 2014 08:05:52 -0800 (PST) From: Taras Kondratiuk To: lng-odp@lists.linaro.org Date: Fri, 28 Nov 2014 18:05:40 +0200 Message-Id: <1417190740-1212-6-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 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.217.169 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/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; }