From patchwork Mon Jan 14 09:54:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 221 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id A54F960C6A for ; Mon, 14 Jan 2019 10:54: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 22046505; Mon, 14 Jan 2019 10:54:21 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1547459661; bh=BctrM7PRb44fNlEFmXvIomVPrIpNp5XVH8mdWRGWqDc=; h=From:To:Cc:Subject:Date:From; b=Wr3s+RKRJSyhUp+ra+APZzyk+U22CWbUB4gAAooNIsD6udVYbfJouwCaPlrMcJg6O wBtTB8f/pDTBkowp0gaLLysSfxBI0zOYD90U7ei6YAhIxq3REprP1aHBQcySTTeHcV 8O44d4mEtSPDnUNyOlFDOhPbLi62Waf7Erv84sA0= From: Kieran Bingham To: LibCamera Devel Date: Mon, 14 Jan 2019 09:54:15 +0000 Message-Id: <20190114095417.16473-1-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.17.1 Subject: [libcamera-devel] [PATCH RFC 0/2] Test Status Refactoring 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: Mon, 14 Jan 2019 09:54:21 -0000 To start moving towards using a TAP (Test Anything Protocol) [0], add a TestStatus class and enumerations for our current test return valuese. The TestStatus class is subclassed to provide each return status value and is currently set as: TestStatusFail, TestStatusSkip, TestStatusPass, To prevent collision with the existing TestFail, TestSkip, TestPass. If this series progresses and is accepted, I would prefer to use our current names (TestPass, not TestStatusPass) and would thus rename the TestStatus subclasses. Anyway, the goal is that every test status should have a description along with it's status so that a reason for any fail or skip can be recorded. Two helpers are shown "is()" and "isnt()" based on the naming from libtap++ [1] I'm not tied to these names, they were just a starting point for adding 'value check' tests. [0] https://testanything.org/ [1] https://github.com/cbab/libtappp Kieran Bingham (2): test: Add TestStatus classes test: Provide TestStatus validation tests test/libtest/meson.build | 1 + test/libtest/test.h | 2 ++ test/libtest/test_status.cpp | 42 +++++++++++++++++++++++++++ test/libtest/test_status.h | 55 ++++++++++++++++++++++++++++++++++++ test/meson.build | 1 + test/test_status.cpp | 52 ++++++++++++++++++++++++++++++++++ 6 files changed, 153 insertions(+) create mode 100644 test/libtest/test_status.cpp create mode 100644 test/libtest/test_status.h create mode 100644 test/test_status.cpp