[PATCH i-g-t 3/3] scripts/igt_doc.py: don't be verbose when creating testlists

Kamil Konieczny kamil.konieczny at linux.intel.com
Mon Jan 29 09:57:26 UTC 2024


Hi Mauro,
On 2024-01-26 at 13:37:29 +0100, Mauro Carvalho Chehab wrote:
> From: Mauro Carvalho Chehab <mchehab at kernel.org>
> 
> As this target is part of meson, suppress outputs, except when
> there are errors or warnings.
> 
> Signed-off-by: Mauro Carvalho Chehab <mchehab at kernel.org>

Reviewed-by: Kamil Konieczny <kamil.konieczny at linux.intel.com>

> ---
>  scripts/igt_doc.py | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/scripts/igt_doc.py b/scripts/igt_doc.py
> index b66eefe799e9..6a1cfc2b5a56 100755
> --- a/scripts/igt_doc.py
> +++ b/scripts/igt_doc.py
> @@ -198,6 +198,8 @@ class IntelciTestlist:
>          if not os.path.exists(directory):
>              os.makedirs(directory)
>  
> +        files_written = False
> +
>          for driver, gpus in self.testlists.items():
>              driver_path = os.path.join(directory, driver)
>              try:
> @@ -225,14 +227,18 @@ class IntelciTestlist:
>                          testlist = re.sub(r"_+", "_", testlist)
>  
>                      if not subtests:
> -                        print(f"Warning: empty testlist: {testlist}")
> +                        sys.stderr.write(f"Warning: empty testlist: {testlist}\n")
>                          continue
>  
>                      fname = os.path.join(dname, testlist) + ".testlist"
>                      with open(fname, 'w', encoding='utf8') as handler:
>                          for sub in sorted(subtests):
>                              handler.write (f"{sub}\n")
> -                        print(f"{fname} created.")
> +
> +                    files_written = True
> +
> +        if not files_written:
> +            sys.stderr.write("Warning: No Intel CI test files created!")
>  
>  def main():
>      """
> -- 
> 2.43.0
> 


More information about the igt-dev mailing list