From patchwork Tue Jul 11 14:55:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 18810 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 34935BEFBE for ; Tue, 11 Jul 2023 14:55:19 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 8BA97628C0; Tue, 11 Jul 2023 16:55:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1689087318; bh=XXNI4cG4adUNigCekmhKb56OgZBJ8wJwP/Tovk+qPTA=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=amhgaCp4GyLxjAi7oPrWDYiviSh9vvAi3dnnb3J2xI+eqhNHV6lBiAaIaUnDPR0Y8 CwVFEIURzW1FP3Sg4hPk9WFD2Ip3ui/LiWcsLMCv4Rh7P7qEz+vZI/wh4K8RptK0gV 8g1StVJxunMcJySB1SLqQ6qfC3Y7u17KNhoonw36f4srMg61HimTV9LpCZmpY2BxWA /G8jm9zP5Shp3xw98GCxHdG8C90BVeoM7SFrWoLhfZ00gy1Qqn2QHdgGT7eVSYDX3d lpF1+rNKkn+y84zD/nazXf8RovZfhOodLg9/6vI/5A+CsLpAg/iAvSLVG3V+Sqekjw TNgQZ2CPrlIpA== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 2500E60570 for ; Tue, 11 Jul 2023 16:55:17 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="GKQQXQ7F"; dkim-atps=neutral Received: from Monstersaurus.local (aztw-30-b2-v4wan-166917-cust845.vm26.cable.virginm.net [82.37.23.78]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id E38ECDFB; Tue, 11 Jul 2023 16:54:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1689087268; bh=XXNI4cG4adUNigCekmhKb56OgZBJ8wJwP/Tovk+qPTA=; h=From:To:Cc:Subject:Date:From; b=GKQQXQ7FulljTEzIQDJU/e5Ab2iHwU34BGKIc5OnouD8ihZtWFOjGr4Edg5IsRMMW rprMZoUGDdlbPDymfCLFle6ZvXK1jRrK3l9Wu+ifOZFIELB/NmQ18NaF4CFSmHzoCp l3ih3ZIWe7hnFmJs4Hed5RXcIWkYqJxoNd30BSe4= To: libcamera devel Date: Tue, 11 Jul 2023 15:55:13 +0100 Message-Id: <20230711145513.714742-1-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2] README: Add unit tests instructions X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Kieran Bingham via libcamera-devel From: Kieran Bingham Reply-To: Kieran Bingham Cc: William Salmon Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The unit tests require kernel modules to be loaded to support the virtual test cameras. Add notes to the readme to highlight that it can be done, and what kernel configurations are required. Suggested-by: William Salmon Signed-off-by: Kieran Bingham --- v2: - Reword small fixes from Laurent - Move to contributing.rst Documentation/contributing.rst | 41 ++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/Documentation/contributing.rst b/Documentation/contributing.rst index 2f0b4921f7e6..27c77558a6e6 100644 --- a/Documentation/contributing.rst +++ b/Documentation/contributing.rst @@ -59,6 +59,47 @@ uses `Doxygen`_. Please make sure to document all code during development. .. _Sphinx: https://www.sphinx-doc.org .. _Doxygen: https://www.doxygen.nl +Running the unit tests +---------------------- + +When submitting patches, it is recommended to run the unit tests. The unit +tests rely on kernel drivers which produce virtual devices. These can be either +built into the kernel, or provided as modules (=y or =m): + +.. code:: + + CONFIG_MEDIA_TEST_SUPPORT=y + CONFIG_V4L_TEST_DRIVERS=y + + CONFIG_VIDEO_VIM2M=m + CONFIG_VIDEO_VIMC=m + CONFIG_VIDEO_VIVID=m + +If the kernel provides the test drivers as modules, they need to be loaded +before running the tests: + +.. code:: + + sudo modprobe vimc + sudo modprobe vivid + sudo modprobe vim2m + +Make sure your build configuration has tests enabled by running the following +in the build directory: + +.. code:: + + meson configure -Dtest=true + +Enabling 'test=true' will implicitly add the VIMC test pipeline handler to the +build configuration. + +Then the tests can be run with: + +.. code:: + + ninja -C build test + Submitting Patches ------------------