From patchwork Fri Jul 24 11:27:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Milard X-Patchwork-Id: 51417 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 patches.linaro.org (Postfix) with ESMTPS id 7018620323 for ; Fri, 24 Jul 2015 11:30:56 +0000 (UTC) Received: by wixh2 with SMTP id h2sf5888766wix.0 for ; Fri, 24 Jul 2015 04:30:55 -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=rYsFl3wdw0m26qARBL2gw1M5hz4JS0e1s9QT+e1GxxY=; b=X0RZ/Gtkwohv75prxm1JqkU3FpvoU0w5R4DElfNfovUVG5/cU8fecqg6a4UwiHEnD+ j3lIzrucLWPJQ/QAUNPUAZlhXbUTnrC/udFq8Lj6IsPUt+0Vq8uP5IiHd9gsehfFcEV9 JhJpKrMD6BuoFZSw5IRBjIGdzRVFA8BbNm+05tlCOuYd/eFyccprjyPASQzPIyF334eM lV+ley1kZPQF4MngGAolbG9GScdoRhyjXHQbc1mFclTCnUG9Bmj1BCwBYgZcnSgxI97n 76rWhbB5CRGhggOtONs7hj1IZFv39K0c9Ea6cQ+nWbafsfSntBIvihZQiQUGKJmEVCiV D5+A== X-Gm-Message-State: ALoCoQnhHICvOmHkxQAqVghOl7zxMsqxEKe14HYIqggRQr4qSjvKjI7lCxNlspfQok/l6vUNBYuG X-Received: by 10.181.13.202 with SMTP id fa10mr1492894wid.4.1437737455775; Fri, 24 Jul 2015 04:30:55 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.120.102 with SMTP id lb6ls418450lab.49.gmail; Fri, 24 Jul 2015 04:30:55 -0700 (PDT) X-Received: by 10.112.26.225 with SMTP id o1mr13060838lbg.5.1437737455605; Fri, 24 Jul 2015 04:30:55 -0700 (PDT) Received: from mail-lb0-f172.google.com (mail-lb0-f172.google.com. [209.85.217.172]) by mx.google.com with ESMTPS id b6si7266673laa.94.2015.07.24.04.30.55 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Jul 2015 04:30:55 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.172 as permitted sender) client-ip=209.85.217.172; Received: by lbbzr7 with SMTP id zr7so13279343lbb.1 for ; Fri, 24 Jul 2015 04:30:55 -0700 (PDT) X-Received: by 10.152.36.161 with SMTP id r1mr13133375laj.88.1437737455167; Fri, 24 Jul 2015 04:30:55 -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.7.198 with SMTP id l6csp1115099lba; Fri, 24 Jul 2015 04:30:54 -0700 (PDT) X-Received: by 10.140.237.77 with SMTP id i74mr20279768qhc.34.1437737453597; Fri, 24 Jul 2015 04:30:53 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id 40si9665056qkp.22.2015.07.24.04.30.53; Fri, 24 Jul 2015 04:30:53 -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 E8F3D61CE9; Fri, 24 Jul 2015 11:30:52 +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 4848061B1A; Fri, 24 Jul 2015 11:28:52 +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 2152D61B1D; Fri, 24 Jul 2015 11:28:48 +0000 (UTC) Received: from mail-lb0-f177.google.com (mail-lb0-f177.google.com [209.85.217.177]) by lists.linaro.org (Postfix) with ESMTPS id 60C0361B4F for ; Fri, 24 Jul 2015 11:28:01 +0000 (UTC) Received: by lbbqi7 with SMTP id qi7so13151007lbb.3 for ; Fri, 24 Jul 2015 04:28:00 -0700 (PDT) X-Received: by 10.152.42.144 with SMTP id o16mr13118004lal.46.1437737280291; Fri, 24 Jul 2015 04:28:00 -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 y1sm1582274lal.39.2015.07.24.04.27.58 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 24 Jul 2015 04:27:59 -0700 (PDT) From: Christophe Milard To: anders.roxell@linaro.org, mike.holmes@linaro.org, stuart.haslam@linaro.org Date: Fri, 24 Jul 2015 13:27:23 +0200 Message-Id: <1437737259-16953-5-git-send-email-christophe.milard@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1437737259-16953-1-git-send-email-christophe.milard@linaro.org> References: <1437737259-16953-1-git-send-email-christophe.milard@linaro.org> X-Topics: patch Cc: lng-odp@lists.linaro.org Subject: [lng-odp] [PATCHv2 04/20] validation: synchronizers: lib populated 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.172 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 test symbols are now exported in the module lib. Signed-off-by: Christophe Milard --- test/validation/synchronizers/synchronizers.c | 44 +++++++++++++-------------- test/validation/synchronizers/synchronizers.h | 35 +++++++++++++++++++++ 2 files changed, 57 insertions(+), 22 deletions(-) diff --git a/test/validation/synchronizers/synchronizers.c b/test/validation/synchronizers/synchronizers.c index fb12a05..d8a69a3 100644 --- a/test/validation/synchronizers/synchronizers.c +++ b/test/validation/synchronizers/synchronizers.c @@ -920,7 +920,7 @@ static void test_atomic_validate(void) } /* Barrier tests */ -static void synchronizers_test_no_barrier_functional(void) +void synchronizers_test_no_barrier_functional(void) { pthrd_arg arg; @@ -930,7 +930,7 @@ static void synchronizers_test_no_barrier_functional(void) odp_cunit_thread_exit(&arg); } -static void synchronizers_test_barrier_functional(void) +void synchronizers_test_barrier_functional(void) { pthrd_arg arg; @@ -940,14 +940,14 @@ static void synchronizers_test_barrier_functional(void) odp_cunit_thread_exit(&arg); } -static CU_TestInfo synchronizers_suite_barrier[] = { +CU_TestInfo synchronizers_suite_barrier[] = { {"no_barrier_functional", synchronizers_test_no_barrier_functional}, {"barrier_functional", synchronizers_test_barrier_functional}, CU_TEST_INFO_NULL }; /* Thread-unsafe tests */ -static void synchronizers_test_no_lock_functional(void) +void synchronizers_test_no_lock_functional(void) { pthrd_arg arg; @@ -956,13 +956,13 @@ static void synchronizers_test_no_lock_functional(void) odp_cunit_thread_exit(&arg); } -static CU_TestInfo synchronizers_suite_no_locking[] = { +CU_TestInfo synchronizers_suite_no_locking[] = { {"no_lock_functional", synchronizers_test_no_lock_functional}, CU_TEST_INFO_NULL }; /* Spin lock tests */ -static void synchronizers_test_spinlock_api(void) +void synchronizers_test_spinlock_api(void) { pthrd_arg arg; @@ -971,7 +971,7 @@ static void synchronizers_test_spinlock_api(void) odp_cunit_thread_exit(&arg); } -static void synchronizers_test_spinlock_functional(void) +void synchronizers_test_spinlock_functional(void) { pthrd_arg arg; @@ -981,14 +981,14 @@ static void synchronizers_test_spinlock_functional(void) odp_cunit_thread_exit(&arg); } -static CU_TestInfo synchronizers_suite_spinlock[] = { +CU_TestInfo synchronizers_suite_spinlock[] = { {"spinlock_api", synchronizers_test_spinlock_api}, {"spinlock_functional", synchronizers_test_spinlock_functional}, CU_TEST_INFO_NULL }; /* Ticket lock tests */ -static void synchronizers_test_ticketlock_api(void) +void synchronizers_test_ticketlock_api(void) { pthrd_arg arg; @@ -997,7 +997,7 @@ static void synchronizers_test_ticketlock_api(void) odp_cunit_thread_exit(&arg); } -static void synchronizers_test_ticketlock_functional(void) +void synchronizers_test_ticketlock_functional(void) { pthrd_arg arg; @@ -1008,14 +1008,14 @@ static void synchronizers_test_ticketlock_functional(void) odp_cunit_thread_exit(&arg); } -static CU_TestInfo synchronizers_suite_ticketlock[] = { +CU_TestInfo synchronizers_suite_ticketlock[] = { {"ticketlock_api", synchronizers_test_ticketlock_api}, {"ticketlock_functional", synchronizers_test_ticketlock_functional}, CU_TEST_INFO_NULL }; /* RW lock tests */ -static void synchronizers_test_rwlock_api(void) +void synchronizers_test_rwlock_api(void) { pthrd_arg arg; @@ -1024,7 +1024,7 @@ static void synchronizers_test_rwlock_api(void) odp_cunit_thread_exit(&arg); } -static void synchronizers_test_rwlock_functional(void) +void synchronizers_test_rwlock_functional(void) { pthrd_arg arg; @@ -1034,13 +1034,13 @@ static void synchronizers_test_rwlock_functional(void) odp_cunit_thread_exit(&arg); } -static CU_TestInfo synchronizers_suite_rwlock[] = { +CU_TestInfo synchronizers_suite_rwlock[] = { {"rwlock_api", synchronizers_test_rwlock_api}, {"rwlock_functional", synchronizers_test_rwlock_functional}, CU_TEST_INFO_NULL }; -static int synchronizers_suite_init(void) +int synchronizers_suite_init(void) { uint32_t num_threads, idx; @@ -1052,7 +1052,7 @@ static int synchronizers_suite_init(void) return 0; } -static int synchronizers_init(void) +int synchronizers_init(void) { uint32_t core_count, max_threads; int ret = 0; @@ -1164,27 +1164,27 @@ static void test_atomic_functional(void *func_ptr(void *)) test_atomic_validate(); } -static void synchronizers_test_atomic_inc_dec(void) +void synchronizers_test_atomic_inc_dec(void) { test_atomic_functional(test_atomic_inc_dec_thread); } -static void synchronizers_test_atomic_add_sub(void) +void synchronizers_test_atomic_add_sub(void) { test_atomic_functional(test_atomic_add_sub_thread); } -static void synchronizers_test_atomic_fetch_inc_dec(void) +void synchronizers_test_atomic_fetch_inc_dec(void) { test_atomic_functional(test_atomic_fetch_inc_dec_thread); } -static void synchronizers_test_atomic_fetch_add_sub(void) +void synchronizers_test_atomic_fetch_add_sub(void) { test_atomic_functional(test_atomic_fetch_add_sub_thread); } -static CU_TestInfo synchronizers_suite_atomic[] = { +CU_TestInfo synchronizers_suite_atomic[] = { {"atomic_inc_dec", synchronizers_test_atomic_inc_dec}, {"atomic_add_sub", synchronizers_test_atomic_add_sub}, {"atomic_fetch_inc_dec", synchronizers_test_atomic_fetch_inc_dec}, @@ -1192,7 +1192,7 @@ static CU_TestInfo synchronizers_suite_atomic[] = { CU_TEST_INFO_NULL, }; -static CU_SuiteInfo synchronizers_suites[] = { +CU_SuiteInfo synchronizers_suites[] = { {"barrier", NULL, NULL, NULL, NULL, synchronizers_suite_barrier}, {"nolocking", synchronizers_suite_init, diff --git a/test/validation/synchronizers/synchronizers.h b/test/validation/synchronizers/synchronizers.h index 8a93187..894e969 100644 --- a/test/validation/synchronizers/synchronizers.h +++ b/test/validation/synchronizers/synchronizers.h @@ -7,6 +7,41 @@ #ifndef _ODP_TEST_SYNCHRONIZERS_H_ #define _ODP_TEST_SYNCHRONIZERS_H_ +#include + +/* test functions: */ +void synchronizers_test_no_barrier_functional(void); +void synchronizers_test_barrier_functional(void); +void synchronizers_test_no_lock_functional(void); +void synchronizers_test_spinlock_api(void); +void synchronizers_test_spinlock_functional(void); +void synchronizers_test_ticketlock_api(void); +void synchronizers_test_ticketlock_functional(void); +void synchronizers_test_rwlock_api(void); +void synchronizers_test_rwlock_functional(void); +void synchronizers_test_atomic_inc_dec(void); +void synchronizers_test_atomic_add_sub(void); +void synchronizers_test_atomic_fetch_inc_dec(void); +void synchronizers_test_atomic_fetch_add_sub(void); + +/* test arrays: */ +extern CU_TestInfo synchronizers_suite_barrier[]; +extern CU_TestInfo synchronizers_suite_no_locking[]; +extern CU_TestInfo synchronizers_suite_spinlock[]; +extern CU_TestInfo synchronizers_suite_ticketlock[]; +extern CU_TestInfo synchronizers_suite_rwlock[]; +extern CU_TestInfo synchronizers_suite_atomic[]; + +/* test array init/term functions: */ +int synchronizers_suite_init(void); + +/* test registery: */ +extern CU_SuiteInfo synchronizers_suites[]; + +/* executable init/term functions: */ +int synchronizers_init(void); + +/* main test program: */ int synchronizers_main(void); #endif