From patchwork Mon Dec 1 17:05:27 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Taras Kondratiuk X-Patchwork-Id: 41798 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f72.google.com (mail-wg0-f72.google.com [74.125.82.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3B34C24001 for ; Mon, 1 Dec 2014 17:06:18 +0000 (UTC) Received: by mail-wg0-f72.google.com with SMTP id y19sf6876824wgg.7 for ; Mon, 01 Dec 2014 09:06:17 -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=IbISFw4JEba/nOVUyRC9gaNQr06yTEeeZPlyX9iQc/s=; b=dO3G9MlVvh/rsWJHA04zuG6kyBGP+Ig+EUlDfMqHo1TAAMgTVrg0ylRJ6ZKnHwAfLb lplqgdN0iumNFdBbmpppzdX9N4ThKK1sigfi/s3kgJh2SJEmUuETOdVO8Awy4eAIUcUc f9pNphIwrPrI0cnudxOlGvUELD+iZAcW4/uR8xgg6hLtVXnjyP0Qgql/u9Muz/1t5NJA eifJ75H+xPZHsx1jqYjtyhUmeFFfbX4QQHWyQ/0ofwRiEX/gRHB6pd3l0HCPDvCdkdGI lHMhSdEIfM4B3gUUw4uBBbF6nXn97u7Tx/q0UIsdbeUGUdcB0kg4fQg1lGwFnsKQcJXP m0/w== X-Gm-Message-State: ALoCoQlJW+iwW/FoQTU80aSTqDB+E2itKVmsTXdlXA+iomP1xofcAXKipuKbyD68r0z8fsf2xcdX X-Received: by 10.152.8.67 with SMTP id p3mr16057350laa.4.1417453577458; Mon, 01 Dec 2014 09:06:17 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.44.194 with SMTP id g2ls1252635lam.3.gmail; Mon, 01 Dec 2014 09:06:17 -0800 (PST) X-Received: by 10.112.160.137 with SMTP id xk9mr15368857lbb.99.1417453577187; Mon, 01 Dec 2014 09:06:17 -0800 (PST) Received: from mail-la0-f44.google.com (mail-la0-f44.google.com. [209.85.215.44]) by mx.google.com with ESMTPS id vh9si18159962lac.134.2014.12.01.09.06.17 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 01 Dec 2014 09:06:17 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.44 as permitted sender) client-ip=209.85.215.44; Received: by mail-la0-f44.google.com with SMTP id ge10so9229735lab.3 for ; Mon, 01 Dec 2014 09:06:17 -0800 (PST) X-Received: by 10.112.52.37 with SMTP id q5mr57016337lbo.32.1417453577084; Mon, 01 Dec 2014 09: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 ew9csp330474lbc; Mon, 1 Dec 2014 09:06:15 -0800 (PST) X-Received: by 10.236.207.164 with SMTP id n24mr61477496yho.17.1417453575093; Mon, 01 Dec 2014 09: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 r6si1289185qay.111.2014.12.01.09.06.14 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 01 Dec 2014 09: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 1XvUQP-00010q-6D; Mon, 01 Dec 2014 17:06:13 +0000 Received: from mail-lb0-f169.google.com ([209.85.217.169]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XvUPx-0000zG-HL for lng-odp@lists.linaro.org; Mon, 01 Dec 2014 17:05:45 +0000 Received: by mail-lb0-f169.google.com with SMTP id p9so9025170lbv.0 for ; Mon, 01 Dec 2014 09:05:39 -0800 (PST) X-Received: by 10.112.198.1 with SMTP id iy1mr34531514lbc.13.1417453539740; Mon, 01 Dec 2014 09:05:39 -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.38 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 01 Dec 2014 09:05:39 -0800 (PST) From: Taras Kondratiuk To: lng-odp@lists.linaro.org Date: Mon, 1 Dec 2014 19:05:27 +0200 Message-Id: <1417453530-18743-3-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 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.44 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/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 1f30788..f967ca2 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_CUNICT_COMMON_H */