From patchwork Fri May 20 16:30:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Milard X-Patchwork-Id: 68252 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp3846471qge; Fri, 20 May 2016 08:34:33 -0700 (PDT) X-Received: by 10.141.5.213 with SMTP id h204mr572010qhd.97.1463758472963; Fri, 20 May 2016 08:34:32 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id e140si18566781qhc.86.2016.05.20.08.34.32; Fri, 20 May 2016 08:34:32 -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 9CC4B61865; Fri, 20 May 2016 15:34:32 +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_H2, 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 D26A3617E7; Fri, 20 May 2016 15:32:15 +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 94408616ED; Fri, 20 May 2016 15:32:03 +0000 (UTC) Received: from mail-lb0-f176.google.com (mail-lb0-f176.google.com [209.85.217.176]) by lists.linaro.org (Postfix) with ESMTPS id 4BFF3616ED for ; Fri, 20 May 2016 15:32:02 +0000 (UTC) Received: by mail-lb0-f176.google.com with SMTP id ww9so36591744lbc.2 for ; Fri, 20 May 2016 08:32:02 -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=hvuD//Ie/WbItkm2OhSLrYHQuhvIYlnWoLk1b2bSXmF6V1wn2F2EmOXNaRFHnOzJFc jNhDba7dIg/QQfLxvwXYmoVckWfBc8mtbZAGfN/W6zbCu66rJyW3d4tBFR1Xtylwy/U+ E4fsubVmXb9wWfCeMW0/2QDZSKCedSFbTP+MAHzM6LXniyI5PyeAM8kctJ0nEzW/1R8R tQ2VQPk4UK9oYzC+YhM4hVHW4iMdUmzwpeAypiM8sQIMcOuUPn9bVwiIC1YNLIqlF3hc wNEjE6Y3uIi5CTPh6KJjQ+cN4ShsYerleGJwdTpx11PYhajzh/ua6YoylN+YqDQBAkUU 6vWw== X-Gm-Message-State: AOPr4FXknxPX6aBbzZAl0zTAHMzP+6yQbDaggFjubjM4ajDpndtc4ZLq2fRQgmIo4c4wz+6ygCI= X-Received: by 10.112.170.38 with SMTP id aj6mr1362095lbc.29.1463758321124; Fri, 20 May 2016 08:32:01 -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 tg1sm3348847lbb.7.2016.05.20.08.32.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 20 May 2016 08:32:00 -0700 (PDT) From: Christophe Milard To: maxim.uvarov@linaro.com, lng-odp@lists.linaro.org Date: Fri, 20 May 2016 18:30:18 +0200 Message-Id: <1463761851-37121-3-git-send-email-christophe.milard@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1463761851-37121-1-git-send-email-christophe.milard@linaro.org> References: <1463761851-37121-1-git-send-email-christophe.milard@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCHv9 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() */