[3/7] docs: Describe unit and integration test selection
diff mbox series

Message ID 20261016202916.1405813-4-halfline@gmail.com
State New
Headers show
Series
  • tests: Separate suites and check software ISP crops
Related show

Commit Message

Ray Strode Oct. 16, 2026, 8:29 p.m. UTC
From: Ray Strode <rstrode@redhat.com>

This commit documents the distinction between the existing test suites and
how to build and run each group.

The guide explains the fixtures used by each suite, the retained component
suites, and the test-unit and test-integration options alongside the
existing test option. It also explains the vimc pipeline dependency and how
to change an existing build to select only one group.

Signed-off-by: Ray Strode <rstrode@redhat.com>
---
 Documentation/index.rst   |  1 +
 Documentation/meson.build |  1 +
 Documentation/testing.rst | 35 +++++++++++++++++++++++++++++++++++
 3 files changed, 37 insertions(+)
 create mode 100644 Documentation/testing.rst

Patch
diff mbox series

diff --git a/Documentation/index.rst b/Documentation/index.rst
index e40cd0c9..bc5f849e 100644
--- a/Documentation/index.rst
+++ b/Documentation/index.rst
@@ -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>
diff --git a/Documentation/meson.build b/Documentation/meson.build
index a156bd0b..69819776 100644
--- a/Documentation/meson.build
+++ b/Documentation/meson.build
@@ -175,6 +175,7 @@  if sphinx.found()
         'sensor_driver_requirements.rst',
         'sensor-support.rst',
         'software-isp-benchmarking.rst',
+        'testing.rst',
        '../README.rst',
     ]
 
diff --git a/Documentation/testing.rst b/Documentation/testing.rst
new file mode 100644
index 00000000..49c1f085
--- /dev/null
+++ b/Documentation/testing.rst
@@ -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.