[libcamera-devel] test: v4l2_compat: Report test as skipped if no compatible driver found
diff mbox series

Message ID 20210914021819.10375-1-laurent.pinchart@ideasonboard.com
State Accepted
Commit 556e2de509cf561c5584d77e731f776c5b357737
Headers show
Series
  • [libcamera-devel] test: v4l2_compat: Report test as skipped if no compatible driver found
Related show

Commit Message

Laurent Pinchart Sept. 14, 2021, 2:18 a.m. UTC
The V4L2 compatibility layer test includes a list of supported devices,
as V4L2 compatibility isn't officially supported with all devices yet.
If no supported device is present, the test reports success, while it
actually hasn't run. Report it being skipped in that case.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 test/v4l2_compat/v4l2_compat_test.py | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Paul Elder Sept. 14, 2021, 4:37 a.m. UTC | #1
Hi Laurent,

On Tue, Sep 14, 2021 at 05:18:19AM +0300, Laurent Pinchart wrote:
> The V4L2 compatibility layer test includes a list of supported devices,
> as V4L2 compatibility isn't officially supported with all devices yet.
> If no supported device is present, the test reports success, while it
> actually hasn't run. Report it being skipped in that case.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Looks good.

Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>

> ---
>  test/v4l2_compat/v4l2_compat_test.py | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/test/v4l2_compat/v4l2_compat_test.py b/test/v4l2_compat/v4l2_compat_test.py
> index ae892ced6127..be16af3bc5e6 100755
> --- a/test/v4l2_compat/v4l2_compat_test.py
> +++ b/test/v4l2_compat/v4l2_compat_test.py
> @@ -147,6 +147,10 @@ def main(argv):
>              print('success')
>          drivers_tested[driver] = True
>  
> +    if len(drivers_tested) == 0:
> +        print(f'No compatible drivers found')
> +        return TestSkip
> +
>      if len(failed) > 0:
>          print(f'Failed {len(failed)} tests:')
>          for device in failed:
> -- 
> Regards,
> 
> Laurent Pinchart
>

Patch
diff mbox series

diff --git a/test/v4l2_compat/v4l2_compat_test.py b/test/v4l2_compat/v4l2_compat_test.py
index ae892ced6127..be16af3bc5e6 100755
--- a/test/v4l2_compat/v4l2_compat_test.py
+++ b/test/v4l2_compat/v4l2_compat_test.py
@@ -147,6 +147,10 @@  def main(argv):
             print('success')
         drivers_tested[driver] = True
 
+    if len(drivers_tested) == 0:
+        print(f'No compatible drivers found')
+        return TestSkip
+
     if len(failed) > 0:
         print(f'Failed {len(failed)} tests:')
         for device in failed: