[libcamera-devel,v3,34/38] tests: ipa_interface_test: Update to use new createIPA

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

Commit Message

Paul Elder Oct. 2, 2020, 2:31 p.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 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 | 10 +++++++---
 test/ipa/meson.build            |  2 +-
 2 files changed, 8 insertions(+), 4 deletions(-)

Patch

diff --git a/test/ipa/ipa_interface_test.cpp b/test/ipa/ipa_interface_test.cpp
index 1bc93a63..db95a9e5 100644
--- a/test/ipa/ipa_interface_test.cpp
+++ b/test/ipa/ipa_interface_test.cpp
@@ -14,13 +14,15 @@ 
 
 #include <libcamera/event_dispatcher.h>
 #include <libcamera/event_notifier.h>
-#include <libcamera/ipa/ipa_vimc.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..928987db 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_headers],
                      dependencies : libcamera_dep,
                      link_with : test_libraries,
                      include_directories : test_includes_internal)