From patchwork Mon Jul 27 17:38:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Milard X-Patchwork-Id: 51551 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f197.google.com (mail-wi0-f197.google.com [209.85.212.197]) by patches.linaro.org (Postfix) with ESMTPS id 6B44622918 for ; Mon, 27 Jul 2015 17:42:24 +0000 (UTC) Received: by wixh2 with SMTP id h2sf30736954wix.0 for ; Mon, 27 Jul 2015 10:42:23 -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=gj5GOvedbu1ZORPxGqoxZZyXR9V2UTi4xzBhU/RhfQ8=; b=jPMC2I6l2XlEtWz6rdNZbfhJneXvIFyArJJ+hcLDQot41Lx3gH/p8vocpOJk2axX82 2FAL1JZw2KwJZ2in+eKMdG52bMgP/b15bgCqYuc0FlY7ZXWjhrfNSmeepYvXYQVJusmx wgosKMHSjnl1Fwr6z0psgoU99SHSbYRW5oBEOlRzJo1JU0D5fOlpHheD22A3HPD/KV0J yRzPboloix3wiVibifIFeWPzYMKmVkTQYojdK0SnSrDYbRvM4BUJWIqg9RGgDr1TaAeh 2/A2u/IFYs2YyRdpvIwBh4UDQL69wQVUE/MXpYsHvMsWC5bLS/D9eTjcp9YdQISpkAMX lsfQ== X-Gm-Message-State: ALoCoQnrAnntktvBcoHrDZlMK1wE3xYXQLHUwhVgklKOuWu2h9VHO8BD6X5vl8sZwXgiYp6bj55a X-Received: by 10.180.205.198 with SMTP id li6mr5694925wic.5.1438018943779; Mon, 27 Jul 2015 10:42:23 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.204.103 with SMTP id kx7ls695509lac.62.gmail; Mon, 27 Jul 2015 10:42:23 -0700 (PDT) X-Received: by 10.112.10.166 with SMTP id j6mr25115892lbb.120.1438018943613; Mon, 27 Jul 2015 10:42:23 -0700 (PDT) Received: from mail-lb0-f180.google.com (mail-lb0-f180.google.com. [209.85.217.180]) by mx.google.com with ESMTPS id k9si9140205lae.87.2015.07.27.10.42.23 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Jul 2015 10:42:23 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.180 as permitted sender) client-ip=209.85.217.180; Received: by lbbzr7 with SMTP id zr7so58517276lbb.1 for ; Mon, 27 Jul 2015 10:42:23 -0700 (PDT) X-Received: by 10.112.220.7 with SMTP id ps7mr27827208lbc.72.1438018943474; Mon, 27 Jul 2015 10:42:23 -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 l6csp1660324lba; Mon, 27 Jul 2015 10:42:22 -0700 (PDT) X-Received: by 10.140.19.203 with SMTP id 69mr42444757qgh.33.1438018941882; Mon, 27 Jul 2015 10:42:21 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id n200si21724421qhb.93.2015.07.27.10.42.21; Mon, 27 Jul 2015 10:42:21 -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 0699961DEB; Mon, 27 Jul 2015 17:42:21 +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 DE44A61DD6; Mon, 27 Jul 2015 17:39: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 3991461DB5; Mon, 27 Jul 2015 17:39:43 +0000 (UTC) Received: from mail-la0-f49.google.com (mail-la0-f49.google.com [209.85.215.49]) by lists.linaro.org (Postfix) with ESMTPS id 25E6C61B1D for ; Mon, 27 Jul 2015 17:39:11 +0000 (UTC) Received: by lahh5 with SMTP id h5so53564737lah.2 for ; Mon, 27 Jul 2015 10:39:10 -0700 (PDT) X-Received: by 10.152.23.234 with SMTP id p10mr28256561laf.52.1438018750089; Mon, 27 Jul 2015 10:39:10 -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 4sm4027442lai.36.2015.07.27.10.39.07 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 27 Jul 2015 10:39:08 -0700 (PDT) From: Christophe Milard To: anders.roxell@linaro.org, mike.holmes@linaro.org, stuart.haslam@linaro.org Date: Mon, 27 Jul 2015 19:38:36 +0200 Message-Id: <1438018732-2778-5-git-send-email-christophe.milard@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1438018732-2778-1-git-send-email-christophe.milard@linaro.org> References: <1438018732-2778-1-git-send-email-christophe.milard@linaro.org> X-Topics: patch Cc: lng-odp@lists.linaro.org Subject: [lng-odp] [PATCHv3 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.180 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 ed56c8f..6b354b6 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..45b90e9 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 registry: */ +extern CU_SuiteInfo synchronizers_suites[]; + +/* executable init/term functions: */ +int synchronizers_init(void); + +/* main test program: */ int synchronizers_main(void); #endif