@@ -25,6 +25,7 @@
Tracing guide <guides/tracing>
Camera Sensor Model <camera-sensor-model>
SoftwareISP Benchmarking <software-isp-benchmarking>
+ Testing <testing>
Design document: AE <design/ae>
Internal API <internal-api/index>
Contribute <contributing>
@@ -175,6 +175,7 @@ if sphinx.found()
'sensor_driver_requirements.rst',
'sensor-support.rst',
'software-isp-benchmarking.rst',
+ 'testing.rst',
'../README.rst',
]
new file mode 100644
@@ -0,0 +1,35 @@
+.. SPDX-License-Identifier: CC-BY-SA-4.0
+
+Testing libcamera
+=================
+
+Test suites
+-----------
+
+Unit tests check individual components with self-contained fixtures. They
+include geometry, controls, serialization and the operating-system wrappers
+for files, timers, threads, processes and sockets.
+
+Integration tests combine components with device, pipeline or external
+backend fixtures. Existing checks cover camera capture, V4L2 devices,
+media graphs, IPA loading and communication, and camera-backed controls
+and serialization. Tests keep their component suites, such as ``camera``
+and ``ipa``, alongside the ``unit`` or ``integration`` suite.
+
+The ``test-unit`` and ``test-integration`` Meson options enable their
+respective groups independently. The existing ``test`` option enables
+both groups. All three options are disabled by default.
+
+.. code-block:: shell
+
+ meson setup build-unit -Dtest-unit=true
+ ninja -C build-unit
+ meson test -C build-unit --suite unit --print-errorlogs
+
+Use ``-Dtest-integration=true`` to build integration tests, or ``-Dtest=true``
+to build both groups. To switch an existing build from both groups to one,
+set ``-Dtest=false`` as well as enabling the desired group.
+
+Many integration tests need the kernel's vimc or vivid test devices.
+Integration builds automatically include the vimc pipeline handler and its
+IPA. Unit-only selection does not add that pipeline.