[{"id":1566,"web_url":"https://patchwork.libcamera.org/comment/1566/","msgid":"<9590457a-30dd-501a-b3de-42afa2a43798@ideasonboard.com>","date":"2019-05-09T09:29:11","subject":"Re: [libcamera-devel] [PATCH 3/5] test: v4l2_device: Allow each\n\ttest to specify which device and entity to test","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Hi Niklas,\n\nI like the flexibility this gives.\n\nAcked-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\nOn 08/05/2019 17:58, Niklas Söderlund wrote:\n> Prepare for different tests which implements V4L2DeviceTest to specify\n> which media device and entity they wish to test. There is no functional\n> changes, all tests still use vivid to perform there tests.\n> \n> Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n> ---\n>  test/v4l2_device/buffer_sharing.cpp   | 5 ++---\n>  test/v4l2_device/capture_async.cpp    | 2 +-\n>  test/v4l2_device/double_open.cpp      | 3 +++\n>  test/v4l2_device/formats.cpp          | 3 +++\n>  test/v4l2_device/request_buffers.cpp  | 4 ++++\n>  test/v4l2_device/stream_on_off.cpp    | 3 +++\n>  test/v4l2_device/v4l2_device_test.cpp | 6 +++---\n>  test/v4l2_device/v4l2_device_test.h   | 6 ++++--\n>  8 files changed, 23 insertions(+), 9 deletions(-)\n> \n> diff --git a/test/v4l2_device/buffer_sharing.cpp b/test/v4l2_device/buffer_sharing.cpp\n> index 09695239ee4b9e80..e63ddff856894130 100644\n> --- a/test/v4l2_device/buffer_sharing.cpp\n> +++ b/test/v4l2_device/buffer_sharing.cpp\n> @@ -23,9 +23,8 @@ class BufferSharingTest : public V4L2DeviceTest\n>  {\n>  public:\n>  \tBufferSharingTest()\n> -\t\t: output_(nullptr), framesCaptured_(0), framesOutput_(0)\n> -\t{\n> -\t}\n> +\t\t: V4L2DeviceTest(\"vivid\", \"vivid-000-vid-cap\"),\n> +\t\t  output_(nullptr), framesCaptured_(0), framesOutput_(0) {}\n>  \n>  protected:\n>  \tint init()\n> diff --git a/test/v4l2_device/capture_async.cpp b/test/v4l2_device/capture_async.cpp\n> index 2a41b11e95e77dac..fd428ff909f32999 100644\n> --- a/test/v4l2_device/capture_async.cpp\n> +++ b/test/v4l2_device/capture_async.cpp\n> @@ -18,7 +18,7 @@ class CaptureAsyncTest : public V4L2DeviceTest\n>  {\n>  public:\n>  \tCaptureAsyncTest()\n> -\t\t: frames(0){};\n> +\t\t: V4L2DeviceTest(\"vivid\", \"vivid-000-vid-cap\"), frames(0) {}\n>  \n>  \tvoid receiveBuffer(Buffer *buffer)\n>  \t{\n> diff --git a/test/v4l2_device/double_open.cpp b/test/v4l2_device/double_open.cpp\n> index 7ec80a60f57ee036..b402de04fca5ddbb 100644\n> --- a/test/v4l2_device/double_open.cpp\n> +++ b/test/v4l2_device/double_open.cpp\n> @@ -13,6 +13,9 @@ namespace {\n>  \n>  class DoubleOpen : public V4L2DeviceTest\n>  {\n> +public:\n> +\tDoubleOpen()\n> +\t\t: V4L2DeviceTest(\"vivid\", \"vivid-000-vid-cap\") {}\n>  protected:\n>  \tint run()\n>  \t{\n> diff --git a/test/v4l2_device/formats.cpp b/test/v4l2_device/formats.cpp\n> index 72676c9d334a69b0..3ac47f5cc665b62b 100644\n> --- a/test/v4l2_device/formats.cpp\n> +++ b/test/v4l2_device/formats.cpp\n> @@ -17,6 +17,9 @@ using namespace libcamera;\n>  \n>  class Format : public V4L2DeviceTest\n>  {\n> +public:\n> +\tFormat()\n> +\t\t: V4L2DeviceTest(\"vivid\", \"vivid-000-vid-cap\") {}\n>  protected:\n>  \tint run()\n>  \t{\n> diff --git a/test/v4l2_device/request_buffers.cpp b/test/v4l2_device/request_buffers.cpp\n> index 938d4f85d5a1e711..794b083eb84d8d2e 100644\n> --- a/test/v4l2_device/request_buffers.cpp\n> +++ b/test/v4l2_device/request_buffers.cpp\n> @@ -9,6 +9,10 @@\n>  \n>  class RequestBuffersTest : public V4L2DeviceTest\n>  {\n> +public:\n> +\tRequestBuffersTest()\n> +\t\t: V4L2DeviceTest(\"vivid\", \"vivid-000-vid-cap\") {}\n> +\n>  protected:\n>  \tint run()\n>  \t{\n> diff --git a/test/v4l2_device/stream_on_off.cpp b/test/v4l2_device/stream_on_off.cpp\n> index ea1b3f5bd5a4cbea..4902d5fd6d58a73d 100644\n> --- a/test/v4l2_device/stream_on_off.cpp\n> +++ b/test/v4l2_device/stream_on_off.cpp\n> @@ -9,6 +9,9 @@\n>  \n>  class StreamOnStreamOffTest : public V4L2DeviceTest\n>  {\n> +public:\n> +\tStreamOnStreamOffTest()\n> +\t\t: V4L2DeviceTest(\"vivid\", \"vivid-000-vid-cap\") {}\n>  protected:\n>  \tint run()\n>  \t{\n> diff --git a/test/v4l2_device/v4l2_device_test.cpp b/test/v4l2_device/v4l2_device_test.cpp\n> index 833038d56ea4631d..ee5a8e009bef2a5e 100644\n> --- a/test/v4l2_device/v4l2_device_test.cpp\n> +++ b/test/v4l2_device/v4l2_device_test.cpp\n> @@ -39,14 +39,14 @@ int V4L2DeviceTest::init()\n>  \t\treturn TestFail;\n>  \t}\n>  \n> -\tDeviceMatch dm(\"vivid\");\n> -\tdm.add(\"vivid-000-vid-cap\");\n> +\tDeviceMatch dm(driver_);\n> +\tdm.add(entity_);\n>  \n>  \tmedia_ = enumerator_->search(dm);\n>  \tif (!media_)\n>  \t\treturn TestSkip;\n>  \n> -\tMediaEntity *entity = media_->getEntityByName(\"vivid-000-vid-cap\");\n> +\tMediaEntity *entity = media_->getEntityByName(entity_);\n>  \tif (!entity)\n>  \t\treturn TestSkip;\n>  \n> diff --git a/test/v4l2_device/v4l2_device_test.h b/test/v4l2_device/v4l2_device_test.h\n> index c476d3c05e79747a..651c005f4e5485e6 100644\n> --- a/test/v4l2_device/v4l2_device_test.h\n> +++ b/test/v4l2_device/v4l2_device_test.h\n> @@ -22,8 +22,8 @@ using namespace libcamera;\n>  class V4L2DeviceTest : public Test\n>  {\n>  public:\n> -\tV4L2DeviceTest()\n> -\t\t: capture_(nullptr)\n> +\tV4L2DeviceTest(const char *driver, const char *entity)\n> +\t\t: driver_(driver), entity_(entity), capture_(nullptr)\n>  \t{\n>  \t}\n>  \n> @@ -31,6 +31,8 @@ protected:\n>  \tint init();\n>  \tvoid cleanup();\n>  \n> +\tstd::string driver_;\n> +\tstd::string entity_;\n>  \tstd::unique_ptr<DeviceEnumerator> enumerator_;\n>  \tstd::shared_ptr<MediaDevice> media_;\n>  \tV4L2Device *capture_;\n>","headers":{"Return-Path":"<kieran.bingham@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 8417960E50\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  9 May 2019 11:29:14 +0200 (CEST)","from [192.168.0.20]\n\t(cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id D7A4B529;\n\tThu,  9 May 2019 11:29:13 +0200 (CEST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1557394154;\n\tbh=tVVjXH132+2HOrkpuL4woQSfNR2R0neJXCBsT87wUjk=;\n\th=Reply-To:Subject:To:References:From:Date:In-Reply-To:From;\n\tb=IOkmepsLVCoo5brLMyrLoCQzOODMcXjgJMoJodPLZYNORzWJ0Q4Xpa0Qd9hZ4i1hg\n\tnp6yRsdKUIY9h+ZR410h1bERc5QxKeiK0GgQwpTfYdxRi3j/DrlReKZfpUKtjMKoAE\n\teWX0lxGaWtzxe3R27EJPo/f5alqMCE4UyBY6xnRg=","Reply-To":"kieran.bingham@ideasonboard.com","To":"=?utf-8?q?Niklas_S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20190508165814.26201-1-niklas.soderlund@ragnatech.se>\n\t<20190508165814.26201-4-niklas.soderlund@ragnatech.se>","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Openpgp":"preference=signencrypt","Autocrypt":"addr=kieran.bingham@ideasonboard.com; keydata=\n\tmQINBFYE/WYBEACs1PwjMD9rgCu1hlIiUA1AXR4rv2v+BCLUq//vrX5S5bjzxKAryRf0uHat\n\tV/zwz6hiDrZuHUACDB7X8OaQcwhLaVlq6byfoBr25+hbZG7G3+5EUl9cQ7dQEdvNj6V6y/SC\n\trRanWfelwQThCHckbobWiQJfK9n7rYNcPMq9B8e9F020LFH7Kj6YmO95ewJGgLm+idg1Kb3C\n\tpotzWkXc1xmPzcQ1fvQMOfMwdS+4SNw4rY9f07Xb2K99rjMwZVDgESKIzhsDB5GY465sCsiQ\n\tcSAZRxqE49RTBq2+EQsbrQpIc8XiffAB8qexh5/QPzCmR4kJgCGeHIXBtgRj+nIkCJPZvZtf\n\tKr2EAbc6tgg6DkAEHJb+1okosV09+0+TXywYvtEop/WUOWQ+zo+Y/OBd+8Ptgt1pDRyOBzL8\n\tRXa8ZqRf0Mwg75D+dKntZeJHzPRJyrlfQokngAAs4PaFt6UfS+ypMAF37T6CeDArQC41V3ko\n\tlPn1yMsVD0p+6i3DPvA/GPIksDC4owjnzVX9kM8Zc5Cx+XoAN0w5Eqo4t6qEVbuettxx55gq\n\t8K8FieAjgjMSxngo/HST8TpFeqI5nVeq0/lqtBRQKumuIqDg+Bkr4L1V/PSB6XgQcOdhtd36\n\tOe9X9dXB8YSNt7VjOcO7BTmFn/Z8r92mSAfHXpb07YJWJosQOQARAQABtDBLaWVyYW4gQmlu\n\tZ2hhbSA8a2llcmFuLmJpbmdoYW1AaWRlYXNvbmJvYXJkLmNvbT6JAkAEEwEKACoCGwMFCwkI\n\tBwIGFQgJCgsCBBYCAwECHgECF4ACGQEFAlnDk/gFCQeA/YsACgkQoR5GchCkYf3X5w/9EaZ7\n\tcnUcT6dxjxrcmmMnfFPoQA1iQXr/MXQJBjFWfxRUWYzjv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/fV91Zh63S5TKnf2YGGGzxki+ADdxVQAm+Q\n\tsbsRB8KNNvVXBOVNwko86rQqF9drZuw=","Organization":"Ideas on Board","Message-ID":"<9590457a-30dd-501a-b3de-42afa2a43798@ideasonboard.com>","Date":"Thu, 9 May 2019 10:29:11 +0100","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101\n\tThunderbird/60.6.1","MIME-Version":"1.0","In-Reply-To":"<20190508165814.26201-4-niklas.soderlund@ragnatech.se>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-GB","Content-Transfer-Encoding":"8bit","Subject":"Re: [libcamera-devel] [PATCH 3/5] test: v4l2_device: Allow each\n\ttest to specify which device and entity to test","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","X-List-Received-Date":"Thu, 09 May 2019 09:29:14 -0000"}},{"id":1572,"web_url":"https://patchwork.libcamera.org/comment/1572/","msgid":"<20190511024033.GE12768@pendragon.ideasonboard.com>","date":"2019-05-11T02:40:33","subject":"Re: [libcamera-devel] [PATCH 3/5] test: v4l2_device: Allow each\n\ttest to specify which device and entity to test","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Niklas,\n\nThank you for the patch.\n\nOn Wed, May 08, 2019 at 06:58:12PM +0200, Niklas Söderlund wrote:\n> Prepare for different tests which implements V4L2DeviceTest to specify\n> which media device and entity they wish to test. There is no functional\n> changes, all tests still use vivid to perform there tests.\n> \n> Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n\nI wonder if it would be a good idea to offer a choice of preselected\ndevices instead of offering full flexibility, but we can implement that\nlater if it becomes necessary.\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> ---\n>  test/v4l2_device/buffer_sharing.cpp   | 5 ++---\n>  test/v4l2_device/capture_async.cpp    | 2 +-\n>  test/v4l2_device/double_open.cpp      | 3 +++\n>  test/v4l2_device/formats.cpp          | 3 +++\n>  test/v4l2_device/request_buffers.cpp  | 4 ++++\n>  test/v4l2_device/stream_on_off.cpp    | 3 +++\n>  test/v4l2_device/v4l2_device_test.cpp | 6 +++---\n>  test/v4l2_device/v4l2_device_test.h   | 6 ++++--\n>  8 files changed, 23 insertions(+), 9 deletions(-)\n> \n> diff --git a/test/v4l2_device/buffer_sharing.cpp b/test/v4l2_device/buffer_sharing.cpp\n> index 09695239ee4b9e80..e63ddff856894130 100644\n> --- a/test/v4l2_device/buffer_sharing.cpp\n> +++ b/test/v4l2_device/buffer_sharing.cpp\n> @@ -23,9 +23,8 @@ class BufferSharingTest : public V4L2DeviceTest\n>  {\n>  public:\n>  \tBufferSharingTest()\n> -\t\t: output_(nullptr), framesCaptured_(0), framesOutput_(0)\n> -\t{\n> -\t}\n> +\t\t: V4L2DeviceTest(\"vivid\", \"vivid-000-vid-cap\"),\n> +\t\t  output_(nullptr), framesCaptured_(0), framesOutput_(0) {}\n>  \n>  protected:\n>  \tint init()\n> diff --git a/test/v4l2_device/capture_async.cpp b/test/v4l2_device/capture_async.cpp\n> index 2a41b11e95e77dac..fd428ff909f32999 100644\n> --- a/test/v4l2_device/capture_async.cpp\n> +++ b/test/v4l2_device/capture_async.cpp\n> @@ -18,7 +18,7 @@ class CaptureAsyncTest : public V4L2DeviceTest\n>  {\n>  public:\n>  \tCaptureAsyncTest()\n> -\t\t: frames(0){};\n> +\t\t: V4L2DeviceTest(\"vivid\", \"vivid-000-vid-cap\"), frames(0) {}\n>  \n>  \tvoid receiveBuffer(Buffer *buffer)\n>  \t{\n> diff --git a/test/v4l2_device/double_open.cpp b/test/v4l2_device/double_open.cpp\n> index 7ec80a60f57ee036..b402de04fca5ddbb 100644\n> --- a/test/v4l2_device/double_open.cpp\n> +++ b/test/v4l2_device/double_open.cpp\n> @@ -13,6 +13,9 @@ namespace {\n>  \n>  class DoubleOpen : public V4L2DeviceTest\n>  {\n> +public:\n> +\tDoubleOpen()\n> +\t\t: V4L2DeviceTest(\"vivid\", \"vivid-000-vid-cap\") {}\n>  protected:\n>  \tint run()\n>  \t{\n> diff --git a/test/v4l2_device/formats.cpp b/test/v4l2_device/formats.cpp\n> index 72676c9d334a69b0..3ac47f5cc665b62b 100644\n> --- a/test/v4l2_device/formats.cpp\n> +++ b/test/v4l2_device/formats.cpp\n> @@ -17,6 +17,9 @@ using namespace libcamera;\n>  \n>  class Format : public V4L2DeviceTest\n>  {\n> +public:\n> +\tFormat()\n> +\t\t: V4L2DeviceTest(\"vivid\", \"vivid-000-vid-cap\") {}\n>  protected:\n>  \tint run()\n>  \t{\n> diff --git a/test/v4l2_device/request_buffers.cpp b/test/v4l2_device/request_buffers.cpp\n> index 938d4f85d5a1e711..794b083eb84d8d2e 100644\n> --- a/test/v4l2_device/request_buffers.cpp\n> +++ b/test/v4l2_device/request_buffers.cpp\n> @@ -9,6 +9,10 @@\n>  \n>  class RequestBuffersTest : public V4L2DeviceTest\n>  {\n> +public:\n> +\tRequestBuffersTest()\n> +\t\t: V4L2DeviceTest(\"vivid\", \"vivid-000-vid-cap\") {}\n> +\n>  protected:\n>  \tint run()\n>  \t{\n> diff --git a/test/v4l2_device/stream_on_off.cpp b/test/v4l2_device/stream_on_off.cpp\n> index ea1b3f5bd5a4cbea..4902d5fd6d58a73d 100644\n> --- a/test/v4l2_device/stream_on_off.cpp\n> +++ b/test/v4l2_device/stream_on_off.cpp\n> @@ -9,6 +9,9 @@\n>  \n>  class StreamOnStreamOffTest : public V4L2DeviceTest\n>  {\n> +public:\n> +\tStreamOnStreamOffTest()\n> +\t\t: V4L2DeviceTest(\"vivid\", \"vivid-000-vid-cap\") {}\n>  protected:\n>  \tint run()\n>  \t{\n> diff --git a/test/v4l2_device/v4l2_device_test.cpp b/test/v4l2_device/v4l2_device_test.cpp\n> index 833038d56ea4631d..ee5a8e009bef2a5e 100644\n> --- a/test/v4l2_device/v4l2_device_test.cpp\n> +++ b/test/v4l2_device/v4l2_device_test.cpp\n> @@ -39,14 +39,14 @@ int V4L2DeviceTest::init()\n>  \t\treturn TestFail;\n>  \t}\n>  \n> -\tDeviceMatch dm(\"vivid\");\n> -\tdm.add(\"vivid-000-vid-cap\");\n> +\tDeviceMatch dm(driver_);\n> +\tdm.add(entity_);\n>  \n>  \tmedia_ = enumerator_->search(dm);\n>  \tif (!media_)\n>  \t\treturn TestSkip;\n>  \n> -\tMediaEntity *entity = media_->getEntityByName(\"vivid-000-vid-cap\");\n> +\tMediaEntity *entity = media_->getEntityByName(entity_);\n>  \tif (!entity)\n>  \t\treturn TestSkip;\n>  \n> diff --git a/test/v4l2_device/v4l2_device_test.h b/test/v4l2_device/v4l2_device_test.h\n> index c476d3c05e79747a..651c005f4e5485e6 100644\n> --- a/test/v4l2_device/v4l2_device_test.h\n> +++ b/test/v4l2_device/v4l2_device_test.h\n> @@ -22,8 +22,8 @@ using namespace libcamera;\n>  class V4L2DeviceTest : public Test\n>  {\n>  public:\n> -\tV4L2DeviceTest()\n> -\t\t: capture_(nullptr)\n> +\tV4L2DeviceTest(const char *driver, const char *entity)\n> +\t\t: driver_(driver), entity_(entity), capture_(nullptr)\n>  \t{\n>  \t}\n>  \n> @@ -31,6 +31,8 @@ protected:\n>  \tint init();\n>  \tvoid cleanup();\n>  \n> +\tstd::string driver_;\n> +\tstd::string entity_;\n>  \tstd::unique_ptr<DeviceEnumerator> enumerator_;\n>  \tstd::shared_ptr<MediaDevice> media_;\n>  \tV4L2Device *capture_;\n> -- \n> 2.21.0\n> \n> _______________________________________________\n> libcamera-devel mailing list\n> libcamera-devel@lists.libcamera.org\n> https://lists.libcamera.org/listinfo/libcamera-devel","headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C7BD360E4D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 11 May 2019 04:40:49 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(dfj612yhrgyx302h3jwwy-3.rev.dnainternet.fi\n\t[IPv6:2001:14ba:21f5:5b00:ce28:277f:58d7:3ca4])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 469C72DF;\n\tSat, 11 May 2019 04:40:49 +0200 (CEST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1557542449;\n\tbh=ybDlimwoCwbeZocoSbjodkT12TdSiEbbyc1RTICxiw4=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=G/a6KwYZ3jPl9oh4q3K2XCEoSA+9qDnTF7OjKHDZF9WCuqL+cadhCfzbkE6cOz3Id\n\tJUSMdpUI8vgV775K/pjq6lFPuCf3ry8VVZcrp9G7/GpAT8sB4mlbjAxoUfmLSu50Ff\n\tI5+uruljbXFqwPcuKvRvCm56YNVUyUkc8Mk4lM9U=","Date":"Sat, 11 May 2019 05:40:33 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Niklas =?utf-8?q?S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20190511024033.GE12768@pendragon.ideasonboard.com>","References":"<20190508165814.26201-1-niklas.soderlund@ragnatech.se>\n\t<20190508165814.26201-4-niklas.soderlund@ragnatech.se>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20190508165814.26201-4-niklas.soderlund@ragnatech.se>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH 3/5] test: v4l2_device: Allow each\n\ttest to specify which device and entity to test","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","X-List-Received-Date":"Sat, 11 May 2019 02:40:50 -0000"}},{"id":1579,"web_url":"https://patchwork.libcamera.org/comment/1579/","msgid":"<20190511095337.GI28561@bigcity.dyn.berto.se>","date":"2019-05-11T09:53:37","subject":"Re: [libcamera-devel] [PATCH 3/5] test: v4l2_device: Allow each\n\ttest to specify which device and entity to test","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/people/5/","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"content":"Hi Laurent,\n\nThanks for your feedback.\n\nOn 2019-05-11 05:40:33 +0300, Laurent Pinchart wrote:\n> Hi Niklas,\n> \n> Thank you for the patch.\n> \n> On Wed, May 08, 2019 at 06:58:12PM +0200, Niklas Söderlund wrote:\n> > Prepare for different tests which implements V4L2DeviceTest to specify\n> > which media device and entity they wish to test. There is no functional\n> > changes, all tests still use vivid to perform there tests.\n> > \n> > Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n> \n> I wonder if it would be a good idea to offer a choice of preselected\n> devices instead of offering full flexibility, but we can implement that\n> later if it becomes necessary.\n\nI wonder something similar when working on this. My line of thought was \nto split the v4l2_device in a vimc and a vivid group and provide two \nbase classes.\n\nThen I realised we only have one test which requires vivid and thought \nsuch a split was overkill. I agree as we gain more tests we should \nprobably create a bit stricter base class which could provide helpers to \ninteract which each of the two pipelines.\n\n> \n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> \n> > ---\n> >  test/v4l2_device/buffer_sharing.cpp   | 5 ++---\n> >  test/v4l2_device/capture_async.cpp    | 2 +-\n> >  test/v4l2_device/double_open.cpp      | 3 +++\n> >  test/v4l2_device/formats.cpp          | 3 +++\n> >  test/v4l2_device/request_buffers.cpp  | 4 ++++\n> >  test/v4l2_device/stream_on_off.cpp    | 3 +++\n> >  test/v4l2_device/v4l2_device_test.cpp | 6 +++---\n> >  test/v4l2_device/v4l2_device_test.h   | 6 ++++--\n> >  8 files changed, 23 insertions(+), 9 deletions(-)\n> > \n> > diff --git a/test/v4l2_device/buffer_sharing.cpp b/test/v4l2_device/buffer_sharing.cpp\n> > index 09695239ee4b9e80..e63ddff856894130 100644\n> > --- a/test/v4l2_device/buffer_sharing.cpp\n> > +++ b/test/v4l2_device/buffer_sharing.cpp\n> > @@ -23,9 +23,8 @@ class BufferSharingTest : public V4L2DeviceTest\n> >  {\n> >  public:\n> >  \tBufferSharingTest()\n> > -\t\t: output_(nullptr), framesCaptured_(0), framesOutput_(0)\n> > -\t{\n> > -\t}\n> > +\t\t: V4L2DeviceTest(\"vivid\", \"vivid-000-vid-cap\"),\n> > +\t\t  output_(nullptr), framesCaptured_(0), framesOutput_(0) {}\n> >  \n> >  protected:\n> >  \tint init()\n> > diff --git a/test/v4l2_device/capture_async.cpp b/test/v4l2_device/capture_async.cpp\n> > index 2a41b11e95e77dac..fd428ff909f32999 100644\n> > --- a/test/v4l2_device/capture_async.cpp\n> > +++ b/test/v4l2_device/capture_async.cpp\n> > @@ -18,7 +18,7 @@ class CaptureAsyncTest : public V4L2DeviceTest\n> >  {\n> >  public:\n> >  \tCaptureAsyncTest()\n> > -\t\t: frames(0){};\n> > +\t\t: V4L2DeviceTest(\"vivid\", \"vivid-000-vid-cap\"), frames(0) {}\n> >  \n> >  \tvoid receiveBuffer(Buffer *buffer)\n> >  \t{\n> > diff --git a/test/v4l2_device/double_open.cpp b/test/v4l2_device/double_open.cpp\n> > index 7ec80a60f57ee036..b402de04fca5ddbb 100644\n> > --- a/test/v4l2_device/double_open.cpp\n> > +++ b/test/v4l2_device/double_open.cpp\n> > @@ -13,6 +13,9 @@ namespace {\n> >  \n> >  class DoubleOpen : public V4L2DeviceTest\n> >  {\n> > +public:\n> > +\tDoubleOpen()\n> > +\t\t: V4L2DeviceTest(\"vivid\", \"vivid-000-vid-cap\") {}\n> >  protected:\n> >  \tint run()\n> >  \t{\n> > diff --git a/test/v4l2_device/formats.cpp b/test/v4l2_device/formats.cpp\n> > index 72676c9d334a69b0..3ac47f5cc665b62b 100644\n> > --- a/test/v4l2_device/formats.cpp\n> > +++ b/test/v4l2_device/formats.cpp\n> > @@ -17,6 +17,9 @@ using namespace libcamera;\n> >  \n> >  class Format : public V4L2DeviceTest\n> >  {\n> > +public:\n> > +\tFormat()\n> > +\t\t: V4L2DeviceTest(\"vivid\", \"vivid-000-vid-cap\") {}\n> >  protected:\n> >  \tint run()\n> >  \t{\n> > diff --git a/test/v4l2_device/request_buffers.cpp b/test/v4l2_device/request_buffers.cpp\n> > index 938d4f85d5a1e711..794b083eb84d8d2e 100644\n> > --- a/test/v4l2_device/request_buffers.cpp\n> > +++ b/test/v4l2_device/request_buffers.cpp\n> > @@ -9,6 +9,10 @@\n> >  \n> >  class RequestBuffersTest : public V4L2DeviceTest\n> >  {\n> > +public:\n> > +\tRequestBuffersTest()\n> > +\t\t: V4L2DeviceTest(\"vivid\", \"vivid-000-vid-cap\") {}\n> > +\n> >  protected:\n> >  \tint run()\n> >  \t{\n> > diff --git a/test/v4l2_device/stream_on_off.cpp b/test/v4l2_device/stream_on_off.cpp\n> > index ea1b3f5bd5a4cbea..4902d5fd6d58a73d 100644\n> > --- a/test/v4l2_device/stream_on_off.cpp\n> > +++ b/test/v4l2_device/stream_on_off.cpp\n> > @@ -9,6 +9,9 @@\n> >  \n> >  class StreamOnStreamOffTest : public V4L2DeviceTest\n> >  {\n> > +public:\n> > +\tStreamOnStreamOffTest()\n> > +\t\t: V4L2DeviceTest(\"vivid\", \"vivid-000-vid-cap\") {}\n> >  protected:\n> >  \tint run()\n> >  \t{\n> > diff --git a/test/v4l2_device/v4l2_device_test.cpp b/test/v4l2_device/v4l2_device_test.cpp\n> > index 833038d56ea4631d..ee5a8e009bef2a5e 100644\n> > --- a/test/v4l2_device/v4l2_device_test.cpp\n> > +++ b/test/v4l2_device/v4l2_device_test.cpp\n> > @@ -39,14 +39,14 @@ int V4L2DeviceTest::init()\n> >  \t\treturn TestFail;\n> >  \t}\n> >  \n> > -\tDeviceMatch dm(\"vivid\");\n> > -\tdm.add(\"vivid-000-vid-cap\");\n> > +\tDeviceMatch dm(driver_);\n> > +\tdm.add(entity_);\n> >  \n> >  \tmedia_ = enumerator_->search(dm);\n> >  \tif (!media_)\n> >  \t\treturn TestSkip;\n> >  \n> > -\tMediaEntity *entity = media_->getEntityByName(\"vivid-000-vid-cap\");\n> > +\tMediaEntity *entity = media_->getEntityByName(entity_);\n> >  \tif (!entity)\n> >  \t\treturn TestSkip;\n> >  \n> > diff --git a/test/v4l2_device/v4l2_device_test.h b/test/v4l2_device/v4l2_device_test.h\n> > index c476d3c05e79747a..651c005f4e5485e6 100644\n> > --- a/test/v4l2_device/v4l2_device_test.h\n> > +++ b/test/v4l2_device/v4l2_device_test.h\n> > @@ -22,8 +22,8 @@ using namespace libcamera;\n> >  class V4L2DeviceTest : public Test\n> >  {\n> >  public:\n> > -\tV4L2DeviceTest()\n> > -\t\t: capture_(nullptr)\n> > +\tV4L2DeviceTest(const char *driver, const char *entity)\n> > +\t\t: driver_(driver), entity_(entity), capture_(nullptr)\n> >  \t{\n> >  \t}\n> >  \n> > @@ -31,6 +31,8 @@ protected:\n> >  \tint init();\n> >  \tvoid cleanup();\n> >  \n> > +\tstd::string driver_;\n> > +\tstd::string entity_;\n> >  \tstd::unique_ptr<DeviceEnumerator> enumerator_;\n> >  \tstd::shared_ptr<MediaDevice> media_;\n> >  \tV4L2Device *capture_;\n> > -- \n> > 2.21.0\n> > \n> > _______________________________________________\n> > libcamera-devel mailing list\n> > libcamera-devel@lists.libcamera.org\n> > https://lists.libcamera.org/listinfo/libcamera-devel\n> \n> -- \n> Regards,\n> \n> Laurent Pinchart","headers":{"Return-Path":"<niklas.soderlund@ragnatech.se>","Received":["from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com\n\t[IPv6:2a00:1450:4864:20::12f])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id E036560E4E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 11 May 2019 11:53:39 +0200 (CEST)","by mail-lf1-x12f.google.com with SMTP id v18so5830052lfi.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 11 May 2019 02:53:39 -0700 (PDT)","from localhost (89-233-230-99.cust.bredband2.com. [89.233.230.99])\n\tby smtp.gmail.com with ESMTPSA id\n\tb25sm2143120lji.50.2019.05.11.02.53.37\n\t(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);\n\tSat, 11 May 2019 02:53:38 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=ragnatech-se.20150623.gappssmtp.com; s=20150623;\n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:content-transfer-encoding:in-reply-to\n\t:user-agent; bh=BgPeUiNV72WDHPr82HzKfykIsxwsc2+Fp3IlyAjaViE=;\n\tb=QmxbQ9eZGIZ5F9pOSkXlURNMM3PP7+9RkDZICi9Abl/JSYzcwWNrfJ5o8ahsApzrSX\n\tKQAIKQBGGumV+5K2/ZtchqnR7gvtOZHvKOvxBFT1fkbsqDdfEkaJUEKB799YtBYcgr0/\n\tEViq88JxNjBuvCFDSCA3ghF7gead3/p2Qu1gGXGFpRinlps1CrmQOqFWHhV4eD0bKAKl\n\tAct+WeUlmftVBTzd5EHCYaXkl0D0waEP9qcIfiybCmn8OLX0IfvZTlJH7KxFf2qCExDs\n\tdJtMaal5prIEx4JFAoPgUagCNULUa86NaNArOTpQYAkMHx26ouYSFERJ3RmYuJTySAzB\n\trIrg==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:content-transfer-encoding\n\t:in-reply-to:user-agent;\n\tbh=BgPeUiNV72WDHPr82HzKfykIsxwsc2+Fp3IlyAjaViE=;\n\tb=MTmYDZBTzDL61RTQfUEjrNMIGeoj/T1v0Mt9WbuxHRhZ8il543lrHtb1B99B2b+df7\n\tP84w5FF6bXo2gzRxRi/5gmYzCjFsv9ankw9NfaQJ9CjISR5+C7bmbK740v8rTgNggFNp\n\tazPl9BkqTO74WpMCUDzDvlpIQxxdnTcRYyoV5Dit5NkxSXxLSmiXtVdh6VI6d/8taIqN\n\thxMrWGaZ1B7F8csiSib+EEqXrXxPKZTbLD37QUM3dyEjo7P5dgCoZkyUtXSqr24hpM6g\n\tz/dm2bNbX7aOpG6D2AH7H9/HU26sk6sI0FVkysa3b0Gz79iAJIJkctkYsqSCGIH0o0Zo\n\tt6Pg==","X-Gm-Message-State":"APjAAAXFcTZDFHz3/YayTO4q7ZAKppXjHkiYzUAegvSbGHlL21HmShmj\n\tIy92fFK9a8du16nRadPa943T7fI4nvI=","X-Google-Smtp-Source":"APXvYqyYhD/pzlzFDR2/MjWuCormc1ey/W7TTjpvz8YHNwti/r3f/WpM2yalDlYv8A43Tw1U8yWPPA==","X-Received":"by 2002:ac2:5143:: with SMTP id q3mr8987241lfd.169.1557568419238;\n\tSat, 11 May 2019 02:53:39 -0700 (PDT)","Date":"Sat, 11 May 2019 11:53:37 +0200","From":"Niklas =?iso-8859-1?q?S=F6derlund?= <niklas.soderlund@ragnatech.se>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20190511095337.GI28561@bigcity.dyn.berto.se>","References":"<20190508165814.26201-1-niklas.soderlund@ragnatech.se>\n\t<20190508165814.26201-4-niklas.soderlund@ragnatech.se>\n\t<20190511024033.GE12768@pendragon.ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=iso-8859-1","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20190511024033.GE12768@pendragon.ideasonboard.com>","User-Agent":"Mutt/1.11.3 (2019-02-01)","Subject":"Re: [libcamera-devel] [PATCH 3/5] test: v4l2_device: Allow each\n\ttest to specify which device and entity to test","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","X-List-Received-Date":"Sat, 11 May 2019 09:53:40 -0000"}}]