From patchwork Fri Dec 21 08:13:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 67 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 7EDAE60B0C for ; Fri, 21 Dec 2018 09:13:20 +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 08ADE565; Fri, 21 Dec 2018 09:13:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1545380000; bh=Ov6XvFZsnF/Fl+M4+x3oKRBCmE7J93rUz5NSM4nQDMo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=i9K5IpP1LYAUzBgEF8GmOrs4Y2TiX4oN4IJfOvVzoKjWngxzXxKX/N85i+05reKia pHVn71KSdIe/VbgcvkF5fQ+AcpVfynX+R6NH5S7VWVP4jFXTraZj22Mla2Wdlx3bzI lm21UasOcw7ARL4pv2ysb2mAXw011dM+94jbJfDI= From: Kieran Bingham To: LibCamera Devel Date: Fri, 21 Dec 2018 08:13:07 +0000 Message-Id: <20181221081311.3291-2-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181221081311.3291-1-kieran.bingham@ideasonboard.com> References: <20181221081311.3291-1-kieran.bingham@ideasonboard.com> Subject: [libcamera-devel] [PATCH 1/5] test: Move test objects to libtest 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: Fri, 21 Dec 2018 08:13:20 -0000 Create a subdirectory to contain the libtest helper library. Define two variables to clarify when tests are aimed at public or internal components. Signed-off-by: Kieran Bingham Reviewed-by: Laurent Pinchart --- test/libtest/meson.build | 7 +++++++ test/{ => libtest}/test.cpp | 0 test/{ => libtest}/test.h | 0 test/meson.build | 20 ++++++++++++++------ 4 files changed, 21 insertions(+), 6 deletions(-) create mode 100644 test/libtest/meson.build rename test/{ => libtest}/test.cpp (100%) rename test/{ => libtest}/test.h (100%) diff --git a/test/libtest/meson.build b/test/libtest/meson.build new file mode 100644 index 000000000000..b998154dd8d3 --- /dev/null +++ b/test/libtest/meson.build @@ -0,0 +1,7 @@ +libtest_sources = files([ + 'test.cpp', +]) + +libtest = static_library('libtest', libtest_sources) + +libtest_includes = include_directories('.') diff --git a/test/test.cpp b/test/libtest/test.cpp similarity index 100% rename from test/test.cpp rename to test/libtest/test.cpp diff --git a/test/test.h b/test/libtest/test.h similarity index 100% rename from test/test.h rename to test/libtest/test.h diff --git a/test/meson.build b/test/meson.build index da0aea9678d1..50ec11853203 100644 --- a/test/meson.build +++ b/test/meson.build @@ -1,11 +1,19 @@ -libtest_sources = files([ - 'test.cpp', -]) +subdir('libtest') -libtest = static_library('libtest', libtest_sources) +test_libraries = [libcamera, libtest] + +test_includes_public = [ + libtest_includes, + libcamera_includes, +] + +test_includes_internal = [ + test_includes_public, + libcamera_internal_includes, +] test_init = executable('test_init', 'init.cpp', - link_with : libcamera, - include_directories : libcamera_includes) + link_with : test_libraries, + include_directories : test_includes_public) test('Initialisation test', test_init) From patchwork Fri Dec 21 08:13:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 68 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id CAB2B60B0C for ; Fri, 21 Dec 2018 09:13:20 +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 58592597; Fri, 21 Dec 2018 09:13:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1545380000; bh=+8sUYWs5XjZmV3mytIVj4iybD/oJqYPThrrKXKgajro=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dxRziXI6ODvcCyi/NQRLO+e+S5qH7sFfg+jOlA0pxoXcmoGgX0heqqKVTZ26I8NO9 SCLziYDHT9UgVwvXc5zdZ32tqSbxfMvq7PyTI6E+y8IDIr+IhqlsWUuzUBQsINq5qQ SnoPQT1MRV6D0TFDKMHMZUyTHv6zI0OwG1j3vU44= From: Kieran Bingham To: LibCamera Devel Date: Fri, 21 Dec 2018 08:13:08 +0000 Message-Id: <20181221081311.3291-3-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181221081311.3291-1-kieran.bingham@ideasonboard.com> References: <20181221081311.3291-1-kieran.bingham@ideasonboard.com> Subject: [libcamera-devel] [PATCH 2/5] test: libtest: Add test return codes 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: Fri, 21 Dec 2018 08:13:21 -0000 The meson test infrastructure uses return codes to determine test results. Define these values for use in tests. Signed-off-by: Kieran Bingham Reviewed-by: Laurent Pinchart --- test/libtest/test.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/libtest/test.h b/test/libtest/test.h index c85eeb5d9744..18b430f428c7 100644 --- a/test/libtest/test.h +++ b/test/libtest/test.h @@ -9,6 +9,10 @@ #include +#define TEST_PASS 0 +#define TEST_FAIL -1 +#define TEST_SKIP 77 + class Test { public: From patchwork Fri Dec 21 08:13:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 69 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 2497560B0C for ; Fri, 21 Dec 2018 09:13:21 +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 B11C059D; Fri, 21 Dec 2018 09:13:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1545380000; bh=BFM1NP2krs11zA02ifV8CXfvRZDRo5Sx3781VKuO7rk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jxCsAmPbjdE7Bo+CMVcXtTXMDliwNO4mQuDeYBwncwmRqKRkRml8+CW1cN0/kCk5f 0EliQxXj0BwDB5VqQ81Yn928SOVePmNbpAubKuABi8LN+aLKr36DJsEd22gztI2CLB +pHwxE8fj0ywWyg6BwuBWlQjPbBona3WshAndMlQ= From: Kieran Bingham To: LibCamera Devel Date: Fri, 21 Dec 2018 08:13:09 +0000 Message-Id: <20181221081311.3291-4-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181221081311.3291-1-kieran.bingham@ideasonboard.com> References: <20181221081311.3291-1-kieran.bingham@ideasonboard.com> Subject: [libcamera-devel] [PATCH 3/5] test: libtest: Return all non-zero init values 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: Fri, 21 Dec 2018 08:13:21 -0000 A skipped test is currently defined as returning 77. If this is returned by the init stage, currently the execute call will continue on to the run stage. Correct this such that any non-zero return code from the init phase will abort the test. Signed-off-by: Kieran Bingham --- test/libtest/test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/libtest/test.cpp b/test/libtest/test.cpp index 1bb6ebcb9e8a..9d537ea08698 100644 --- a/test/libtest/test.cpp +++ b/test/libtest/test.cpp @@ -20,7 +20,7 @@ int Test::execute() int ret; ret = init(); - if (ret < 0) + if (ret) return ret; ret = run(); From patchwork Fri Dec 21 08:13:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 70 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 77B1A60B0C for ; Fri, 21 Dec 2018 09:13:21 +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 0DC995A1; Fri, 21 Dec 2018 09:13:21 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1545380001; bh=pC0KEpu7Jy+EEnJcaL+Ctuxe97bT/luA0nxkcZpVL3s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nhKH/blv4wHwNKOsyIH2yU53Uuq1vxlqC8QAV6yUwtByMsZaV2MtinRpxyt/ACiMU /n4QWvnrm0qva4kfHVmi4s0z5M3BC4xj/SUc6DR7yGQSLZbUZAfgavUYeGX8F8/wDP czNK73ReiOWXRb6rDIQpa0BjU5jcB1FGnplb7hCA= From: Kieran Bingham To: LibCamera Devel Date: Fri, 21 Dec 2018 08:13:10 +0000 Message-Id: <20181221081311.3291-5-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181221081311.3291-1-kieran.bingham@ideasonboard.com> References: <20181221081311.3291-1-kieran.bingham@ideasonboard.com> Subject: [libcamera-devel] [PATCH 4/5] utils: checkstyle: add keep-one-line-blocks 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: Fri, 21 Dec 2018 08:13:21 -0000 Enable --keep-one-line-blocks to prevent astyle from wanting to move single inlined blocks to cover 4 lines such as: - virtual int init() { return 0; } + virtual int init() + { + return 0; + } Signed-off-by: Kieran Bingham Reviewed-by: Jacopo Mondi --- utils/checkstyle.py | 1 + 1 file changed, 1 insertion(+) diff --git a/utils/checkstyle.py b/utils/checkstyle.py index 32974815048a..a40d7dec879f 100755 --- a/utils/checkstyle.py +++ b/utils/checkstyle.py @@ -29,6 +29,7 @@ astyle_options = ( '--pad-oper', '--align-pointer=name', '--align-reference=name', + '--keep-one-line-blocks', '--max-code-length=120' ) From patchwork Fri Dec 21 08:13:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 71 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id C5AFB60B0C for ; Fri, 21 Dec 2018 09:13:21 +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 60277558; Fri, 21 Dec 2018 09:13:21 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1545380001; bh=5OgIhSKjDNYNyMZ+Z5H7jZf3DTE1K42Ixvd2lIa/R1g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kptMkLJxFkSxtCGuB+ts29ItHi6TTTcScwJa+9sR7kmNho2+oXk4hHCvImItDrIGv /6UrBQElZx4FEAeR65bejfNj8B3tGDG5JV/e7cAJs697hiequ/yZibxRNGI2zS/ILV NO5nloy50l3tg/hgPQA7tejmPi+cpBlD+DIA9vgU= From: Kieran Bingham To: LibCamera Devel Date: Fri, 21 Dec 2018 08:13:11 +0000 Message-Id: <20181221081311.3291-6-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181221081311.3291-1-kieran.bingham@ideasonboard.com> References: <20181221081311.3291-1-kieran.bingham@ideasonboard.com> Subject: [libcamera-devel] [PATCH 5/5] meson: Shorten project description 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: Fri, 21 Dec 2018 08:13:22 -0000 The project description is really the project name. The extraneosly long string gets printed at the test runner prefixed to the suite. As such it should really be the shortened simple project name. Remove the 'description' from the project naming field. Signed-off-by: Kieran Bingham Reviewed-by: Laurent Pinchart --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 7b6e2fec8461..0ab0da981083 100644 --- a/meson.build +++ b/meson.build @@ -1,4 +1,4 @@ -project('libcamera - supporting complex camera pipelines', 'c', 'cpp', +project('libcamera', 'c', 'cpp', meson_version: '>= 0.40', version : '0.1', license : 'LGPL 2.1+')