From patchwork Wed Jul 22 15:46:27 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stuart Haslam X-Patchwork-Id: 51359 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by patches.linaro.org (Postfix) with ESMTPS id 273AC20323 for ; Wed, 22 Jul 2015 16:00:03 +0000 (UTC) Received: by lagw2 with SMTP id w2sf60029247lag.3 for ; Wed, 22 Jul 2015 09:00:01 -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=zHRUZR5XILrvnbkWsMlMPOnFEYcY5aQCnbFKrzxOFLs=; b=ZtV0BH5aZT/fPCx51HXOSBUfOaT0MiiU/LwZb9o50ic7HBKYEKNUA3UgIaxugZk/V1 uvTLuDiGvUQ1moHOeymufKKtlZX0tuH2sipODqO4MiIELG2SHi07B6nTXNFg5Tq30IWB DNvA8/8zMmoceJ32TAeW8RzZxbAhOyi+otveHP/flh/c71DJf/nu6ujvnjFfd33/vMRP 01nMPyt1nqF5Kf77+ucP8IuppIWH/0wM2vdZqL5Ni9NHBhtVPnuSx+7QnUbywFecKcBf ttd/67QeR8HzS2WRT3w/g7ZC0ud383uVGzHUOFLWK48u7Ay+2NEVt/XnEVcPE0DqEKNQ nQ9w== X-Gm-Message-State: ALoCoQmTjWOO73EzPTwPy3rs4qZnplY2+hxQiW2WyKKGtTHdH3FeuLVxE/bwPqZX+rAZTzShI1Y/ X-Received: by 10.194.5.229 with SMTP id v5mr1516708wjv.0.1437580801856; Wed, 22 Jul 2015 09:00:01 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.203.197 with SMTP id ks5ls106227lac.64.gmail; Wed, 22 Jul 2015 09:00:01 -0700 (PDT) X-Received: by 10.112.46.130 with SMTP id v2mr3010769lbm.119.1437580801680; Wed, 22 Jul 2015 09:00:01 -0700 (PDT) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com. [209.85.215.54]) by mx.google.com with ESMTPS id ln10si1558751lac.42.2015.07.22.09.00.01 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Jul 2015 09:00:01 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.54 as permitted sender) client-ip=209.85.215.54; Received: by lahh5 with SMTP id h5so140866892lah.2 for ; Wed, 22 Jul 2015 09:00:01 -0700 (PDT) X-Received: by 10.152.26.163 with SMTP id m3mr3078583lag.86.1437580801567; Wed, 22 Jul 2015 09:00:01 -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 l6csp23213lba; Wed, 22 Jul 2015 09:00:00 -0700 (PDT) X-Received: by 10.140.195.71 with SMTP id q68mr5006006qha.5.1437580799868; Wed, 22 Jul 2015 08:59:59 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id h82si2134485qhc.103.2015.07.22.08.59.29; Wed, 22 Jul 2015 08:59:59 -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 931B061D15; Wed, 22 Jul 2015 15:59:29 +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=-1.9 required=5.0 tests=BAYES_00,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 BDAB761D14; Wed, 22 Jul 2015 15:50:25 +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 6F30861B68; Wed, 22 Jul 2015 15:47:22 +0000 (UTC) Received: from mail-wi0-f177.google.com (mail-wi0-f177.google.com [209.85.212.177]) by lists.linaro.org (Postfix) with ESMTPS id 2772761B74 for ; Wed, 22 Jul 2015 15:47:11 +0000 (UTC) Received: by wibxm9 with SMTP id xm9so109006258wib.1 for ; Wed, 22 Jul 2015 08:47:10 -0700 (PDT) X-Received: by 10.194.86.161 with SMTP id q1mr6651269wjz.18.1437580030257; Wed, 22 Jul 2015 08:47:10 -0700 (PDT) Received: from e106441.cambridge.arm.com ([2001:41d0:a:3cb4::abcd]) by smtp.gmail.com with ESMTPSA id ju2sm3994834wid.12.2015.07.22.08.47.08 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 22 Jul 2015 08:47:09 -0700 (PDT) From: Stuart Haslam To: lng-odp@lists.linaro.org Date: Wed, 22 Jul 2015 16:46:27 +0100 Message-Id: <1437579989-1241-9-git-send-email-stuart.haslam@linaro.org> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1437579989-1241-1-git-send-email-stuart.haslam@linaro.org> References: <1437579989-1241-1-git-send-email-stuart.haslam@linaro.org> X-Topics: patch Subject: [lng-odp] [API-NEXT PATCHv4 08/10] 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.215.54 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 Reviewed-by: Christophe Milard --- 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 | 2 ++ test/validation/thread/thread.c | 15 +++++++++++++++ 6 files changed, 35 insertions(+), 1 deletion(-) diff --git a/test/validation/Makefile.inc b/test/validation/Makefile.inc index fb07d0a..439a304 100644 --- a/test/validation/Makefile.inc +++ b/test/validation/Makefile.inc @@ -7,4 +7,5 @@ AM_LDFLAGS += -static LIBCUNIT_COMMON = $(COMMON_DIR)/libcunit_common.la LIBCPUMASK_COMMON = $(COMMON_DIR)/libcpumask_common.la +LIBTHRMASK_COMMON = $(COMMON_DIR)/libthrmask_common.la 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 12fdb08..2cb0956 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_LTLIBRARIES = libcunit_common.la libcpumask_common.la +noinst_LTLIBRARIES = libcunit_common.la libcpumask_common.la libthrmask_common.la libcunit_common_la_SOURCES = odp_cunit_common.c libcpumask_common_la_SOURCES = mask_common.c + +libthrmask_common_la_SOURCES = mask_common.c +libthrmask_common_la_CFLAGS = $(AM_CFLAGS) -DTEST_THRMASK diff --git a/test/validation/common/mask_common.h b/test/validation/common/mask_common.h index eb7a8ca..e7a38a7 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 3e2b68e..c18bc50 100644 --- a/test/validation/thread/Makefile.am +++ b/test/validation/thread/Makefile.am @@ -2,6 +2,8 @@ include ../Makefile.inc noinst_LTLIBRARIES = libthread.la libthread_la_SOURCES = thread.c +libthread_la_CFLAGS = $(AM_CFLAGS) -DTEST_THRMASK +libthread_la_LIBADD = $(LIBTHRMASK_COMMON) bin_PROGRAMS = thread_main$(EXEEXT) dist_thread_main_SOURCES = thread_main.c 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, };