[libcamera-devel,v2,1/3] test: media_device: Convert to foreach

Message ID 20190111132705.19329-2-jacopo@jmondi.org
State Superseded
Headers show
Series
  • test: media_device: Add link handling test
Related show

Commit Message

Jacopo Mondi Jan. 11, 2019, 1:27 p.m. UTC
From: Kieran Bingham <kieran.bingham@ideasonboard.com>

Prevent duplication of boilerplate code as the suite grows by
establishing the foreach pattern in the media_device test suite.

Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
---
 test/media_device/meson.build | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

Patch

diff --git a/test/media_device/meson.build b/test/media_device/meson.build
index a7ebed1..40f9ffa 100644
--- a/test/media_device/meson.build
+++ b/test/media_device/meson.build
@@ -1,5 +1,11 @@ 
-media_device_test = executable('media_device_test', 'media_device_test.cpp',
-                               link_with : test_libraries,
-                               include_directories : test_includes_internal)
+media_device_tests = [
+    ['media_device_test',               'media_device_test.cpp'],
+]
 
-test('Media Device Test', media_device_test)
+foreach t : media_device_tests
+    exe = executable(t[0], t[1],
+                     link_with : test_libraries,
+                     include_directories : test_includes_internal)
+
+    test(t[0], exe, suite: 'media_device', is_parallel: false)
+endforeach