From patchwork Fri May 20 16:30:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Milard X-Patchwork-Id: 68258 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp3852075qge; Fri, 20 May 2016 08:43:19 -0700 (PDT) X-Received: by 10.55.82.6 with SMTP id g6mr4254354qkb.40.1463758999371; Fri, 20 May 2016 08:43:19 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id h140si18631742qhc.40.2016.05.20.08.43.18; Fri, 20 May 2016 08:43:19 -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 6FC0761790; Fri, 20 May 2016 15:43:18 +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 D042761830; Fri, 20 May 2016 15:33:16 +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 45B8A61847; Fri, 20 May 2016 15:33:14 +0000 (UTC) Received: from mail-lb0-f170.google.com (mail-lb0-f170.google.com [209.85.217.170]) by lists.linaro.org (Postfix) with ESMTPS id 419D4616F1 for ; Fri, 20 May 2016 15:32:09 +0000 (UTC) Received: by mail-lb0-f170.google.com with SMTP id ww9so36592763lbc.2 for ; Fri, 20 May 2016 08:32:09 -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=Mi8XrTGOtQ+mJ7qiPEqyRZ/ma03vm8z3zQN2+SRTNhY=; b=bZwi9iWRlU7VUJQDjR4nK2ddTzrQnP6jVkeDuquQjEYEgog99lyTEs03/0M+cccHck z5vl9b42oErGQn9oqf4cktoGdbD4PpQx6pwPM2Xn6FHkMK4tORWpwCJFnTI4kfPHxB4L PkVbBVfqNzaMUkglScGDhUyDP0rHef45NTPEL7fhF3HWaj8GQO2pFBRzCh/fPzSsjxzU 653D4/mSPtCA4BgLTmycYZKIFkTfc+v26VeQ/SpNbOME0WQV03QF1X5Wy5dwg7tlT9w8 9rCBrJKOxromS9TSaIcMDT9lh4Xb5AjcMfRE72G112EH+BHeAGNmgcW1YE+rwGJ9fij9 OuaQ== X-Gm-Message-State: AOPr4FVcOM5Dhlyyo2r7opxPC26W3ce2sAN6SDJ31MfrfnxB8ZsIqkNPhjTTzlmOZocky5PIa4c= X-Received: by 10.112.129.162 with SMTP id nx2mr1164998lbb.43.1463758328114; Fri, 20 May 2016 08:32:08 -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.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 20 May 2016 08:32:07 -0700 (PDT) From: Christophe Milard To: maxim.uvarov@linaro.com, lng-odp@lists.linaro.org Date: Fri, 20 May 2016 18:30:24 +0200 Message-Id: <1463761851-37121-9-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 08/35] validation: init: 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" As the tests themselves do not have specific args, they just call the cunit_common parsing function to pick up cunit_common and helpers arguments. Signed-off-by: Christophe Milard --- test/validation/init/init.c | 18 +++++++++++++++--- test/validation/init/init.h | 6 +++--- test/validation/init/init_main_abort.c | 4 ++-- test/validation/init/init_main_log.c | 4 ++-- test/validation/init/init_main_ok.c | 4 ++-- 5 files changed, 24 insertions(+), 12 deletions(-) diff --git a/test/validation/init/init.c b/test/validation/init/init.c index a802d41..61055fa 100644 --- a/test/validation/init/init.c +++ b/test/validation/init/init.c @@ -52,10 +52,14 @@ static void odp_init_abort(void) abort(); } -int init_main_abort(void) +int init_main_abort(int argc, char *argv[]) { int ret; + /* parse common options: */ + if (odp_cunit_parse_options(argc, argv)) + return -1; + /* prevent default ODP init: */ odp_cunit_register_global_init(NULL); odp_cunit_register_global_term(NULL); @@ -116,10 +120,14 @@ static int odp_init_log(odp_log_level_t level __attribute__((unused)), return r; } -int init_main_log(void) +int init_main_log(int argc, char *argv[]) { int ret; + /* parse common options: */ + if (odp_cunit_parse_options(argc, argv)) + return -1; + /* prevent default ODP init: */ odp_cunit_register_global_init(NULL); odp_cunit_register_global_term(NULL); @@ -157,10 +165,14 @@ odp_suiteinfo_t init_suites_ok[] = { ODP_SUITE_INFO_NULL, }; -int init_main_ok(void) +int init_main_ok(int argc, char *argv[]) { int ret; + /* parse common options: */ + if (odp_cunit_parse_options(argc, argv)) + return -1; + /* prevent default ODP init: */ odp_cunit_register_global_init(NULL); odp_cunit_register_global_term(NULL); diff --git a/test/validation/init/init.h b/test/validation/init/init.h index 272d426..cad9cf9 100644 --- a/test/validation/init/init.h +++ b/test/validation/init/init.h @@ -25,8 +25,8 @@ extern odp_suiteinfo_t init_suites_log[]; extern odp_suiteinfo_t init_suites_ok[]; /* main test program: */ -int init_main_abort(void); -int init_main_log(void); -int init_main_ok(void); +int init_main_abort(int argc, char *argv[]); +int init_main_log(int argc, char *argv[]); +int init_main_ok(int argc, char *argv[]); #endif diff --git a/test/validation/init/init_main_abort.c b/test/validation/init/init_main_abort.c index c7bdd9d..2e0faaf 100644 --- a/test/validation/init/init_main_abort.c +++ b/test/validation/init/init_main_abort.c @@ -5,7 +5,7 @@ */ #include "init.h" -int main(void) +int main(int argc, char *argv[]) { - return init_main_abort(); + return init_main_abort(argc, argv); } diff --git a/test/validation/init/init_main_log.c b/test/validation/init/init_main_log.c index f35ac38..41dd00d 100644 --- a/test/validation/init/init_main_log.c +++ b/test/validation/init/init_main_log.c @@ -5,7 +5,7 @@ */ #include "init.h" -int main(void) +int main(int argc, char *argv[]) { - return init_main_log(); + return init_main_log(argc, argv); } diff --git a/test/validation/init/init_main_ok.c b/test/validation/init/init_main_ok.c index 285c747..6053ec1 100644 --- a/test/validation/init/init_main_ok.c +++ b/test/validation/init/init_main_ok.c @@ -5,7 +5,7 @@ */ #include "init.h" -int main(void) +int main(int argc, char *argv[]) { - return init_main_ok(); + return init_main_ok(argc, argv); }