From patchwork Tue Jan 1 21:29:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 122 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 29A7C60B31 for ; Tue, 1 Jan 2019 22:29:52 +0100 (CET) Received: from localhost.localdomain (cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 97BE5B81; Tue, 1 Jan 2019 22:29:51 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1546378191; bh=jPSXicjLISYymvbWEFqqmopOX0a5TzQ21fC3LrqGwY8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=txmnDnCiLDRg1ra+JXGgeC9i219HkV6u/GRV0e/4JSHzF0ARMokE88cjPjuHw0fwy 2bzwpfoMDROzke6Rk7pMWZIGZlhUyumFRIQxAmlzF29rPK4vhNMWtewJJq8vJWY/ss F+3wIxPXh50fSTHvYYa+86mSvJxbgALZ+Wckhsv4= From: Kieran Bingham To: LibCamera Devel Date: Tue, 1 Jan 2019 21:29:43 +0000 Message-Id: <20190101212947.28098-2-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190101212947.28098-1-kieran.bingham@ideasonboard.com> References: <20190101212947.28098-1-kieran.bingham@ideasonboard.com> Subject: [libcamera-devel] [PATCH 1/5] test: media_device: Move test definition X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jan 2019 21:29:52 -0000 The test definition for the media_device_test executable should be located with the exectuable definition. Move it to the meson.build of that test suite subdir. Signed-off-by: Kieran Bingham Reviewed-by: Jacopo Mondi --- test/media_device/meson.build | 2 ++ test/meson.build | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/test/media_device/meson.build b/test/media_device/meson.build index a73644a08d6c..a7ebed102e24 100644 --- a/test/media_device/meson.build +++ b/test/media_device/meson.build @@ -1,3 +1,5 @@ media_device_test = executable('media_device_test', 'media_device_test.cpp', link_with : test_libraries, include_directories : test_includes_internal) + +test('Media Device Test', media_device_test) diff --git a/test/meson.build b/test/meson.build index aabe79ddc442..3b7591ad9204 100644 --- a/test/meson.build +++ b/test/meson.build @@ -24,4 +24,3 @@ subdir('media_device') test('Initialisation test', test_init) test('List Camera API tests', list) -test('Media Device Test', media_device_test) From patchwork Tue Jan 1 21:29:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 123 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 5A46860B31 for ; Tue, 1 Jan 2019 22:29:52 +0100 (CET) Received: from localhost.localdomain (cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id E13A71173; Tue, 1 Jan 2019 22:29:51 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1546378192; bh=0PPjrVLrCoWuaTfUf6rg+LJHhko/rKtmyGUDjcCWOuo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Lhe2RfVDGpXlOrADadKSfbkOasa7Wcdi6c3uZfUkiw+iqX4XQlKlCgR90hFbtw+aS 5brhHX1T9/qJK7MLAspqO51cnuHirEEsXiiaNgNC5WM5jWbf4nzRrS/aH+GLs/Aehn xHba9z2ZHA27kRwPoDKrO4E3fXwWnTuiwP52XHCA= From: Kieran Bingham To: LibCamera Devel Date: Tue, 1 Jan 2019 21:29:44 +0000 Message-Id: <20190101212947.28098-3-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190101212947.28098-1-kieran.bingham@ideasonboard.com> References: <20190101212947.28098-1-kieran.bingham@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 2/5] test: Use foreach iterators to simplify definitions X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jan 2019 21:29:52 -0000 Create two arrays, to contain public and internal test targets, and use the foreach iterators to automatically generate test output targets for each entry in each array. The public tests array is linked only against public libcamera headers, while tests declared in the internal_tests will have access to non-public API headers from within the libcamera sources. Reviewed-by: Niklas Söderlund Reviewed-by: Laurent Pinchart Signed-off-by: Kieran Bingham --- test/meson.build | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/test/meson.build b/test/meson.build index 3b7591ad9204..bf8232f32787 100644 --- a/test/meson.build +++ b/test/meson.build @@ -12,15 +12,28 @@ test_includes_internal = [ libcamera_internal_includes, ] -test_init = executable('test_init', 'init.cpp', - link_with : test_libraries, - include_directories : test_includes_public) +subdir('media_device') -list = executable('list', 'list.cpp', - link_with : test_libraries, - include_directories : test_includes_public) +public_tests = [ + ['test_init', 'init.cpp'], + ['list', 'list.cpp'], +] -subdir('media_device') +internal_tests = [ +] + +foreach t : public_tests + exe = executable(t[0], t[1], + link_with : test_libraries, + include_directories : test_includes_public) + + test(t[0], exe) +endforeach + +foreach t : internal_tests + exe = executable(t[0], t[1], + link_with : test_libraries, + include_directories : test_includes_internal) -test('Initialisation test', test_init) -test('List Camera API tests', list) + test(t[0], exe) +endforeach From patchwork Tue Jan 1 21:29:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 124 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id B54E460B31 for ; Tue, 1 Jan 2019 22:29:52 +0100 (CET) Received: from localhost.localdomain (cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 54382505; Tue, 1 Jan 2019 22:29:52 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1546378192; bh=TEJnxjI8ghCX294IOFqKWhhqxiq5mEL4rwgkVBVgbhk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QngcpfRgL0wRxVhNbte2BnT0+uBmjoVZGUOtNSqWQfwMQx+Y+RWWIebj8khxjozOe CPPoNc9SoEUWjP4hnryHy3AY2/sQ75ZruY1x/wI3nz4lk2lOShrt5zZXIxfIznZIHF keg1vCwCETJQrumvXr+r2hwmG/Hp3+Xu/+4SJhDQ= From: Kieran Bingham To: LibCamera Devel Date: Tue, 1 Jan 2019 21:29:45 +0000 Message-Id: <20190101212947.28098-4-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190101212947.28098-1-kieran.bingham@ideasonboard.com> References: <20190101212947.28098-1-kieran.bingham@ideasonboard.com> Subject: [libcamera-devel] [PATCH 3/5] test: Move include definitions to libtest X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jan 2019 21:29:53 -0000 With the libtest functionality moved to it's own library folder, the definitions for test inlcludes should reasonably live there too. The libtest subdir should always remain the first entry in the test/meson.build file. Signed-off-by: Kieran Bingham Reviewed-by: Laurent Pinchart --- test/libtest/meson.build | 12 ++++++++++++ test/meson.build | 12 ------------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/test/libtest/meson.build b/test/libtest/meson.build index b998154dd8d3..e0893b70c3d4 100644 --- a/test/libtest/meson.build +++ b/test/libtest/meson.build @@ -5,3 +5,15 @@ libtest_sources = files([ libtest = static_library('libtest', libtest_sources) libtest_includes = include_directories('.') + +test_libraries = [libcamera, libtest] + +test_includes_public = [ + libtest_includes, + libcamera_includes, +] + +test_includes_internal = [ + test_includes_public, + libcamera_internal_includes, +] diff --git a/test/meson.build b/test/meson.build index bf8232f32787..9270a55e052a 100644 --- a/test/meson.build +++ b/test/meson.build @@ -1,17 +1,5 @@ subdir('libtest') -test_libraries = [libcamera, libtest] - -test_includes_public = [ - libtest_includes, - libcamera_includes, -] - -test_includes_internal = [ - test_includes_public, - libcamera_internal_includes, -] - subdir('media_device') public_tests = [ From patchwork Tue Jan 1 21:29:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 125 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 1023860B3A for ; Tue, 1 Jan 2019 22:29:53 +0100 (CET) Received: from localhost.localdomain (cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 9DD15B81; Tue, 1 Jan 2019 22:29:52 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1546378192; bh=+bt7vKamcatq4RkWn4TnL+rqnL8+nxKC+8IUhdh7oFY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=t2n6Dy5kkX3SvkFcNdnjKsv/E4YFm6fiFylIFrcQPhKlNIEczG/luo29PNHR7CIna cSlUEC9BXMcRQjQX+ii3q8ItIseMzQOetjyKFbX3PKWa9IkcsuEUWpzaWMifZ95zzt WLJGsSr/jXK90DrrfFCQd+O3kPrGbzor7DS6srDs= From: Kieran Bingham To: LibCamera Devel Date: Tue, 1 Jan 2019 21:29:46 +0000 Message-Id: <20190101212947.28098-5-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190101212947.28098-1-kieran.bingham@ideasonboard.com> References: <20190101212947.28098-1-kieran.bingham@ideasonboard.com> Subject: [libcamera-devel] [PATCH 4/5] test: media_device: Convert to foreach X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jan 2019 21:29:53 -0000 Prevent duplication of boilerplate code as the suite grows by establishing the foreach pattern in the media_device test suite. Signed-off-by: Kieran Bingham --- test/media_device/meson.build | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/test/media_device/meson.build b/test/media_device/meson.build index a7ebed102e24..d9394b0545d8 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 From patchwork Tue Jan 1 21:29:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 126 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 71BB660B34 for ; Tue, 1 Jan 2019 22:29:53 +0100 (CET) Received: from localhost.localdomain (cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id E40381173; Tue, 1 Jan 2019 22:29:52 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1546378193; bh=y62Z5v0Dk62YxWcK+69sDcAC7FqfBI4qukPhaSgI2gU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ilsi/O9qwK8exehC7lOlkv03OBFNpvp8mLyOm9qGYcoh2zLe16I1h19XYqwvt94bT 4oyYQVIo4+Ri3By+Ks1MND3R3nOi8EzOEKbPSGz+AWl/uORM+udXgF+aMxakKMPtgZ FCwjJqCRogePO2U7m25FhPJyyMAmQ6QJ410wyF5Q= From: Kieran Bingham To: LibCamera Devel Date: Tue, 1 Jan 2019 21:29:47 +0000 Message-Id: <20190101212947.28098-6-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190101212947.28098-1-kieran.bingham@ideasonboard.com> References: <20190101212947.28098-1-kieran.bingham@ideasonboard.com> Subject: [libcamera-devel] [PATCH 5/5] libcamera: Remove libcamera class X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jan 2019 21:29:54 -0000 From: Laurent Pinchart The class was just a placeholder, now that we have other objects defined, remove it along with the associated test. The libcamera/libcamera.h header is kept as a shortcut to include the whole libcamera public API. Signed-off-by: Laurent Pinchart [Kieran: Rebase to master] Signed-off-by: Kieran Bingham --- include/libcamera/libcamera.h | 10 ---------- src/libcamera/main.cpp | 19 ------------------- src/libcamera/meson.build | 1 - test/init.cpp | 16 ---------------- test/meson.build | 1 - 5 files changed, 47 deletions(-) delete mode 100644 src/libcamera/main.cpp delete mode 100644 test/init.cpp diff --git a/include/libcamera/libcamera.h b/include/libcamera/libcamera.h index 32fb1ff741a7..f9556a8bce62 100644 --- a/include/libcamera/libcamera.h +++ b/include/libcamera/libcamera.h @@ -10,14 +10,4 @@ #include #include -namespace libcamera { - -class libcamera -{ -public: - void init_lib(void); -}; - -}; - #endif /* __LIBCAMERA_LIBCAMERA_H__ */ diff --git a/src/libcamera/main.cpp b/src/libcamera/main.cpp deleted file mode 100644 index 7ed37dfcfd5b..000000000000 --- a/src/libcamera/main.cpp +++ /dev/null @@ -1,19 +0,0 @@ -/* SPDX-License-Identifier: LGPL-2.1-or-later */ -/* - * Copyright (C) 2018, Google Inc. - * - * main.cpp - libcamera main class - */ - -#include - -#include "log.h" - -namespace libcamera { - -void libcamera::init_lib(void) -{ - LOG(Info) << "Lib Camera Init"; -} - -}; diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build index 2ff5bb5e7515..78562299fc42 100644 --- a/src/libcamera/meson.build +++ b/src/libcamera/meson.build @@ -3,7 +3,6 @@ libcamera_sources = files([ 'camera_manager.cpp', 'device_enumerator.cpp', 'log.cpp', - 'main.cpp', 'media_device.cpp', 'media_object.cpp', 'pipeline_handler.cpp', diff --git a/test/init.cpp b/test/init.cpp deleted file mode 100644 index 4ade4e7690fc..000000000000 --- a/test/init.cpp +++ /dev/null @@ -1,16 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-or-later */ -/* - * Copyright (C) 2018, Google Inc. - * - * init.cpp - libcamera initialization test - */ - -#include - -int main(void) -{ - libcamera::libcamera l = libcamera::libcamera(); - l.init_lib(); - - return 0; -} diff --git a/test/meson.build b/test/meson.build index 9270a55e052a..184a7eeb5e27 100644 --- a/test/meson.build +++ b/test/meson.build @@ -3,7 +3,6 @@ subdir('libtest') subdir('media_device') public_tests = [ - ['test_init', 'init.cpp'], ['list', 'list.cpp'], ]