[2/5] lib/igt_core: reserve long options for individual tests

Submitted by Lucas De Marchi on May 29, 2019, 11:27 p.m.

Details

Message ID 20190529232737.31515-2-lucas.demarchi@intel.com
State New
Headers show
Series "Series without cover letter" ( rev: 1 ) in IGT (deprecated)

Not browsing as part of any series.

Commit Message

Lucas De Marchi May 29, 2019, 11:27 p.m.
Start the core optiosn from 500 so the individual tests can have their
own options starting from 0. This makes it easier to set the long
options without conflicting.

500 is just a magic number, higher than any ascii char that could be
used in the individual test.

While at it, fix the coding style to use tab rather than space.

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
---
 lib/igt_core.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

Patch hide | download patch | download mbox

diff --git a/lib/igt_core.c b/lib/igt_core.c
index 9c86d664..814f5c72 100644
--- a/lib/igt_core.c
+++ b/lib/igt_core.c
@@ -280,12 +280,16 @@  int test_children_sz;
 bool test_child;
 
 enum {
- OPT_LIST_SUBTESTS,
- OPT_RUN_SUBTEST,
- OPT_DESCRIPTION,
- OPT_DEBUG,
- OPT_INTERACTIVE_DEBUG,
- OPT_HELP = 'h'
+	/*
+	 * Let the first values be used by individual tests so options don't
+	 * conflict with core ones
+	 */
+	OPT_LIST_SUBTESTS = 500,
+	OPT_RUN_SUBTEST,
+	OPT_DESCRIPTION,
+	OPT_DEBUG,
+	OPT_INTERACTIVE_DEBUG,
+	OPT_HELP = 'h'
 };
 
 static int igt_exitcode = IGT_EXIT_SUCCESS;

Comments

On 29/05/19 16:27, Lucas De Marchi wrote:
> Start the core optiosn from 500 so the individual tests can have their
> own options starting from 0. This makes it easier to set the long
> options without conflicting.
> 
> 500 is just a magic number, higher than any ascii char that could be
> used in the individual test.
> 
> While at it, fix the coding style to use tab rather than space.
> 
> Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>

Acked-by: Antonio Argenziano <antonio.argenziano@intel.com>

> ---
>   lib/igt_core.c | 16 ++++++++++------
>   1 file changed, 10 insertions(+), 6 deletions(-)
> 
> diff --git a/lib/igt_core.c b/lib/igt_core.c
> index 9c86d664..814f5c72 100644
> --- a/lib/igt_core.c
> +++ b/lib/igt_core.c
> @@ -280,12 +280,16 @@ int test_children_sz;
>   bool test_child;
>   
>   enum {
> - OPT_LIST_SUBTESTS,
> - OPT_RUN_SUBTEST,
> - OPT_DESCRIPTION,
> - OPT_DEBUG,
> - OPT_INTERACTIVE_DEBUG,
> - OPT_HELP = 'h'
> +	/*
> +	 * Let the first values be used by individual tests so options don't
> +	 * conflict with core ones
> +	 */
> +	OPT_LIST_SUBTESTS = 500,
> +	OPT_RUN_SUBTEST,
> +	OPT_DESCRIPTION,
> +	OPT_DEBUG,
> +	OPT_INTERACTIVE_DEBUG,
> +	OPT_HELP = 'h'
>   };
>   
>   static int igt_exitcode = IGT_EXIT_SUCCESS;
>
On Wed, May 29, 2019 at 04:27:34PM -0700, Lucas De Marchi wrote:
> Start the core optiosn from 500 so the individual tests can have their
> own options starting from 0. This makes it easier to set the long
> options without conflicting.
> 
> 500 is just a magic number, higher than any ascii char that could be
> used in the individual test.
> 
> While at it, fix the coding style to use tab rather than space.
> 
> Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>

This is much better than requiring additional opts to begin from a particular number.


Reviewed-by: Petri Latvala <petri.latvala@intel.com>


> ---
>  lib/igt_core.c | 16 ++++++++++------
>  1 file changed, 10 insertions(+), 6 deletions(-)
> 
> diff --git a/lib/igt_core.c b/lib/igt_core.c
> index 9c86d664..814f5c72 100644
> --- a/lib/igt_core.c
> +++ b/lib/igt_core.c
> @@ -280,12 +280,16 @@ int test_children_sz;
>  bool test_child;
>  
>  enum {
> - OPT_LIST_SUBTESTS,
> - OPT_RUN_SUBTEST,
> - OPT_DESCRIPTION,
> - OPT_DEBUG,
> - OPT_INTERACTIVE_DEBUG,
> - OPT_HELP = 'h'
> +	/*
> +	 * Let the first values be used by individual tests so options don't
> +	 * conflict with core ones
> +	 */
> +	OPT_LIST_SUBTESTS = 500,
> +	OPT_RUN_SUBTEST,
> +	OPT_DESCRIPTION,
> +	OPT_DEBUG,
> +	OPT_INTERACTIVE_DEBUG,
> +	OPT_HELP = 'h'
>  };
>  
>  static int igt_exitcode = IGT_EXIT_SUCCESS;
> -- 
> 2.21.0
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx