From patchwork Tue Jul 21 13:32:18 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stuart Haslam X-Patchwork-Id: 51316 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 patches.linaro.org (Postfix) with ESMTPS id D9EF120323 for ; Tue, 21 Jul 2015 13:39:21 +0000 (UTC) Received: by wixh2 with SMTP id h2sf16810561wix.0 for ; Tue, 21 Jul 2015 06:39: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: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=7YhcjURr7ZkvEwQUmBTNy6ZcuuYmjTTtr/mLf7L1PTo=; b=V7/CoXpxLEFQf4JrWbpkcbRqK1nI+tdV2kEU8Z2pnNQ1AHyz+YcbLLGH8ebQTIdYlz M+8mL5Kl0RLvZ3K4KuuH8Daz0i5fB4znR97Gi5hxFy8aWElkaifeBZ6sWVdF3b9qTKTw N5FMnPlNazaknsnl96/EpymEbDe/IARl3W6KY1bQek2V1x46Wkb7mA/rIMBt1H0VdvZq 6gMlHJz7KzVQhPmS9Vp+7spljLoF6BFC6At/bx8pWfMG9MoieZbT4zG079rzBDUKo8q6 /A4sN/7H0XYZXRnovWChD6gxNMOv1wzJQ3wjoRnRaa6XScdm76+yuqEMe8TJkgVVL4PJ YfPw== X-Gm-Message-State: ALoCoQkoiLd/ca1qyuhjg5FfGHSyZfdwKqkcwR+pXXzgMnNRPTMU5MpTA4jEzu2JaPU7Gr1YJ9RD X-Received: by 10.112.28.111 with SMTP id a15mr17876130lbh.21.1437485961188; Tue, 21 Jul 2015 06:39:21 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.205.6 with SMTP id lc6ls922951lac.80.gmail; Tue, 21 Jul 2015 06:39:20 -0700 (PDT) X-Received: by 10.112.55.207 with SMTP id u15mr32796217lbp.88.1437485960773; Tue, 21 Jul 2015 06:39:20 -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 y1si20798483lal.86.2015.07.21.06.39.20 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 Jul 2015 06:39:20 -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 zr7so116114930lbb.1 for ; Tue, 21 Jul 2015 06:39:20 -0700 (PDT) X-Received: by 10.112.131.98 with SMTP id ol2mr33721417lbb.56.1437485960256; Tue, 21 Jul 2015 06:39:20 -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 l6csp1457164lba; Tue, 21 Jul 2015 06:39:19 -0700 (PDT) X-Received: by 10.55.56.213 with SMTP id f204mr53269208qka.78.1437485958776; Tue, 21 Jul 2015 06:39:18 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id k199si28214750qhc.57.2015.07.21.06.39.18; Tue, 21 Jul 2015 06:39:18 -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 F24C461EDA; Tue, 21 Jul 2015 13:39:17 +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 622AB61EED; Tue, 21 Jul 2015 13:33:28 +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 6D82561E90; Tue, 21 Jul 2015 13:32:57 +0000 (UTC) Received: from mail-wi0-f179.google.com (mail-wi0-f179.google.com [209.85.212.179]) by lists.linaro.org (Postfix) with ESMTPS id D747561E97 for ; Tue, 21 Jul 2015 13:32:52 +0000 (UTC) Received: by wibud3 with SMTP id ud3so127751749wib.0 for ; Tue, 21 Jul 2015 06:32:52 -0700 (PDT) X-Received: by 10.180.82.134 with SMTP id i6mr31188204wiy.15.1437485572032; Tue, 21 Jul 2015 06:32:52 -0700 (PDT) Received: from e106441.cambridge.arm.com ([2001:41d0:a:3cb4::abcd]) by smtp.gmail.com with ESMTPSA id jy6sm37121913wjc.4.2015.07.21.06.32.51 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 21 Jul 2015 06:32:51 -0700 (PDT) From: Stuart Haslam To: lng-odp@lists.linaro.org Date: Tue, 21 Jul 2015 14:32:18 +0100 Message-Id: <1437485540-4862-8-git-send-email-stuart.haslam@linaro.org> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1437485540-4862-1-git-send-email-stuart.haslam@linaro.org> References: <1437485540-4862-1-git-send-email-stuart.haslam@linaro.org> X-Topics: patch Subject: [lng-odp] [API-NEXT PATCHv3 7/9] validation: thrmask: introduce thrmask tests 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: stuart.haslam@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 Signed-off-by: Stuart Haslam --- test/validation/Makefile.inc | 1 + test/validation/common/.gitignore | 1 + test/validation/common/Makefile.am | 5 ++++- test/validation/common/mask_common.h | 12 ++++++++++++ test/validation/thread/Makefile.am | 3 ++- test/validation/thread/thread.c | 15 +++++++++++++++ 6 files changed, 35 insertions(+), 2 deletions(-) diff --git a/test/validation/Makefile.inc b/test/validation/Makefile.inc index 55a10e2..8df4bc7 100644 --- a/test/validation/Makefile.inc +++ b/test/validation/Makefile.inc @@ -7,4 +7,5 @@ AM_LDFLAGS += -static LIBCUNIT_COMMON = $(COMMON_DIR)/libcunit_common.a LIBCPUMASK_COMMON = $(COMMON_DIR)/libcpumask_common.a +LIBTHRMASK_COMMON = $(COMMON_DIR)/libthrmask_common.a LIBODP = $(LIB)/libodphelper.la $(LIB)/libodp.la diff --git a/test/validation/common/.gitignore b/test/validation/common/.gitignore index 6600799..34cffe2 100644 --- a/test/validation/common/.gitignore +++ b/test/validation/common/.gitignore @@ -1,2 +1,3 @@ libcunit_common.a libcpumask_common.a +libthrmask_common.a diff --git a/test/validation/common/Makefile.am b/test/validation/common/Makefile.am index 89a6e4f..0e2777d 100644 --- a/test/validation/common/Makefile.am +++ b/test/validation/common/Makefile.am @@ -1,8 +1,11 @@ AUTOMAKE_OPTIONS = foreign include $(top_srcdir)/test/Makefile.inc -noinst_LIBRARIES = libcunit_common.a libcpumask_common.a +noinst_LIBRARIES = libcunit_common.a libcpumask_common.a libthrmask_common.a libcunit_common_a_SOURCES = odp_cunit_common.c libcpumask_common_a_SOURCES = mask_common.c + +libthrmask_common_a_SOURCES = mask_common.c +libthrmask_common_a_CFLAGS = $(AM_CFLAGS) -DTEST_THRMASK diff --git a/test/validation/common/mask_common.h b/test/validation/common/mask_common.h index 7c3637e..70e1b32 100644 --- a/test/validation/common/mask_common.h +++ b/test/validation/common/mask_common.h @@ -7,9 +7,21 @@ #ifndef ODP_MASK_COMMON_H_ #define ODP_MASK_COMMON_H_ +/* + * The same set of tests are used for testing both the odp_thrmask_ and + * odp_cpumask_ APIs. + * + * To build the thrmask tests TEST_THRMASK must be defined. + */ +#ifdef TEST_THRMASK +typedef odp_thrmask_t _odp_mask_t; +#define MASK_API_PREFIX(n) odp_thrmask_##n +#define MASK_TESTFUNC(n) void thread_test_odp_thrmask_ ## n(void) +#else typedef odp_cpumask_t _odp_mask_t; #define MASK_API_PREFIX(n) odp_cpumask_##n #define MASK_TESTFUNC(n) void cpumask_test_odp_cpumask_ ## n(void) +#endif #define _odp_mask_from_str MASK_API_PREFIX(from_str) #define _odp_mask_to_str MASK_API_PREFIX(to_str) diff --git a/test/validation/thread/Makefile.am b/test/validation/thread/Makefile.am index 218a810..e52c8cf 100644 --- a/test/validation/thread/Makefile.am +++ b/test/validation/thread/Makefile.am @@ -2,7 +2,8 @@ include ../Makefile.inc noinst_LIBRARIES = libthread.a libthread_a_SOURCES = thread.c +libthread_a_CFLAGS = $(AM_CFLAGS) -DTEST_THRMASK bin_PROGRAMS = thread_main$(EXEEXT) dist_thread_main_SOURCES = thread_main.c -thread_main_LDADD = libthread.a $(LIBCUNIT_COMMON) $(LIBODP) +thread_main_LDADD = libthread.a $(LIBTHRMASK_COMMON) $(LIBCUNIT_COMMON) $(LIBODP) diff --git a/test/validation/thread/thread.c b/test/validation/thread/thread.c index d0bd75e..d8ea8b0 100644 --- a/test/validation/thread/thread.c +++ b/test/validation/thread/thread.c @@ -6,6 +6,7 @@ #include #include +#include #include "thread.h" /* Helper macro for CU_TestInfo initialization */ @@ -33,6 +34,20 @@ static CU_TestInfo thread_suite[] = { _CU_TEST_INFO(thread_test_odp_cpu_id), _CU_TEST_INFO(thread_test_odp_thread_id), _CU_TEST_INFO(thread_test_odp_thread_count), + _CU_TEST_INFO(thread_test_odp_thrmask_to_from_str), + _CU_TEST_INFO(thread_test_odp_thrmask_equal), + _CU_TEST_INFO(thread_test_odp_thrmask_zero), + _CU_TEST_INFO(thread_test_odp_thrmask_set), + _CU_TEST_INFO(thread_test_odp_thrmask_clr), + _CU_TEST_INFO(thread_test_odp_thrmask_isset), + _CU_TEST_INFO(thread_test_odp_thrmask_count), + _CU_TEST_INFO(thread_test_odp_thrmask_and), + _CU_TEST_INFO(thread_test_odp_thrmask_or), + _CU_TEST_INFO(thread_test_odp_thrmask_xor), + _CU_TEST_INFO(thread_test_odp_thrmask_copy), + _CU_TEST_INFO(thread_test_odp_thrmask_first), + _CU_TEST_INFO(thread_test_odp_thrmask_last), + _CU_TEST_INFO(thread_test_odp_thrmask_next), CU_TEST_INFO_NULL, };