[libcamera-devel,v1,1/4] test: v4l2_compat: Reduce indentation
diff mbox series

Message ID 20221222010132.22177-2-laurent.pinchart@ideasonboard.com
State Accepted
Headers show
Series
  • test: Various unit test cleanups
Related show

Commit Message

Laurent Pinchart Dec. 22, 2022, 1:01 a.m. UTC
Return early with subdir_done() to reduce indentation in case the
v4l2_compat layer is not enabled. This matches our usual code patterns
in meson.build files, and prepares for enabling the v4l2_compat test
with ASan.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 test/v4l2_compat/meson.build | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

Comments

Umang Jain Dec. 23, 2022, 3:19 p.m. UTC | #1
Hi Laurent,

Thank you for the patch.

On 12/22/22 6:31 AM, Laurent Pinchart via libcamera-devel wrote:
> Return early with subdir_done() to reduce indentation in case the
> v4l2_compat layer is not enabled. This matches our usual code patterns
> in meson.build files, and prepares for enabling the v4l2_compat test
> with ASan.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>

> ---
>   test/v4l2_compat/meson.build | 16 +++++++++-------
>   1 file changed, 9 insertions(+), 7 deletions(-)
>
> diff --git a/test/v4l2_compat/meson.build b/test/v4l2_compat/meson.build
> index 878095892679..10c4675286b3 100644
> --- a/test/v4l2_compat/meson.build
> +++ b/test/v4l2_compat/meson.build
> @@ -1,5 +1,9 @@
>   # SPDX-License-Identifier: CC0-1.0
>   
> +if not is_variable('v4l2_compat')
> +    subdir_done()
> +endif
> +
>   # If ASan is enabled, the link order runtime check will fail as v4l2-ctl and
>   # v4l2-compliance are not linked to ASan. Skip the test in that case.
>   #
> @@ -10,11 +14,9 @@ if get_option('b_sanitize').contains('address')
>       subdir_done()
>   endif
>   
> -if is_variable('v4l2_compat')
> -    v4l2_compat_test = files('v4l2_compat_test.py')
> +v4l2_compat_test = files('v4l2_compat_test.py')
>   
> -    test('v4l2_compat_test', v4l2_compat_test,
> -         args : v4l2_compat,
> -         suite : 'v4l2_compat',
> -         timeout : 60)
> -endif
> +test('v4l2_compat_test', v4l2_compat_test,
> +     args : v4l2_compat,
> +     suite : 'v4l2_compat',
> +     timeout : 60)
Paul Elder Dec. 24, 2022, 12:10 a.m. UTC | #2
On Thu, Dec 22, 2022 at 03:01:29AM +0200, Laurent Pinchart via libcamera-devel wrote:
> Return early with subdir_done() to reduce indentation in case the
> v4l2_compat layer is not enabled. This matches our usual code patterns
> in meson.build files, and prepares for enabling the v4l2_compat test
> with ASan.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

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

> ---
>  test/v4l2_compat/meson.build | 16 +++++++++-------
>  1 file changed, 9 insertions(+), 7 deletions(-)
> 
> diff --git a/test/v4l2_compat/meson.build b/test/v4l2_compat/meson.build
> index 878095892679..10c4675286b3 100644
> --- a/test/v4l2_compat/meson.build
> +++ b/test/v4l2_compat/meson.build
> @@ -1,5 +1,9 @@
>  # SPDX-License-Identifier: CC0-1.0
>  
> +if not is_variable('v4l2_compat')
> +    subdir_done()
> +endif
> +
>  # If ASan is enabled, the link order runtime check will fail as v4l2-ctl and
>  # v4l2-compliance are not linked to ASan. Skip the test in that case.
>  #
> @@ -10,11 +14,9 @@ if get_option('b_sanitize').contains('address')
>      subdir_done()
>  endif
>  
> -if is_variable('v4l2_compat')
> -    v4l2_compat_test = files('v4l2_compat_test.py')
> +v4l2_compat_test = files('v4l2_compat_test.py')
>  
> -    test('v4l2_compat_test', v4l2_compat_test,
> -         args : v4l2_compat,
> -         suite : 'v4l2_compat',
> -         timeout : 60)
> -endif
> +test('v4l2_compat_test', v4l2_compat_test,
> +     args : v4l2_compat,
> +     suite : 'v4l2_compat',
> +     timeout : 60)

Patch
diff mbox series

diff --git a/test/v4l2_compat/meson.build b/test/v4l2_compat/meson.build
index 878095892679..10c4675286b3 100644
--- a/test/v4l2_compat/meson.build
+++ b/test/v4l2_compat/meson.build
@@ -1,5 +1,9 @@ 
 # SPDX-License-Identifier: CC0-1.0
 
+if not is_variable('v4l2_compat')
+    subdir_done()
+endif
+
 # If ASan is enabled, the link order runtime check will fail as v4l2-ctl and
 # v4l2-compliance are not linked to ASan. Skip the test in that case.
 #
@@ -10,11 +14,9 @@  if get_option('b_sanitize').contains('address')
     subdir_done()
 endif
 
-if is_variable('v4l2_compat')
-    v4l2_compat_test = files('v4l2_compat_test.py')
+v4l2_compat_test = files('v4l2_compat_test.py')
 
-    test('v4l2_compat_test', v4l2_compat_test,
-         args : v4l2_compat,
-         suite : 'v4l2_compat',
-         timeout : 60)
-endif
+test('v4l2_compat_test', v4l2_compat_test,
+     args : v4l2_compat,
+     suite : 'v4l2_compat',
+     timeout : 60)