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)
