[libcamera-devel,v4,32/37] tests: ipa_interface_test: Update to use new createIPA
diff mbox series

Message ID 20201106103707.49660-33-paul.elder@ideasonboard.com
State Superseded
Headers show
Series
  • IPA isolation implementation
Related show

Commit Message

Paul Elder Nov. 6, 2020, 10:37 a.m. UTC
Update the IPA interface test to use the new createIPA function from
IPAManager. Also declare ProcessManager, as it is not longer globally
defined. Update meson.build to depend on the generated IPA interface
headers.

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

---
Changes in v4:
- rename libcamera_generated_headers to libcamera_generated_ipa_headers

Changes in v3:
- declare ProcessManager
- add libcamera_generated_headers as dependency to meson
  - otherwise test might build before the generated IPA headers and
    #include will fail

New in v2
---
 test/ipa/ipa_interface_test.cpp | 8 ++++++--
 test/ipa/meson.build            | 2 +-
 2 files changed, 7 insertions(+), 3 deletions(-)

Comments

Laurent Pinchart Nov. 26, 2020, 3:52 p.m. UTC | #1
Hi Paul,

Thank you for the patch.

On Fri, Nov 06, 2020 at 07:37:02PM +0900, Paul Elder wrote:
> Update the IPA interface test to use the new createIPA function from
> IPAManager. Also declare ProcessManager, as it is not longer globally

Maybe "Also create an instance of ProcessManager, as no single global
instance is created automatically anymore." ?

> defined. Update meson.build to depend on the generated IPA interface
> headers.
> 
> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
> 
> ---
> Changes in v4:
> - rename libcamera_generated_headers to libcamera_generated_ipa_headers
> 
> Changes in v3:
> - declare ProcessManager
> - add libcamera_generated_headers as dependency to meson
>   - otherwise test might build before the generated IPA headers and
>     #include will fail
> 
> New in v2
> ---
>  test/ipa/ipa_interface_test.cpp | 8 ++++++--
>  test/ipa/meson.build            | 2 +-
>  2 files changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/test/ipa/ipa_interface_test.cpp b/test/ipa/ipa_interface_test.cpp
> index 67488409..db95a9e5 100644
> --- a/test/ipa/ipa_interface_test.cpp
> +++ b/test/ipa/ipa_interface_test.cpp
> @@ -15,12 +15,14 @@
>  #include <libcamera/event_dispatcher.h>
>  #include <libcamera/event_notifier.h>
>  #include <libcamera/ipa/vimc.h>
> +#include <libcamera/ipa/ipa_proxy_vimc.h>

Alphabetical order. Doesn't checkstyle.py flag it ?

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

>  #include <libcamera/timer.h>
>  
>  #include "libcamera/internal/device_enumerator.h"
>  #include "libcamera/internal/ipa_manager.h"
>  #include "libcamera/internal/ipa_module.h"
>  #include "libcamera/internal/pipeline_handler.h"
> +#include "libcamera/internal/process.h"
>  #include "libcamera/internal/thread.h"
>  
>  #include "test.h"
> @@ -95,7 +97,7 @@ protected:
>  		EventDispatcher *dispatcher = thread()->eventDispatcher();
>  		Timer timer;
>  
> -		ipa_ = IPAManager::createIPA(pipe_.get(), 0, 0);
> +		ipa_ = IPAManager::createIPA<IPAProxyVimc>(pipe_.get(), 0, 0);
>  		if (!ipa_) {
>  			cerr << "Failed to create VIMC IPA interface" << endl;
>  			return TestFail;
> @@ -163,8 +165,10 @@ private:
>  		}
>  	}
>  
> +	ProcessManager processManager_;
> +
>  	std::shared_ptr<PipelineHandler> pipe_;
> -	std::unique_ptr<IPAProxy> ipa_;
> +	std::unique_ptr<IPAProxyVimc> ipa_;
>  	std::unique_ptr<IPAManager> ipaManager_;
>  	enum IPAOperationCode trace_;
>  	EventNotifier *notifier_;
> diff --git a/test/ipa/meson.build b/test/ipa/meson.build
> index b25bfcf4..fce58a31 100644
> --- a/test/ipa/meson.build
> +++ b/test/ipa/meson.build
> @@ -7,7 +7,7 @@ ipa_test = [
>  ]
>  
>  foreach t : ipa_test
> -    exe = executable(t[0], t[1],
> +    exe = executable(t[0], [t[1], libcamera_generated_ipa_headers],
>                       dependencies : libcamera_dep,
>                       link_with : test_libraries,
>                       include_directories : test_includes_internal)

Patch
diff mbox series

diff --git a/test/ipa/ipa_interface_test.cpp b/test/ipa/ipa_interface_test.cpp
index 67488409..db95a9e5 100644
--- a/test/ipa/ipa_interface_test.cpp
+++ b/test/ipa/ipa_interface_test.cpp
@@ -15,12 +15,14 @@ 
 #include <libcamera/event_dispatcher.h>
 #include <libcamera/event_notifier.h>
 #include <libcamera/ipa/vimc.h>
+#include <libcamera/ipa/ipa_proxy_vimc.h>
 #include <libcamera/timer.h>
 
 #include "libcamera/internal/device_enumerator.h"
 #include "libcamera/internal/ipa_manager.h"
 #include "libcamera/internal/ipa_module.h"
 #include "libcamera/internal/pipeline_handler.h"
+#include "libcamera/internal/process.h"
 #include "libcamera/internal/thread.h"
 
 #include "test.h"
@@ -95,7 +97,7 @@  protected:
 		EventDispatcher *dispatcher = thread()->eventDispatcher();
 		Timer timer;
 
-		ipa_ = IPAManager::createIPA(pipe_.get(), 0, 0);
+		ipa_ = IPAManager::createIPA<IPAProxyVimc>(pipe_.get(), 0, 0);
 		if (!ipa_) {
 			cerr << "Failed to create VIMC IPA interface" << endl;
 			return TestFail;
@@ -163,8 +165,10 @@  private:
 		}
 	}
 
+	ProcessManager processManager_;
+
 	std::shared_ptr<PipelineHandler> pipe_;
-	std::unique_ptr<IPAProxy> ipa_;
+	std::unique_ptr<IPAProxyVimc> ipa_;
 	std::unique_ptr<IPAManager> ipaManager_;
 	enum IPAOperationCode trace_;
 	EventNotifier *notifier_;
diff --git a/test/ipa/meson.build b/test/ipa/meson.build
index b25bfcf4..fce58a31 100644
--- a/test/ipa/meson.build
+++ b/test/ipa/meson.build
@@ -7,7 +7,7 @@  ipa_test = [
 ]
 
 foreach t : ipa_test
-    exe = executable(t[0], t[1],
+    exe = executable(t[0], [t[1], libcamera_generated_ipa_headers],
                      dependencies : libcamera_dep,
                      link_with : test_libraries,
                      include_directories : test_includes_internal)