From patchwork Fri Nov 28 16:05:37 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Taras Kondratiuk X-Patchwork-Id: 41700 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 039BF244C2 for ; Fri, 28 Nov 2014 16:06:19 +0000 (UTC) Received: by mail-wg0-f70.google.com with SMTP id b13sf4369239wgh.1 for ; Fri, 28 Nov 2014 08:06:18 -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=DfbUdDzcnBTHjmUQzZ8RvGxFRQ2cm9ukBkwj1H2HPNU=; b=JnW0NOZYgIxJzzF2MUqz/m3r8DWGCZjKLzyiLVdoCd817mfFzy7VTa6oAFwZH9WD7F 21G486Y2Gg7K1PE2CpMpRZo45wPPAHoG0zWbfNbPBe1eVq4Ip/Rd17d2r4zs1IXeqj4S tMg0lJEd/So+jw70fg5+qgA/ytFeyWjFBPuYjFwoHJBkw68FL7MpdsCfSUgwF74ZLBKj ehAztsSd35Dog3u/inuHSo5gE6a2QjGcSIxNOb+pnTm79c/SK9u2dUXL6FOZ7mW1vC7W gtaQPKV8n7zufgL/q/9MRbDfTCiMjNsF9u8J1uC6cbkmBplR/mfd/JQZmXngwGgbyrD7 IMfA== X-Gm-Message-State: ALoCoQk2tjf9o4+L9t2RC/X0VHDu6LABkRRlMSX4jTmGVfSJBxH9lAiYjtnafzwZwyDxjCh0elbx X-Received: by 10.112.159.199 with SMTP id xe7mr299846lbb.21.1417190778271; Fri, 28 Nov 2014 08:06:18 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.6.169 with SMTP id c9ls145626laa.104.gmail; Fri, 28 Nov 2014 08:06:17 -0800 (PST) X-Received: by 10.152.205.11 with SMTP id lc11mr44678293lac.34.1417190777545; Fri, 28 Nov 2014 08:06:17 -0800 (PST) Received: from mail-la0-f49.google.com (mail-la0-f49.google.com. [209.85.215.49]) by mx.google.com with ESMTPS id x8si10383482lax.57.2014.11.28.08.06.17 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 28 Nov 2014 08:06:17 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) client-ip=209.85.215.49; Received: by mail-la0-f49.google.com with SMTP id hs14so5750305lab.22 for ; Fri, 28 Nov 2014 08:06:17 -0800 (PST) X-Received: by 10.152.6.228 with SMTP id e4mr44577517laa.71.1417190777422; Fri, 28 Nov 2014 08:06:17 -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 ew9csp115799lbc; Fri, 28 Nov 2014 08:06:16 -0800 (PST) X-Received: by 10.236.206.42 with SMTP id k30mr44232188yho.58.1417190775935; Fri, 28 Nov 2014 08:06:15 -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 n7si12203783qai.101.2014.11.28.08.06.10 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 28 Nov 2014 08:06:15 -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 1XuO3d-0002WA-GT; Fri, 28 Nov 2014 16:06:09 +0000 Received: from mail-wi0-f172.google.com ([209.85.212.172]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XuO3P-0002UF-Ed for lng-odp@lists.linaro.org; Fri, 28 Nov 2014 16:05:55 +0000 Received: by mail-wi0-f172.google.com with SMTP id n3so19000278wiv.5 for ; Fri, 28 Nov 2014 08:05:50 -0800 (PST) X-Received: by 10.180.198.211 with SMTP id je19mr9475236wic.27.1417190749991; Fri, 28 Nov 2014 08:05:49 -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.48 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 28 Nov 2014 08:05:49 -0800 (PST) From: Taras Kondratiuk To: lng-odp@lists.linaro.org Date: Fri, 28 Nov 2014 18:05:37 +0200 Message-Id: <1417190740-1212-3-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 2/5] validation: common: add tests_global_init() 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.215.49 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/common/odp_cunit_common.c | 9 +++++++++ test/validation/common/odp_cunit_common.h | 14 ++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/test/validation/common/odp_cunit_common.c b/test/validation/common/odp_cunit_common.c index c87e103..14ba840 100644 --- a/test/validation/common/odp_cunit_common.c +++ b/test/validation/common/odp_cunit_common.c @@ -36,6 +36,11 @@ int odp_cunit_thread_exit(pthrd_arg *arg) return 0; } +__attribute__((__weak__)) int tests_global_init(void) +{ + return 0; +} + int main(void) { int ret; @@ -52,6 +57,10 @@ int main(void) return -1; } + ret = tests_global_init(); + if (ret) + return ret; + CU_set_error_action(CUEA_ABORT); CU_initialize_registry(); diff --git a/test/validation/common/odp_cunit_common.h b/test/validation/common/odp_cunit_common.h index 9ce0df5..b367002 100644 --- a/test/validation/common/odp_cunit_common.h +++ b/test/validation/common/odp_cunit_common.h @@ -40,5 +40,19 @@ typedef struct { /** create thread fro start_routine function */ extern int odp_cunit_thread_create(void *func_ptr(void *), pthrd_arg *arg); extern int odp_cunit_thread_exit(pthrd_arg *); +/** + * Global tests initialization. + * + * Initialize global resources needed by all testsuites. Default weak definition + * do nothing. Test application can override it by defining a strong version. + * The function is called by the common main() just after ODP global/local + * initialization. + * + * @note: This function is a workaround for Crypto test and other applications + * should try not to use it, because it will complicate migration to a + * single test application in future. Normally each testsuite have to + * prepare its environment in its own init function. + */ +extern int tests_global_init(void); #endif /* ODP_COMMON_H */