From patchwork Thu May 19 16:26:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Milard X-Patchwork-Id: 68131 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp3268570qge; Thu, 19 May 2016 08:29:54 -0700 (PDT) X-Received: by 10.140.22.203 with SMTP id 69mr14288219qgn.62.1463671794446; Thu, 19 May 2016 08:29:54 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id s68si13074741qkh.51.2016.05.19.08.29.54; Thu, 19 May 2016 08:29:54 -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 2416F617F1; Thu, 19 May 2016 15:29:54 +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 64589617F4; Thu, 19 May 2016 15:28:37 +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 B84EB617EF; Thu, 19 May 2016 15:28:32 +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 C18DC615DA for ; Thu, 19 May 2016 15:28:30 +0000 (UTC) Received: by mail-lb0-f178.google.com with SMTP id k7so5151030lbm.0 for ; Thu, 19 May 2016 08:28:30 -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=RWdnmKlR9waCNTjIZDqJ9RfXpjkh7qG8MCBzmEIzzvmZoqbtuPZON4NeqXK5ph+6f0 k+XtCUe/Iun9j+b/Gn8HnKhVBzMb3NNA7M56mFWZnqMAzyRkfwI3sOyaRNPPCTLMWRc9 bHQpOkAEuL2UFVsilQt4NqW+YeKE6c4w8VZpeL8rp6+KS2pchgIZdHwvX1ghiCOu7Yua nzQXyTJD9Vd/hdHSJwfOPeKgHYpYNSoMFutS9JTaJMZJcOXx5Uh0+BBD6rNDxb61QUya FaeaBVzgxXaPjWUz3L2AgdYaEM7UPX6/kYcPh16SQgZuvBAL1E8qQifjr82ykoF0rn1r uG1w== X-Gm-Message-State: AOPr4FV4QWd4FbHr0UOKZj6S2oSjAH8nAtqvANfEdBwVyIPNdT+QoCk+DxISD1Q0x+H7vo7fvYc= X-Received: by 10.112.50.107 with SMTP id b11mr5035613lbo.15.1463671709704; Thu, 19 May 2016 08:28:29 -0700 (PDT) Received: from erachmi-ericsson.ki.sw.ericsson.se (c-83-233-90-46.cust.bredband2.com. [83.233.90.46]) by smtp.gmail.com with ESMTPSA id cv11sm2366290lbb.49.2016.05.19.08.28.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 19 May 2016 08:28:29 -0700 (PDT) From: Christophe Milard To: brian.brooks@linaro.org, maxim.uvarov@linaro.com, lng-odp@lists.linaro.org Date: Thu, 19 May 2016 18:26:41 +0200 Message-Id: <1463675234-6739-3-git-send-email-christophe.milard@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1463675234-6739-1-git-send-email-christophe.milard@linaro.org> References: <1463675234-6739-1-git-send-email-christophe.milard@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCHv8 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() */