From patchwork Fri Oct 16 20:29:11 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ray Strode X-Patchwork-Id: 28486 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 D6B2EC324C for ; Fri, 16 Oct 2026 20:29:31 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 6C4B668E7D; Fri, 16 Oct 2026 22:29:31 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="ZTyasbEG"; dkim-atps=neutral Received: from mail-vs1-xe2d.google.com (mail-vs1-xe2d.google.com [IPv6:2607:f8b0:4864:20::e2d]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id B2D4E68E5B for ; Fri, 16 Oct 2026 22:29:28 +0200 (CEST) Received: by mail-vs1-xe2d.google.com with SMTP id ada2fe7eead31-7cbbb7b90efso62869137.2 for ; Fri, 16 Oct 2026 13:29:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1792182567; x=1792787367; darn=lists.libcamera.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=Y42NSwy8HJ/ZqSzPA5FUW17P6X6kOCCgthInMKKbfE0=; b=ZTyasbEG5NZJt8IKqSwPKVnCR1EgI+tsBYUOq7Y0QUzlT815O8Al1onQEzPrANqRtp 3eWCgsiHACfqbCJVrDkKHuusmT4nRXHokQjr+lG+fMtmL4qS54o3Q0eV8JDJICXUiOKn AfWmkyxKgWEBhFGotrAz/fWwAEDMxkQVX5N0eFj2/KiwJt7mLNurpaB+aixrHe3wfIJ6 cHxf95ocSIPKW+PXNdiBJnlMZwDd7BWQLTm7UAwaCJGfZziCosBiKUhjNagS23jTxxNo 6W0eGFlrk4puD0GcWoWX8FGwa6oMkn/mi8OYewktlzmr4dzJAEyg4ZBgfNc5NKudlXkJ s8Bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1792182567; x=1792787367; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=Y42NSwy8HJ/ZqSzPA5FUW17P6X6kOCCgthInMKKbfE0=; b=oRCDljiTQWbFVS+uhSvyd2vbC6l5CMhJEya6a7xrzaVF5rxE1Hu4UnI09k91O8jY6P o22s3FMjxVSLcthBL+32k7FPE55d6+IdbW3ONbRxWnF3VqObvV73pOynm2Czydgbz35E CRNySkOv8nPgPsrogfgae7VFbOri5D/h4AG3M/e/QZ38LUQsUSpoeLsFuiKx4FZNjdhx aQ1S7L/yJgCr/lZDdvo1jI4CJXgL3cp328YZUtYtsX//OTQddYJsK5vcpQrzmDEnTxBJ kNy5ZZzKYgB7tkDqzlEnRuQM6TUqWeDVwu/CnI8jeBrPPiEsfbWWFnpJfmTMSxEiipnx VaDQ== X-Gm-Message-State: AFq9FYKhbYLVxV41CtiBYS4l0SvRDvDXBY1WqdO4gh4W0rbKq1kmiVo6 k3sroASe+EnbRsYghTwrSlbA8ySfRfEVciKXTXuX32twQwDjQoTZ5t298FszqJzFNZc= X-Gm-Gg: AYBFou0qer7Ih4EBA0IQIWwh5ectU30PtWdR/Nubp4L65bfQKvQ4iEM8dSF9HdY3kfK 9sMN2tSdVMyI3zov1JZkjgTZudpuRYraGlddh/M1cLvUCGWf4luNi+WBALocs1zczYvBzJJ7TFI 3H/ZsvuugXcGuQfqb8WQu/fiutXx7pVLLhoBed/fcBjTfXIVZt4+kM7YyqhJKg3K/C7mQQsMzN7 lWi1KxZvmUM7QMqZBUnwbcjj3NSrlkhCvAtw7k+gqTeLeDqBnSUIZCYxZsFvgFLfWbfJN4Shplu PXx+ZLjErmh6K80p4HE8AIzJ6IuwVQlgtUyVhGPua+5SdZv0wq1bjarsE/Grh+GhbLIwHnjpnDs EMA4FDl+2vIcAYfj0mVBbJpXZs122Y9vS3HHsFiA9+f4cjFEeMiD5jk9Cg/pGv5kp6ppKCpXeK3 jsIlcYj3vD3K/fbj0LVbhNGdkOLJUfBVlsAtUrSs+GKpYgcw6aOx0Q+jyMB5m4VaW32QT6BqbYd Mv2VLNuceHWeYLD579saSmVQMcCrQ== X-Received: by 2002:a05:6102:955:b0:7cc:2946:7f69 with SMTP id ada2fe7eead31-7cc368fe22bmr204607137.8.1792182567434; Fri, 16 Oct 2026 13:29:27 -0700 (PDT) Received: from localhost ([2601:19c:4a00:897d:3391:ed89:5571:41a8]) by smtp.gmail.com with ESMTPSA id a1e0cc1a2514c-990835c29eesm2271202241.4.2026.10.16.13.29.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Oct 2026 13:29:26 -0700 (PDT) From: Ray Strode To: libcamera-devel@lists.libcamera.org Cc: johannes.goede@oss.qualcomm.com, laurent.pinchart@ideasonboard.com, kieran.bingham@ideasonboard.com Subject: [PATCH 2/7] tests: Select unit and integration suites independently Date: Fri, 16 Oct 2026 16:29:11 -0400 Message-ID: <20261016202916.1405813-3-halfline@gmail.com> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261016202916.1405813-1-halfline@gmail.com> References: <8fd58439-d19e-4539-962f-a6110be5c971@oss.qualcomm.com> <20261016202916.1405813-1-halfline@gmail.com> MIME-Version: 1.0 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" From: Ray Strode This commit adds matching build options for the unit and integration suites. Meson can select either suite when running tests, but the test option still compiles both groups. Device and pipeline fixtures therefore remain part of a build intended only for self-contained component tests. The test-unit and test-integration options select their respective groups independently. The existing test option enables both, preserving the tests included by existing build commands. All three options are disabled by default. Only integration tests automatically enable the vimc pipeline and its IPA fixtures. Both groups share the existing test framework, and integration subdirectories can add further backend checks to that group. Signed-off-by: Ray Strode --- meson.build | 12 +++++--- meson_options.txt | 12 +++++++- src/ipa/meson.build | 6 ++-- test/camera/meson.build | 4 +++ test/controls/meson.build | 4 +++ test/gstreamer/meson.build | 4 +++ test/integration/meson.build | 3 ++ test/ipa/libipa/meson.build | 4 +++ test/ipa/meson.build | 4 +++ test/ipc/meson.build | 4 +++ test/log/meson.build | 4 +++ test/media_device/meson.build | 4 +++ test/meson.build | 29 ++++++++++++++++--- test/process/meson.build | 4 +++ test/py/meson.build | 4 +++ .../generated_serializer/meson.build | 4 +++ test/serialization/meson.build | 4 +++ test/software_isp/meson.build | 2 +- test/stream/meson.build | 4 +++ test/v4l2_compat/meson.build | 4 +++ test/v4l2_subdevice/meson.build | 4 +++ test/v4l2_videodevice/meson.build | 4 +++ 22 files changed, 115 insertions(+), 13 deletions(-) create mode 100644 test/integration/meson.build diff --git a/meson.build b/meson.build index 37fe9ce4..99174b6e 100644 --- a/meson.build +++ b/meson.build @@ -241,9 +241,12 @@ else pipelines = wanted_pipelines endif -# Tests require the vimc pipeline handler, include it automatically when tests -# are enabled. -if get_option('test') +test_unit_enabled = get_option('test') or get_option('test-unit') +test_integration_enabled = get_option('test') or get_option('test-integration') + +# Integration tests require the vimc pipeline handler, include it automatically +# when they are enabled. +if test_integration_enabled foreach pipeline, archs : pipelines_support if 'test' in archs and pipeline not in pipelines message('Enabling ' + pipeline + ' pipeline handler for tests') @@ -304,7 +307,8 @@ summary({ 'GStreamer support': gst_enabled, 'Python bindings': pycamera_enabled, 'V4L2 emulation support': v4l2_enabled, - 'Unit tests': test_enabled, + 'Unit tests': test_unit_enabled, + 'Integration tests': test_integration_enabled, }, section : 'Configuration', bool_yn : true) diff --git a/meson_options.txt b/meson_options.txt index e829ebe6..fffdb6de 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -114,7 +114,17 @@ option('softisp-gpu', option('test', type : 'boolean', value : false, - description : 'Compile and include the tests') + description : 'Compile and include all tests') + +option('test-unit', + type : 'boolean', + value : false, + description : 'Compile and include unit tests') + +option('test-integration', + type : 'boolean', + value : false, + description : 'Compile and include integration tests') option('tracing', type : 'feature', diff --git a/src/ipa/meson.build b/src/ipa/meson.build index ab4a1897..200fad8d 100644 --- a/src/ipa/meson.build +++ b/src/ipa/meson.build @@ -36,9 +36,9 @@ supported_ipas = { ipa_modules = get_option('ipas') -# Tests require the vimc IPA, similar to vimc pipline-handler for their -# execution. Include it automatically when tests are enabled. -if get_option('test') and 'vimc' not in ipa_modules +# Integration tests require the vimc IPA, similar to the vimc pipeline +# handler. Include it automatically when integration tests are enabled. +if test_integration_enabled and 'vimc' not in ipa_modules message('Enabling vimc IPA to support tests') ipa_modules += ['vimc'] endif diff --git a/test/camera/meson.build b/test/camera/meson.build index b92e16de..419915ef 100644 --- a/test/camera/meson.build +++ b/test/camera/meson.build @@ -1,5 +1,9 @@ # SPDX-License-Identifier: CC0-1.0 +if not test_integration_enabled + subdir_done() +endif + # Tests are listed in order of complexity. # They are not alphabetically sorted. camera_tests = [ diff --git a/test/controls/meson.build b/test/controls/meson.build index cab33717..745212df 100644 --- a/test/controls/meson.build +++ b/test/controls/meson.build @@ -8,6 +8,10 @@ control_tests = [ ] foreach test : control_tests + if test.get('suite', 'unit') not in test_suites + continue + endif + exe = executable(test['name'], test['sources'], dependencies : libcamera_public, link_with : test_libraries, diff --git a/test/gstreamer/meson.build b/test/gstreamer/meson.build index 249cf933..4fd7a530 100644 --- a/test/gstreamer/meson.build +++ b/test/gstreamer/meson.build @@ -1,5 +1,9 @@ # SPDX-License-Identifier: CC0-1.0 +if not test_integration_enabled + subdir_done() +endif + if not gst_enabled subdir_done() endif diff --git a/test/integration/meson.build b/test/integration/meson.build new file mode 100644 index 00000000..51e97101 --- /dev/null +++ b/test/integration/meson.build @@ -0,0 +1,3 @@ +# SPDX-License-Identifier: CC0-1.0 + +# Integration test subdirectories register tests in the 'integration' suite. diff --git a/test/ipa/libipa/meson.build b/test/ipa/libipa/meson.build index c3c542b6..d6f13323 100644 --- a/test/ipa/libipa/meson.build +++ b/test/ipa/libipa/meson.build @@ -1,5 +1,9 @@ # SPDX-License-Identifier: CC0-1.0 +if not test_unit_enabled + subdir_done() +endif + libipa_test = [ {'name': 'fixedpoint', 'sources': ['fixedpoint.cpp']}, {'name': 'histogram', 'sources': ['histogram.cpp']}, diff --git a/test/ipa/meson.build b/test/ipa/meson.build index 08067092..9faace7e 100644 --- a/test/ipa/meson.build +++ b/test/ipa/meson.build @@ -2,6 +2,10 @@ subdir('libipa') +if not test_integration_enabled + subdir_done() +endif + ipa_test = [ {'name': 'ipa_module_test', 'sources': ['ipa_module_test.cpp']}, {'name': 'ipa_interface_test', 'sources': ['ipa_interface_test.cpp']}, diff --git a/test/ipc/meson.build b/test/ipc/meson.build index 394a87c1..e7edd236 100644 --- a/test/ipc/meson.build +++ b/test/ipc/meson.build @@ -6,6 +6,10 @@ ipc_tests = [ ] foreach test : ipc_tests + if test.get('suite', 'unit') not in test_suites + continue + endif + exe = executable(test['name'], test['sources'], dependencies : libcamera_private, link_with : test_libraries, diff --git a/test/log/meson.build b/test/log/meson.build index 468e70db..44b25f25 100644 --- a/test/log/meson.build +++ b/test/log/meson.build @@ -1,5 +1,9 @@ # SPDX-License-Identifier: CC0-1.0 +if not test_unit_enabled + subdir_done() +endif + log_test = [ {'name': 'log_api', 'sources': ['log_api.cpp']}, {'name': 'log_process', 'sources': ['log_process.cpp']}, diff --git a/test/media_device/meson.build b/test/media_device/meson.build index 7a8a6520..a5873abc 100644 --- a/test/media_device/meson.build +++ b/test/media_device/meson.build @@ -1,5 +1,9 @@ # SPDX-License-Identifier: CC0-1.0 +if not test_integration_enabled + subdir_done() +endif + lib_mdev_test_sources = files([ 'media_device_test.cpp', ]) diff --git a/test/meson.build b/test/meson.build index 99ff5e84..79f4b1b7 100644 --- a/test/meson.build +++ b/test/meson.build @@ -1,11 +1,16 @@ # SPDX-License-Identifier: CC0-1.0 -if not get_option('test') - test_enabled = false - subdir_done() +test_suites = [] +if test_unit_enabled + test_suites += 'unit' +endif +if test_integration_enabled + test_suites += 'integration' endif -test_enabled = true +if test_suites.length() == 0 + subdir_done() +endif # When ASan is enabled, find the path to the ASan runtime needed by multiple # tests. This currently works with gcc only, as clang uses different file names @@ -25,6 +30,10 @@ endif subdir('libtest') +if test_integration_enabled + subdir('integration') +endif + subdir('camera') subdir('controls') subdir('gstreamer') @@ -86,6 +95,10 @@ internal_non_parallel_tests = [ ] foreach test : public_tests + if not test_unit_enabled + continue + endif + deps = [libcamera_public] if 'dependencies' in test deps += test['dependencies'] @@ -103,6 +116,10 @@ foreach test : public_tests endforeach foreach test : internal_tests + if test.get('suite', 'unit') not in test_suites + continue + endif + deps = [libcamera_private] if 'dependencies' in test deps += test['dependencies'] @@ -120,6 +137,10 @@ foreach test : internal_tests endforeach foreach test : internal_non_parallel_tests + if not test_integration_enabled + continue + endif + deps = [libcamera_private] if 'dependencies' in test deps += test['dependencies'] diff --git a/test/process/meson.build b/test/process/meson.build index d40b3e74..4e2cc982 100644 --- a/test/process/meson.build +++ b/test/process/meson.build @@ -1,5 +1,9 @@ # SPDX-License-Identifier: CC0-1.0 +if not test_unit_enabled + subdir_done() +endif + process_tests = [ {'name': 'process_test', 'sources': ['process_test.cpp']}, ] diff --git a/test/py/meson.build b/test/py/meson.build index c35209df..45194abd 100644 --- a/test/py/meson.build +++ b/test/py/meson.build @@ -1,5 +1,9 @@ # SPDX-License-Identifier: CC0-1.0 +if not test_integration_enabled + subdir_done() +endif + if not pycamera_enabled subdir_done() endif diff --git a/test/serialization/generated_serializer/meson.build b/test/serialization/generated_serializer/meson.build index 6595164c..b6271370 100644 --- a/test/serialization/generated_serializer/meson.build +++ b/test/serialization/generated_serializer/meson.build @@ -1,5 +1,9 @@ # SPDX-License-Identifier: CC0-1.0 +if not test_unit_enabled + subdir_done() +endif + subdir('include/libcamera/ipa') exe = executable('generated_serializer_test', diff --git a/test/serialization/meson.build b/test/serialization/meson.build index 77cfa8c3..d786b8da 100644 --- a/test/serialization/meson.build +++ b/test/serialization/meson.build @@ -2,6 +2,10 @@ subdir('generated_serializer') +if not test_integration_enabled + subdir_done() +endif + serialization_tests = [ {'name': 'control_serialization', 'sources': ['control_serialization.cpp']}, {'name': 'ipa_data_serializer_test', 'sources': ['ipa_data_serializer_test.cpp']}, diff --git a/test/software_isp/meson.build b/test/software_isp/meson.build index 539278ad..c49ab8ac 100644 --- a/test/software_isp/meson.build +++ b/test/software_isp/meson.build @@ -1,6 +1,6 @@ # SPDX-License-Identifier: CC0-1.0 -if not softisp_enabled +if not test_unit_enabled or not softisp_enabled subdir_done() endif diff --git a/test/stream/meson.build b/test/stream/meson.build index dc9468c7..c7cf7c5a 100644 --- a/test/stream/meson.build +++ b/test/stream/meson.build @@ -1,5 +1,9 @@ # SPDX-License-Identifier: CC0-1.0 +if not test_unit_enabled + subdir_done() +endif + stream_tests = [ {'name': 'stream_colorspace', 'sources': ['stream_colorspace.cpp']}, {'name': 'stream_formats', 'sources': ['stream_formats.cpp']}, diff --git a/test/v4l2_compat/meson.build b/test/v4l2_compat/meson.build index 01045a83..38be3971 100644 --- a/test/v4l2_compat/meson.build +++ b/test/v4l2_compat/meson.build @@ -1,5 +1,9 @@ # SPDX-License-Identifier: CC0-1.0 +if not test_integration_enabled + subdir_done() +endif + if not is_variable('v4l2_compat') subdir_done() endif diff --git a/test/v4l2_subdevice/meson.build b/test/v4l2_subdevice/meson.build index 68255717..59f4e5ec 100644 --- a/test/v4l2_subdevice/meson.build +++ b/test/v4l2_subdevice/meson.build @@ -1,5 +1,9 @@ # SPDX-License-Identifier: CC0-1.0 +if not test_integration_enabled + subdir_done() +endif + v4l2_subdevice_tests = [ {'name': 'list_formats', 'sources': ['list_formats.cpp']}, {'name': 'test_formats', 'sources': ['test_formats.cpp']}, diff --git a/test/v4l2_videodevice/meson.build b/test/v4l2_videodevice/meson.build index 486e831c..3be95651 100644 --- a/test/v4l2_videodevice/meson.build +++ b/test/v4l2_videodevice/meson.build @@ -1,5 +1,9 @@ # SPDX-License-Identifier: CC0-1.0 +if not test_integration_enabled + subdir_done() +endif + # Tests are listed in order of complexity. # They are not alphabetically sorted. v4l2_videodevice_tests = [