[libcamera-devel] [PATCH 1/5] test: Move test objects to libtest

Kieran Bingham kieran.bingham at ideasonboard.com
Fri Dec 21 09:13:07 CET 2018


Create a subdirectory to contain the libtest helper library.

Define two variables to clarify when tests are aimed at public or
internal components.

Signed-off-by: Kieran Bingham <kieran.bingham at ideasonboard.com>
---
 test/libtest/meson.build    |  7 +++++++
 test/{ => libtest}/test.cpp |  0
 test/{ => libtest}/test.h   |  0
 test/meson.build            | 20 ++++++++++++++------
 4 files changed, 21 insertions(+), 6 deletions(-)
 create mode 100644 test/libtest/meson.build
 rename test/{ => libtest}/test.cpp (100%)
 rename test/{ => libtest}/test.h (100%)

diff --git a/test/libtest/meson.build b/test/libtest/meson.build
new file mode 100644
index 000000000000..b998154dd8d3
--- /dev/null
+++ b/test/libtest/meson.build
@@ -0,0 +1,7 @@
+libtest_sources = files([
+    'test.cpp',
+])
+
+libtest = static_library('libtest', libtest_sources)
+
+libtest_includes = include_directories('.')
diff --git a/test/test.cpp b/test/libtest/test.cpp
similarity index 100%
rename from test/test.cpp
rename to test/libtest/test.cpp
diff --git a/test/test.h b/test/libtest/test.h
similarity index 100%
rename from test/test.h
rename to test/libtest/test.h
diff --git a/test/meson.build b/test/meson.build
index da0aea9678d1..50ec11853203 100644
--- a/test/meson.build
+++ b/test/meson.build
@@ -1,11 +1,19 @@
-libtest_sources = files([
-    'test.cpp',
-])
+subdir('libtest')
 
-libtest = static_library('libtest', libtest_sources)
+test_libraries = [libcamera, libtest]
+
+test_includes_public = [
+  libtest_includes,
+  libcamera_includes,
+]
+
+test_includes_internal = [
+  test_includes_public,
+  libcamera_internal_includes,
+]
 
 test_init = executable('test_init', 'init.cpp',
-                       link_with : libcamera,
-                       include_directories : libcamera_includes)
+                       link_with : test_libraries,
+                       include_directories : test_includes_public)
 
 test('Initialisation test', test_init)
-- 
2.17.1



More information about the libcamera-devel mailing list