{"id":11954,"url":"https://patchwork.libcamera.org/api/1.1/covers/11954/?format=json","web_url":"https://patchwork.libcamera.org/cover/11954/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20210415214812.234656-1-nfraprado@collabora.com>","date":"2021-04-15T21:48:10","name":"[libcamera-devel,RFC,0/2] Refactor lc-compliance using Catch2","submitter":{"id":84,"url":"https://patchwork.libcamera.org/api/1.1/people/84/?format=json","name":"Nícolas F. R. A. Prado","email":"nfraprado@collabora.com"},"mbox":"https://patchwork.libcamera.org/cover/11954/mbox/","series":[{"id":1937,"url":"https://patchwork.libcamera.org/api/1.1/series/1937/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=1937","date":"2021-04-15T21:48:10","name":"Refactor lc-compliance using Catch2","version":1,"mbox":"https://patchwork.libcamera.org/series/1937/mbox/"}],"comments":"https://patchwork.libcamera.org/api/covers/11954/comments/","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 7162DBD233\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 15 Apr 2021 21:48:53 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id ADAA36880C;\n\tThu, 15 Apr 2021 23:48:52 +0200 (CEST)","from bhuna.collabora.co.uk (bhuna.collabora.co.uk\n\t[IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 85799605AE\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 15 Apr 2021 23:48:51 +0200 (CEST)","from localhost.localdomain (unknown\n\t[IPv6:2804:14c:1a9:2978:77f9:56be:21f2:e14e])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128\n\tbits))\n\t(No client certificate requested) (Authenticated sender: nfraprado)\n\tby bhuna.collabora.co.uk (Postfix) with ESMTPSA id 62FC61F432E0;\n\tThu, 15 Apr 2021 22:48:49 +0100 (BST)"],"From":"=?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= <nfraprado@collabora.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Thu, 15 Apr 2021 18:48:10 -0300","Message-Id":"<20210415214812.234656-1-nfraprado@collabora.com>","X-Mailer":"git-send-email 2.31.1","MIME-Version":"1.0","Subject":"[libcamera-devel] [RFC PATCH 0/2] Refactor lc-compliance using\n\tCatch2","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","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>","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"This is just a prototype, not ready for merge, to refactor lc-compliance and\nbetter structure the test cases. It uses Catch2 [1], as a single header file,\nfor the test framework.\n\nImportant limitations:\n- Catch2 doesn't support skipping tests [2], so for this prototype I just put a\n  warning and succeeded the test.\n- Catch2 doesn't offer a TestSuite concept per se to group tests, instead tags\n  may be added to test cases and a grouping can be achieved that way.\n\nCatch2 offers its own command line parsing (which hasn't yet been wired up for\nthis patch), which can be used to select which test cases are run, either by\ntheir names or tags.\n\nOne really interesting feature of Catch2 is that it uses a single assert macro,\nand C++ operators can be used for comparison. This is what a failure would look\nlike:\n\n\t../src/lc-compliance/simple_capture.cpp:111: FAILED:\n\t  REQUIRE( captureCount_ == captureLimit_ )\n\twith expansion:\n\t  3 == 2\n\twith message:\n\t  Using 0 role, 3 requests, and 1 start cycles\n\n[1] https://github.com/catchorg/Catch2\n[2] https://github.com/catchorg/Catch2/issues/395\n\nNícolas F. R. A. Prado (2):\n  lc-compliance: Make SimpleCapture::stop() idempotent\n  lc-compliance: Refactor lc-compliance using Catch2\n\n src/lc-compliance/catch.hpp          | 17937 +++++++++++++++++++++++++\n src/lc-compliance/main.cpp           |    48 +-\n src/lc-compliance/simple_capture.cpp |    94 +-\n src/lc-compliance/simple_capture.h   |    10 +-\n src/lc-compliance/single_stream.cpp  |    92 +-\n 5 files changed, 18017 insertions(+), 164 deletions(-)\n create mode 100644 src/lc-compliance/catch.hpp"}