From patchwork Wed Dec 3 09:22:18 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Taras Kondratiuk X-Patchwork-Id: 41836 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D9E1925E66 for ; Wed, 3 Dec 2014 09:22:55 +0000 (UTC) Received: by mail-wi0-f199.google.com with SMTP id bs8sf9395339wib.10 for ; Wed, 03 Dec 2014 01:22:55 -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=6MbH7bjiAG+hVBdrF0OVlQSnwyzlDg/fMJ+fcIBjSlQ=; b=lYIJUXryEFl+1i3/S6vN+OzB/I79wPzmSPbr49Hpm4x8O71B7jgJnGiydsN/veun8f 2eoA0tYmVcq6CdKLceTkPoJ0f9GRb/r/bT7wc8L6k+rmG1CmziXxK/c5u5kbijobAu6Y Q1UdtkmuMolfG+kjpDsxY61YlX6ZwZxxfh44mOfO8lw7rS/2D2rd3b12RLwqJfQre2Ca E2XYqE5DbaPGtmT+dPZageaPXNn0n+RfVzhHrCfMpACuOeTZ+irwOo5GjAwbocqw1FTU 2r36n59M/2jw9KgKraW2F/YIEfNOhtANijRgWzf7s4P15xS2CkR025daowKVQ8G04lcQ UFiw== X-Gm-Message-State: ALoCoQmGmhW5iID2FlArHbFpvLWQZF/59mll/X6zcOC447TztVD13NgDWROcd8lQ3KH8wMhRb8B4 X-Received: by 10.112.166.102 with SMTP id zf6mr188186lbb.12.1417598575126; Wed, 03 Dec 2014 01:22:55 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.42.137 with SMTP id o9ls110626lal.17.gmail; Wed, 03 Dec 2014 01:22:54 -0800 (PST) X-Received: by 10.112.201.72 with SMTP id jy8mr3238464lbc.65.1417598574822; Wed, 03 Dec 2014 01:22:54 -0800 (PST) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com. [209.85.217.182]) by mx.google.com with ESMTPS id l2si22527793lbc.48.2014.12.03.01.22.54 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 03 Dec 2014 01:22:54 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.182 as permitted sender) client-ip=209.85.217.182; Received: by mail-lb0-f182.google.com with SMTP id f15so12683647lbj.41 for ; Wed, 03 Dec 2014 01:22:54 -0800 (PST) X-Received: by 10.112.189.10 with SMTP id ge10mr3226965lbc.23.1417598574748; Wed, 03 Dec 2014 01:22:54 -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 ew9csp633459lbc; Wed, 3 Dec 2014 01:22:54 -0800 (PST) X-Received: by 10.229.174.70 with SMTP id s6mr6336622qcz.7.1417598573565; Wed, 03 Dec 2014 01:22:53 -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 o51si27292277qge.76.2014.12.03.01.22.52 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 03 Dec 2014 01:22:53 -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 1Xw694-0005wT-Qq; Wed, 03 Dec 2014 09:22:50 +0000 Received: from mail-wg0-f47.google.com ([74.125.82.47]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1Xw68r-0005vV-A3 for lng-odp@lists.linaro.org; Wed, 03 Dec 2014 09:22:37 +0000 Received: by mail-wg0-f47.google.com with SMTP id n12so19419083wgh.20 for ; Wed, 03 Dec 2014 01:22:31 -0800 (PST) X-Received: by 10.180.81.70 with SMTP id y6mr12149050wix.6.1417598551901; Wed, 03 Dec 2014 01:22:31 -0800 (PST) Received: from uglx0153363.synapse.com ([195.238.92.128]) by mx.google.com with ESMTPSA id mc10sm49901450wic.24.2014.12.03.01.22.30 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 03 Dec 2014 01:22:31 -0800 (PST) From: Taras Kondratiuk To: lng-odp@lists.linaro.org Date: Wed, 3 Dec 2014 11:22:18 +0200 Message-Id: <1417598541-31897-3-git-send-email-taras.kondratiuk@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1417598541-31897-1-git-send-email-taras.kondratiuk@linaro.org> References: <1417598541-31897-1-git-send-email-taras.kondratiuk@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCHv2 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.217.182 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 */