From patchwork Tue Jan 1 21:29:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 123 Return-Path: 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 5A46860B31 for ; Tue, 1 Jan 2019 22:29:52 +0100 (CET) Received: from localhost.localdomain (cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id E13A71173; Tue, 1 Jan 2019 22:29:51 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1546378192; bh=0PPjrVLrCoWuaTfUf6rg+LJHhko/rKtmyGUDjcCWOuo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Lhe2RfVDGpXlOrADadKSfbkOasa7Wcdi6c3uZfUkiw+iqX4XQlKlCgR90hFbtw+aS 5brhHX1T9/qJK7MLAspqO51cnuHirEEsXiiaNgNC5WM5jWbf4nzRrS/aH+GLs/Aehn xHba9z2ZHA27kRwPoDKrO4E3fXwWnTuiwP52XHCA= From: Kieran Bingham To: LibCamera Devel Date: Tue, 1 Jan 2019 21:29:44 +0000 Message-Id: <20190101212947.28098-3-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190101212947.28098-1-kieran.bingham@ideasonboard.com> References: <20190101212947.28098-1-kieran.bingham@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 2/5] test: Use foreach iterators to simplify definitions X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jan 2019 21:29:52 -0000 Create two arrays, to contain public and internal test targets, and use the foreach iterators to automatically generate test output targets for each entry in each array. The public tests array is linked only against public libcamera headers, while tests declared in the internal_tests will have access to non-public API headers from within the libcamera sources. Reviewed-by: Niklas Söderlund Reviewed-by: Laurent Pinchart Signed-off-by: Kieran Bingham --- test/meson.build | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/test/meson.build b/test/meson.build index 3b7591ad9204..bf8232f32787 100644 --- a/test/meson.build +++ b/test/meson.build @@ -12,15 +12,28 @@ test_includes_internal = [ libcamera_internal_includes, ] -test_init = executable('test_init', 'init.cpp', - link_with : test_libraries, - include_directories : test_includes_public) +subdir('media_device') -list = executable('list', 'list.cpp', - link_with : test_libraries, - include_directories : test_includes_public) +public_tests = [ + ['test_init', 'init.cpp'], + ['list', 'list.cpp'], +] -subdir('media_device') +internal_tests = [ +] + +foreach t : public_tests + exe = executable(t[0], t[1], + link_with : test_libraries, + include_directories : test_includes_public) + + test(t[0], exe) +endforeach + +foreach t : internal_tests + exe = executable(t[0], t[1], + link_with : test_libraries, + include_directories : test_includes_internal) -test('Initialisation test', test_init) -test('List Camera API tests', list) + test(t[0], exe) +endforeach