[libcamera-devel,2/5] test: libtest: Add test return codes

Message ID 20181221081311.3291-3-kieran.bingham@ideasonboard.com
State Accepted
Headers show
Series
  • test: Define libtest
Related show

Commit Message

Kieran Bingham Dec. 21, 2018, 8:13 a.m. UTC
The meson test infrastructure uses return codes to determine test
results. Define these values for use in tests.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
---
 test/libtest/test.h | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Laurent Pinchart Dec. 31, 2018, 9:04 a.m. UTC | #1
Hi Kieran,

Thank you for the patch.

On Friday, 21 December 2018 10:13:08 EET Kieran Bingham wrote:
> The meson test infrastructure uses return codes to determine test
> results. Define these values for use in tests.
> 
> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
> ---
>  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 <sstream>
> 
> +#define TEST_PASS 0
> +#define TEST_FAIL -1
> +#define TEST_SKIP 77
> +

Let's use an enum instead of macros. Apart from that,

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

>  class Test
>  {
>  public:

Patch

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 <sstream>
 
+#define TEST_PASS 0
+#define TEST_FAIL -1
+#define TEST_SKIP 77
+
 class Test
 {
 public: