From patchwork Mon May 11 10:48:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Milard X-Patchwork-Id: 48235 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f69.google.com (mail-wg0-f69.google.com [74.125.82.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E7C6521550 for ; Mon, 11 May 2015 10:50:14 +0000 (UTC) Received: by wgtl5 with SMTP id l5sf38523669wgt.1 for ; Mon, 11 May 2015 03:50:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:delivered-to:from:to:date :message-id:in-reply-to:references:cc: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=AvvjECi7Ee7HsTMsEQWnUThxm/q/rCupfASOPJ8Nx3Q=; b=lqFDh1tRhWLQHXPpgQEGFmJ6CVEY5YhG38Xxg04HwsC5G02cOx8bj/Ofyhipz1pTyX qOnibNkQTsKnArSFb2dn/++g2qQx3r0aEwQR7gjEupaPMg+Gu8fv2mPJLwIISs7CW4NH vtc+seN4HhZJ8PVc9SfnU4U/m2TLEASEcXKMzhs6rRUET3qqJa1vyg+8eMs3qmA88GPC BNYoOn3i2pZZcfxdavPMXfyYKn07CUxQwf23C+FNS9zu0a/3PUsUjT1tq66ZuyockeUa yVx0u/AV5I7pJXbZ15bs9S33EyJG9PzJOO7JeMKWH+7iRcd2UUlet5YEnXZYrsqioXrA S5OA== X-Gm-Message-State: ALoCoQlfOIuT8j06kCAwRCGw7ox0F8YHNgCZIRf73487xHjVT3kXRgCZqhJTKpo6/1Bl7wxSX+mB X-Received: by 10.180.216.12 with SMTP id om12mr7245790wic.1.1431341414207; Mon, 11 May 2015 03:50:14 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.203.133 with SMTP id kq5ls572166lac.102.gmail; Mon, 11 May 2015 03:50:14 -0700 (PDT) X-Received: by 10.112.77.234 with SMTP id v10mr7506489lbw.119.1431341414041; Mon, 11 May 2015 03:50:14 -0700 (PDT) Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com. [209.85.217.181]) by mx.google.com with ESMTPS id d9si8153306lah.23.2015.05.11.03.50.13 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 May 2015 03:50:13 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.181 as permitted sender) client-ip=209.85.217.181; Received: by lbcga7 with SMTP id ga7so90994046lbc.1 for ; Mon, 11 May 2015 03:50:13 -0700 (PDT) X-Received: by 10.152.27.98 with SMTP id s2mr7670692lag.106.1431341413900; Mon, 11 May 2015 03:50:13 -0700 (PDT) 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.108.230 with SMTP id hn6csp1430828lbb; Mon, 11 May 2015 03:50:13 -0700 (PDT) X-Received: by 10.55.20.159 with SMTP id 31mr20487511qku.64.1431341409507; Mon, 11 May 2015 03:50:09 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id k39si12608775qgd.40.2015.05.11.03.50.08; Mon, 11 May 2015 03:50:09 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Received: by lists.linaro.org (Postfix, from userid 109) id 9960261B45; Mon, 11 May 2015 10:50:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from ip-10-142-244-252.ec2.internal (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 1C2D661586; Mon, 11 May 2015 10:49:39 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 1F3DA61800; Mon, 11 May 2015 10:49:35 +0000 (UTC) Received: from mail-la0-f43.google.com (mail-la0-f43.google.com [209.85.215.43]) by lists.linaro.org (Postfix) with ESMTPS id 9EABC61C8E for ; Mon, 11 May 2015 10:48:44 +0000 (UTC) Received: by layy10 with SMTP id y10so90227370lay.0 for ; Mon, 11 May 2015 03:48:43 -0700 (PDT) X-Received: by 10.112.166.37 with SMTP id zd5mr7454471lbb.75.1431341323502; Mon, 11 May 2015 03:48:43 -0700 (PDT) Received: from erachmi-VirtualBox.ki.sw.ericsson.se (c-83-233-90-46.cust.bredband2.com. [83.233.90.46]) by mx.google.com with ESMTPSA id x2sm2969919laj.8.2015.05.11.03.48.41 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 11 May 2015 03:48:42 -0700 (PDT) From: Christophe Milard To: anders.roxell@linaro.org, mike.holmes@linaro.org, stuart.haslam@linaro.org, maxim.uvarov@linaro.org Date: Mon, 11 May 2015 12:48:26 +0200 Message-Id: <1431341307-9933-3-git-send-email-christophe.milard@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1431341307-9933-1-git-send-email-christophe.milard@linaro.org> References: <1431341307-9933-1-git-send-email-christophe.milard@linaro.org> X-Topics: patch Cc: lng-odp@lists.linaro.org Subject: [lng-odp] [PATCH 2/3] validation: own main and renaming in odp_random.c X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 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" X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: christophe.milard@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.181 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 Renaming of things which may be, one day, exported in a lib. Also defining local test main. Things that are candidate to be exported in the lib in the future have been named as follows: -Tests, i.e. functions which are used in CUNIT testsuites are named: _test_* -Test arrays, i.e. arrays of CU_TestInfo, listing the test functions belonging to a suite, are called: _suite[_*] where the possible suffix can be used if many suites are declared. -CUNIT suite init and termination functions are called: _suite[_*]_init() and _suite[_*]_term() respectively. -Suite arrays, i.e. arrays of CU_SuiteInfo used in executables are called: _suites[_*] where the possible suffix identifies the executable using it, if many. -Main function(s), are called: _main[_*] where the possible suffix identifies the executable using it Signed-off-by: Christophe Milard --- test/validation/Makefile.am | 1 + test/validation/odp_random.c | 21 ++++++++++++++++----- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/test/validation/Makefile.am b/test/validation/Makefile.am index 7470d9d..6ddda79 100644 --- a/test/validation/Makefile.am +++ b/test/validation/Makefile.am @@ -51,6 +51,7 @@ dist_odp_init_SOURCES = odp_init.c dist_odp_init_abort_SOURCES = odp_init_abort.c dist_odp_init_log_SOURCES = odp_init_log.c dist_odp_queue_SOURCES = odp_queue.c $(ODP_CU_COMMON) +odp_random_CFLAGS = $(AM_CFLAGS) -DMODULE_HAS_OWN_MAIN dist_odp_random_SOURCES = odp_random.c $(ODP_CU_COMMON) dist_odp_scheduler_SOURCES = odp_scheduler.c $(ODP_CU_COMMON) dist_odp_shared_memory_SOURCES = odp_shared_memory.c $(ODP_CU_COMMON) diff --git a/test/validation/odp_random.c b/test/validation/odp_random.c index ebc9705..cefc52d 100644 --- a/test/validation/odp_random.c +++ b/test/validation/odp_random.c @@ -10,7 +10,7 @@ /* Helper macro for CU_TestInfo initialization */ #define _CU_TEST_INFO(test_func) {#test_func, test_func} -static void random_get_size(void) +static void random_test_get_size(void) { int32_t ret; uint8_t buf[32]; @@ -19,12 +19,23 @@ static void random_get_size(void) CU_ASSERT(ret == sizeof(buf)); } -CU_TestInfo test_odp_random[] = { - _CU_TEST_INFO(random_get_size), +static CU_TestInfo random_suite[] = { + _CU_TEST_INFO(random_test_get_size), CU_TEST_INFO_NULL, }; -CU_SuiteInfo odp_testsuites[] = { - {"Random", NULL, NULL, NULL, NULL, test_odp_random}, +static CU_SuiteInfo random_suites[] = { + {"Random", NULL, NULL, NULL, NULL, random_suite}, CU_SUITE_INFO_NULL, }; + +static int random_main(void) +{ + return odp_cunit_run(random_suites); +} + +/* the following main function will be seperated when lib is created */ +int main(void) +{ + return random_main(); +}