diff mbox

[i-g-t,5/8] lib: don't ignore unknown options in multi-tests

Message ID 1406113075-30860-6-git-send-email-thomas.wood@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Thomas Wood July 23, 2014, 10:57 a.m. UTC
None of the current tests have additional options that might make use of
any unknown options and igt_subtest_init_parse_opts is available that
integrates additional option parsing.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
---
 lib/igt_core.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

Comments

tim.gore@intel.com July 24, 2014, 9:55 a.m. UTC | #1
Looks sensible.

> -----Original Message-----
> From: Thomas Wood [mailto:thomas.wood@intel.com]
> Sent: Wednesday, July 23, 2014 11:58 AM
> To: intel-gfx@lists.freedesktop.org
> Cc: Gore, Tim; daniel.vetter@ffwll.ch
> Subject: [PATCH i-g-t 5/8] lib: don't ignore unknown options in multi-tests
> 
> None of the current tests have additional options that might make use of any
> unknown options and igt_subtest_init_parse_opts is available that integrates
> additional option parsing.
> 
> Signed-off-by: Thomas Wood <thomas.wood@intel.com>
Reviewed-by: Tim Gore <tim.gore@intel.com>
> ---
>  lib/igt_core.c | 13 +------------
>  1 file changed, 1 insertion(+), 12 deletions(-)
> 
> diff --git a/lib/igt_core.c b/lib/igt_core.c index 72c77e6..0867c27 100644
> --- a/lib/igt_core.c
> +++ b/lib/igt_core.c
> @@ -459,18 +459,7 @@ enum igt_log_level igt_log_level = IGT_LOG_INFO;
>   */
>  void igt_subtest_init(int argc, char **argv)  {
> -	int ret;
> -
> -	/* supress getopt errors about unknown options */
> -	opterr = 0;
> -
> -	ret = igt_subtest_init_parse_opts(argc, argv, NULL, NULL, NULL,
> NULL);
> -	if (ret < 0)
> -		/* exit with no error for -h/--help */
> -		exit(ret == -1 ? 0 : ret);
> -
> -	/* reset opt parsing */
> -	optind = 1;
> +	igt_subtest_init_parse_opts(argc, argv, NULL, NULL, NULL, NULL);
>  }
> 
>  /**
> --
> 1.9.3
diff mbox

Patch

diff --git a/lib/igt_core.c b/lib/igt_core.c
index 72c77e6..0867c27 100644
--- a/lib/igt_core.c
+++ b/lib/igt_core.c
@@ -459,18 +459,7 @@  enum igt_log_level igt_log_level = IGT_LOG_INFO;
  */
 void igt_subtest_init(int argc, char **argv)
 {
-	int ret;
-
-	/* supress getopt errors about unknown options */
-	opterr = 0;
-
-	ret = igt_subtest_init_parse_opts(argc, argv, NULL, NULL, NULL, NULL);
-	if (ret < 0)
-		/* exit with no error for -h/--help */
-		exit(ret == -1 ? 0 : ret);
-
-	/* reset opt parsing */
-	optind = 1;
+	igt_subtest_init_parse_opts(argc, argv, NULL, NULL, NULL, NULL);
 }
 
 /**