From patchwork Thu Jul 9 09:25:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Milard X-Patchwork-Id: 50926 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 05600228E5 for ; Thu, 9 Jul 2015 09:26:22 +0000 (UTC) Received: by wipp2 with SMTP id p2sf58583049wip.2 for ; Thu, 09 Jul 2015 02:26:21 -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=2U81bA/SrA2G1nhl7GbuzxhzlWUkMk0YcuvPbrHx0T8=; b=XqkGLsY+W0jko19pghIarWkEyIThZL/T2Tp6eDuSr0Voilaa7UwIdlRXYHuIseCY8z GWAsjvCyDTHugc+K56FN6/vgE5WeJGrcDZEbIuPA7LWdqUYgjKipZclk7ZMkIrpaNbhk nSRxRyTomApMf5ZEKulW/Km0GV23RPGYEBQgSafi/7XM94EoAkPL/4+STvec66u6SAr+ Iiridy3CKa8TpUd1umUxeoltGu8jN5PUsBNa/qev1f0GX6pTadeUxEQDVKdwlDGl7L6p WwSATc0gv6ymV8CLR4sfmEk5gI5Y6ddp4Tsx+h3mzwXROMS2CKqPbTnSwAxDVA5kMM/+ YhRQ== X-Gm-Message-State: ALoCoQk5d2vLhKEYDjggvxMeE3nvCrmlduK/6XDbC08nJL76pA2ag06Zn9OpJel21osOR2nyFytI X-Received: by 10.180.105.226 with SMTP id gp2mr36284024wib.1.1436433981359; Thu, 09 Jul 2015 02:26:21 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.4.1 with SMTP id g1ls979541lag.46.gmail; Thu, 09 Jul 2015 02:26:21 -0700 (PDT) X-Received: by 10.152.3.199 with SMTP id e7mr242229lae.98.1436433981192; Thu, 09 Jul 2015 02:26:21 -0700 (PDT) Received: from mail-la0-f53.google.com (mail-la0-f53.google.com. [209.85.215.53]) by mx.google.com with ESMTPS id ew10si4208515lac.11.2015.07.09.02.26.21 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Jul 2015 02:26:21 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) client-ip=209.85.215.53; Received: by laar3 with SMTP id r3so242792038laa.0 for ; Thu, 09 Jul 2015 02:26:21 -0700 (PDT) X-Received: by 10.152.42.177 with SMTP id p17mr13669751lal.29.1436433981031; Thu, 09 Jul 2015 02:26:21 -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 hn6csp530314lbb; Thu, 9 Jul 2015 02:26:20 -0700 (PDT) X-Received: by 10.140.233.70 with SMTP id e67mr23106605qhc.7.1436433979680; Thu, 09 Jul 2015 02:26:19 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id 10si5973937qhs.32.2015.07.09.02.26.19; Thu, 09 Jul 2015 02:26:19 -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 DBE1161FCE; Thu, 9 Jul 2015 09:26:18 +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 6752561FB3; Thu, 9 Jul 2015 09:25:50 +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 B13FA61B1F; Thu, 9 Jul 2015 09:25:46 +0000 (UTC) Received: from mail-lb0-f179.google.com (mail-lb0-f179.google.com [209.85.217.179]) by lists.linaro.org (Postfix) with ESMTPS id 8AC6A61843 for ; Thu, 9 Jul 2015 09:25:45 +0000 (UTC) Received: by lbnk3 with SMTP id k3so71454008lbn.1 for ; Thu, 09 Jul 2015 02:25:44 -0700 (PDT) X-Received: by 10.112.220.7 with SMTP id ps7mr13684083lbc.72.1436433944480; Thu, 09 Jul 2015 02:25:44 -0700 (PDT) Received: from erachmi-VirtualBox.ki.sw.ericsson.se (c-83-233-90-46.cust.bredband2.com. [83.233.90.46]) by smtp.gmail.com with ESMTPSA id j6sm1265981laj.13.2015.07.09.02.25.43 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 09 Jul 2015 02:25:43 -0700 (PDT) From: Christophe Milard To: anders.roxell@linaro.org, mike.holmes@linaro.org, stuart.haslam@linaro.org, maxim.uvarov@linaro.org Date: Thu, 9 Jul 2015 11:25:31 +0200 Message-Id: <1436433933-16911-2-git-send-email-christophe.milard@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1436433933-16911-1-git-send-email-christophe.milard@linaro.org> References: <1436433933-16911-1-git-send-email-christophe.milard@linaro.org> X-Topics: patch Cc: lng-odp@lists.linaro.org Subject: [lng-odp] [PATCH 1/3] validation: remove WEAK def of global_test_init 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.215.53 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 Removal of the weak definitions of global_test_init and global_test_term. This removes the last shared symbols between tests and therefore gives the possibility to create a test "superlib" containing all tests of all modules, if so wished. Also, it forces the definition of these functions into each lib using them. Test executable init and term function are called: _init[_*] and _term[_*] Where the possible suffix (_*) identifies the test executable, if needed. These functions are part of their module test library (lib.a) and they are registered using: odp_cunit_register_global_init(), and odp_cunit_register_global_term(); Signed-off-by: Christophe Milard --- test/validation/common/odp_cunit_common.c | 8 ++++---- test/validation/common/odp_cunit_common.h | 6 +----- test/validation/crypto/crypto.c | 6 ++++-- test/validation/synchronizers/synchronizers.c | 3 ++- 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/test/validation/common/odp_cunit_common.c b/test/validation/common/odp_cunit_common.c index 67938f2..56493ac 100644 --- a/test/validation/common/odp_cunit_common.c +++ b/test/validation/common/odp_cunit_common.c @@ -15,6 +15,8 @@ static odph_linux_pthread_t thread_tbl[MAX_WORKERS]; * global init/term functions which may be registered * defaults to functions performing odp init/term. */ +static int tests_global_init(void); +static int tests_global_term(void); static struct { int (*global_init_ptr)(void); int (*global_term_ptr)(void); @@ -42,7 +44,7 @@ int odp_cunit_thread_exit(pthrd_arg *arg) return 0; } -ODP_WEAK_SYMBOL int tests_global_init(void) +static int tests_global_init(void) { if (0 != odp_init_global(NULL, NULL)) { fprintf(stderr, "error: odp_init_global() failed.\n"); @@ -56,7 +58,7 @@ ODP_WEAK_SYMBOL int tests_global_init(void) return 0; } -ODP_WEAK_SYMBOL int tests_global_term(void) +static int tests_global_term(void) { if (0 != odp_term_local()) { fprintf(stderr, "error: odp_term_local() failed.\n"); @@ -76,8 +78,6 @@ ODP_WEAK_SYMBOL int tests_global_term(void) * If some of these functions are not registered, the defaults functions * (tests_global_init() and tests_global_term()) defined above are used. * One should use these register functions when defining these hooks. - * (overloading the weak symbol above is obsolete and will be removed in - * the future). * Note that passing NULL as function pointer is valid and will simply * prevent the default (odp init/term) to be done. */ diff --git a/test/validation/common/odp_cunit_common.h b/test/validation/common/odp_cunit_common.h index bfb4cbf..92a22a9 100644 --- a/test/validation/common/odp_cunit_common.h +++ b/test/validation/common/odp_cunit_common.h @@ -50,16 +50,12 @@ extern int odp_cunit_thread_exit(pthrd_arg *); * Initialize global resources needed by the test executable. Default * definition does ODP init / term (both global and local). * Test executables can override it by calling one of the register function - * below (or by defining a strong version, but this is deprecated). + * below. * The functions are called at the very beginning and very end of the test * execution. Passing NULL to odp_cunit_register_global_init() and/or * odp_cunit_register_global_term() is legal and will simply prevent the * default (ODP init/term) to be done. */ -extern int tests_global_init(void); - -extern int tests_global_term(void); - void odp_cunit_register_global_init(int (*func_init_ptr)(void)); void odp_cunit_register_global_term(int (*func_term_ptr)(void)); diff --git a/test/validation/crypto/crypto.c b/test/validation/crypto/crypto.c index 899fb51..5b06cdc 100644 --- a/test/validation/crypto/crypto.c +++ b/test/validation/crypto/crypto.c @@ -23,7 +23,7 @@ static CU_SuiteInfo crypto_suites[] = { CU_SUITE_INFO_NULL, }; -int tests_global_init(void) +static int crypto_init(void) { odp_pool_param_t params; odp_pool_t pool; @@ -60,7 +60,7 @@ int tests_global_init(void) return 0; } -int tests_global_term(void) +static int crypto_term(void) { odp_pool_t pool; odp_queue_t out_queue; @@ -96,5 +96,7 @@ int tests_global_term(void) int crypto_main(void) { + odp_cunit_register_global_init(crypto_init); + odp_cunit_register_global_term(crypto_term); return odp_cunit_run(crypto_suites); } diff --git a/test/validation/synchronizers/synchronizers.c b/test/validation/synchronizers/synchronizers.c index 61c6026..fb12a05 100644 --- a/test/validation/synchronizers/synchronizers.c +++ b/test/validation/synchronizers/synchronizers.c @@ -1052,7 +1052,7 @@ static int synchronizers_suite_init(void) return 0; } -int tests_global_init(void) +static int synchronizers_init(void) { uint32_t core_count, max_threads; int ret = 0; @@ -1210,5 +1210,6 @@ static CU_SuiteInfo synchronizers_suites[] = { int synchronizers_main(void) { + odp_cunit_register_global_init(synchronizers_init); return odp_cunit_run(synchronizers_suites); }