From patchwork Fri Jul 10 00:44:12 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Milard X-Patchwork-Id: 50991 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f200.google.com (mail-lb0-f200.google.com [209.85.217.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A7047228E5 for ; Fri, 10 Jul 2015 00:45:23 +0000 (UTC) Received: by lbbei7 with SMTP id ei7sf6374412lbb.3 for ; Thu, 09 Jul 2015 17:45:22 -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=FlUZIT6PbNON8koCvLSWs/N61fCI+Fwruqa/IGnrMPI=; b=a2z8imiWsjiBZNHi0BPXQ2NjVrhGY3gWIlUYVw9EFI5DMEN7W0N8AmI1p7A0gR12we H8hyuxmjihPdVIcoFkcTw5/DYdK4RiSVU73bZD6HrdaBkW1c88TI4iPCrb3XDi2Agudb Fz8bK0jX7UERwjVhWtoPJTCpYQJ0Kj0WPBdp0IHa20xU+xy78Mw2Pnmms70NCm/RDnIK D88b2lCnE89+H9lLy1Ez/oAXzJIFNUD7yjbT132BFxg+Y40bpe5YHK8/vjAeZtzpZr35 oESzJIqd7U9BEcUjkQzBDlnxPyiUnesmLSA/R3fmcuqDyfTr08x3uwF2EI6V/aIrmBLl qpBg== X-Gm-Message-State: ALoCoQn4VikHuddmKmcWGRMUHiim6RQUxVgdZG6Aw01M/xHKLVb2jg1Xj3ZG+u/KHtv5gJwdkJbK X-Received: by 10.180.35.162 with SMTP id i2mr332948wij.6.1436489122609; Thu, 09 Jul 2015 17:45:22 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.21.104 with SMTP id u8ls630939lae.31.gmail; Thu, 09 Jul 2015 17:45:22 -0700 (PDT) X-Received: by 10.152.20.106 with SMTP id m10mr17745478lae.7.1436489122440; Thu, 09 Jul 2015 17:45:22 -0700 (PDT) Received: from mail-la0-f52.google.com (mail-la0-f52.google.com. [209.85.215.52]) by mx.google.com with ESMTPS id z10si6088012lae.0.2015.07.09.17.45.22 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Jul 2015 17:45:22 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.52 as permitted sender) client-ip=209.85.215.52; Received: by lagx9 with SMTP id x9so256021163lag.1 for ; Thu, 09 Jul 2015 17:45:22 -0700 (PDT) X-Received: by 10.152.37.228 with SMTP id b4mr17151588lak.117.1436489122317; Thu, 09 Jul 2015 17:45:22 -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 hn6csp1010284lbb; Thu, 9 Jul 2015 17:45:21 -0700 (PDT) X-Received: by 10.55.20.166 with SMTP id 38mr29183168qku.12.1436489121001; Thu, 09 Jul 2015 17:45:21 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id r72si8121723qkr.99.2015.07.09.17.45.19; Thu, 09 Jul 2015 17:45:20 -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 8B51962091; Fri, 10 Jul 2015 00:45:19 +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 865DB6207F; Fri, 10 Jul 2015 00:44:49 +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 1083D6207B; Fri, 10 Jul 2015 00:44:43 +0000 (UTC) Received: from mail-lb0-f178.google.com (mail-lb0-f178.google.com [209.85.217.178]) by lists.linaro.org (Postfix) with ESMTPS id 601F46203A for ; Fri, 10 Jul 2015 00:44:40 +0000 (UTC) Received: by lblf12 with SMTP id f12so14524927lbl.2 for ; Thu, 09 Jul 2015 17:44:39 -0700 (PDT) X-Received: by 10.112.159.162 with SMTP id xd2mr16882076lbb.67.1436489079309; Thu, 09 Jul 2015 17:44:39 -0700 (PDT) Received: from localhost.localdomain (c-83-233-90-46.cust.bredband2.com. [83.233.90.46]) by smtp.gmail.com with ESMTPSA id o18sm1936473lbg.1.2015.07.09.17.44.37 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 09 Jul 2015 17:44:38 -0700 (PDT) From: Christophe Milard To: anders.roxell@linaro.org, mike.holmes@linaro.org, stuart.haslam@linaro.org, maxim.uvarov@linaro.org Date: Fri, 10 Jul 2015 02:44:12 +0200 Message-Id: <1436489068-8929-2-git-send-email-christophe.milard@linaro.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1436489068-8929-1-git-send-email-christophe.milard@linaro.org> References: <1436489068-8929-1-git-send-email-christophe.milard@linaro.org> X-Topics: patch Cc: lng-odp@lists.linaro.org Subject: [lng-odp] [PATCH 01/17] 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.215.52 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 8890c3d..9be2f44 100644 --- a/test/validation/synchronizers/synchronizers.h +++ b/test/validation/synchronizers/synchronizers.h @@ -4,4 +4,39 @@ * SPDX-License-Identifier: BSD-3-Clause */ +#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);