Patch Detail
Show a patch.
GET /api/patches/74/?format=api
{ "id": 74, "url": "https://patchwork.libcamera.org/api/patches/74/?format=api", "web_url": "https://patchwork.libcamera.org/patch/74/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20181221123724.27290-2-kieran.bingham@ideasonboard.com>", "date": "2018-12-21T12:37:23", "name": "[libcamera-devel,1/2] test: libtest: Add path_exists helper", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "997f863293d309cb0ab0087ad52c18d3b8fe3f51", "submitter": { "id": 4, "url": "https://patchwork.libcamera.org/api/people/4/?format=api", "name": "Kieran Bingham", "email": "kieran.bingham@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/74/mbox/", "series": [ { "id": 37, "url": "https://patchwork.libcamera.org/api/series/37/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=37", "date": "2018-12-21T12:37:22", "name": "libcamera: Initial v4l2device object", "version": 1, "mbox": "https://patchwork.libcamera.org/series/37/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/74/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/74/checks/", "tags": {}, "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 A393F60B2C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 21 Dec 2018 13:37:29 +0100 (CET)", "from localhost.localdomain\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 2255E565;\n\tFri, 21 Dec 2018 13:37:29 +0100 (CET)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1545395849;\n\tbh=8xEsQc8ihblPTAYPmXBim7y8o7afV9hgZiRsnkMRTlk=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=vzlxinuxlmnVU1P3OL2AUIK3dmztcqCtsnPPrdzEkPPZ2LqCp4g/1WRrvubLZmEHr\n\t9DsoYKTy33kzvdtnuT1/K367QcpeKcfF23HoqwfwfobyWrvKdoOLjtvaAti93dWLJW\n\t2qP0ElFQnYiT5Nfa9Ju/F2oc3Jt6IHQWIlhxzfb8=", "From": "Kieran Bingham <kieran.bingham@ideasonboard.com>", "To": "LibCamera Devel <libcamera-devel@lists.libcamera.org>", "Date": "Fri, 21 Dec 2018 12:37:23 +0000", "Message-Id": "<20181221123724.27290-2-kieran.bingham@ideasonboard.com>", "X-Mailer": "git-send-email 2.17.1", "In-Reply-To": "<20181221123724.27290-1-kieran.bingham@ideasonboard.com>", "References": "<20181221123724.27290-1-kieran.bingham@ideasonboard.com>", "Subject": "[libcamera-devel] [PATCH 1/2] test: libtest: Add path_exists helper", "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": "Fri, 21 Dec 2018 12:37:36 -0000" }, "content": "We will frequently need to validate the existance of a target for\ntesting. Add a helper to wrap this.\n\nThis could be extended or replaced to ensure we have access to the path\nas well as it existing.\n\nSigned-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n---\n test/libtest/test.cpp | 11 +++++++++++\n test/libtest/test.h | 2 ++\n 2 files changed, 13 insertions(+)", "diff": "diff --git a/test/libtest/test.cpp b/test/libtest/test.cpp\nindex 9d537ea08698..ff0c9fc02e15 100644\n--- a/test/libtest/test.cpp\n+++ b/test/libtest/test.cpp\n@@ -5,6 +5,7 @@\n * test.cpp - libcamera test base class\n */\n \n+#include <sys/stat.h>\n #include \"test.h\"\n \n Test::Test()\n@@ -29,3 +30,13 @@ int Test::execute()\n \n \treturn ret;\n }\n+\n+bool Test::path_exists(const char *p)\n+{\n+\tstruct stat sb;\n+\n+\tif (stat(p, &sb) == 0)\n+\t\treturn true;\n+\n+\treturn false;\n+}\ndiff --git a/test/libtest/test.h b/test/libtest/test.h\nindex 18b430f428c7..f21cc15e8743 100644\n--- a/test/libtest/test.h\n+++ b/test/libtest/test.h\n@@ -21,6 +21,8 @@ public:\n \n \tint execute();\n \n+\tbool path_exists(const char *p);\n+\n protected:\n \tvirtual int init() { return 0; }\n \tvirtual int run() = 0;\n", "prefixes": [ "libcamera-devel", "1/2" ] }