From patchwork Tue May 17 13:04:09 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Milard X-Patchwork-Id: 67949 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp2068696qge; Tue, 17 May 2016 06:16:09 -0700 (PDT) X-Received: by 10.140.109.132 with SMTP id l4mr1315952qgf.9.1463490969003; Tue, 17 May 2016 06:16:09 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id j31si2189640qge.40.2016.05.17.06.16.08; Tue, 17 May 2016 06:16:08 -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; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id AC6D661832; Tue, 17 May 2016 13:16:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 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 [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id C4FA3617E0; Tue, 17 May 2016 13:13:53 +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 9C4616177E; Tue, 17 May 2016 13:13:44 +0000 (UTC) Received: from mail-lf0-f49.google.com (mail-lf0-f49.google.com [209.85.215.49]) by lists.linaro.org (Postfix) with ESMTPS id 5E76361780 for ; Tue, 17 May 2016 13:05:12 +0000 (UTC) Received: by mail-lf0-f49.google.com with SMTP id y84so6542936lfc.0 for ; Tue, 17 May 2016 06:05:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=7pkbU41mpmSWCi1VOk53KPA4JB5sd3eNAMZx0OIWkxI=; b=YGN4RVAqUx/ejdUjO2xqJaP/UYEDfrkS8nwbn81mgeI7BcEKzbQd7JiCbNOjhhoVIX 9zWSEjSWWEnMC7n6EIiBd5XRr1ZK22FsKk07AWCImpcv+e1XCzmydCdEevLnIBOwAdxj N0AU7ayqcNzKUP3OMguQKfYYqUmadfgzY/WSL2/Tk4NvA2vusWKtt/gUcWDYMZWbsqoQ YBUI/NFdOKiFONiJhEeNVz5VKc7keG/gtwSV1VfmIcNNz0+DiBfwiNwsi+FwZw+6spig NCo/yxGBsDfIlqUeaLZDa4+5zE8ptlw5eLal5ep/PILIYjQ4vu8SHEIs6ktSCpuKk01p xR/A== X-Gm-Message-State: AOPr4FWKr8OqYuLPQXNKDs5/kWPh4onlY4r4H+1JFQhWXqPbpwX03oRpUB7zzaLsETEEQi8qbiE= X-Received: by 10.25.29.18 with SMTP id d18mr469243lfd.26.1463490311262; Tue, 17 May 2016 06:05:11 -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 q1sm506536lbo.4.2016.05.17.06.05.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 May 2016 06:05:10 -0700 (PDT) From: Christophe Milard To: lng-odp@lists.linaro.org, brian.brooks@linaro.org, mike.holmes@linaro.org Date: Tue, 17 May 2016 15:04:09 +0200 Message-Id: <1463490282-23277-3-git-send-email-christophe.milard@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1463490282-23277-1-git-send-email-christophe.milard@linaro.org> References: <1463490282-23277-1-git-send-email-christophe.milard@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCHv7 02/35] validation: common: adding command line argument parsing X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" 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" A function to parse the command line args is added. This function is meant to parse only arguments altering the behaviour of cunit_common (this includes the helpers args as cunit_common uses the helpers) As at this stage only helper args fall into that category, this function simply calls the helper parsing function. (parsing pure cunit_commons args might be added later here if needed) Signed-off-by: Christophe Milard --- test/validation/common/odp_cunit_common.c | 10 ++++++++++ test/validation/common/odp_cunit_common.h | 2 ++ 2 files changed, 12 insertions(+) diff --git a/test/validation/common/odp_cunit_common.c b/test/validation/common/odp_cunit_common.c index 2712abe..2a5864f 100644 --- a/test/validation/common/odp_cunit_common.c +++ b/test/validation/common/odp_cunit_common.c @@ -342,3 +342,13 @@ int odp_cunit_register(odp_suiteinfo_t testsuites[]) return 0; } + +/* + * Parse command line options to extract options affectiong cunit_common. + * (hence also helpers options as cunit_common uses the helpers) + * Options private to the test calling cunit_common are not parsed here. + */ +int odp_cunit_parse_options(int argc, char *argv[]) +{ + return odph_parse_options(argc, argv, NULL, NULL); +} diff --git a/test/validation/common/odp_cunit_common.h b/test/validation/common/odp_cunit_common.h index 22c2a19..3812b0f 100644 --- a/test/validation/common/odp_cunit_common.h +++ b/test/validation/common/odp_cunit_common.h @@ -73,6 +73,8 @@ typedef struct { int numthrds; /**< no of pthreads to create */ } pthrd_arg; +/* parse parameters that affect the behaviour of odp_cunit_common */ +int odp_cunit_parse_options(int argc, char *argv[]); /* register suites to be run via odp_cunit_run() */ int odp_cunit_register(odp_suiteinfo_t testsuites[]); /* update tests previously registered via odp_cunit_register() */