[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] cmocka: print exact error message on test setup failure


On Thursday, 10 August 2017 19:27:55 CEST Krzysztof Opasiak wrote:
> Replace hard-coded message:

Hi Krzysztof,

> 
> Could not run the test - check test fixtures
> 
> which is being printed by cmocka when test's setup() failed
> with exact error message produced by test run.
> 
> This is allows for example to see which assertion used in
> setup() failed.

thank you very much for you patch. However I pushed a slightly different 
version to master and also changed the tests that they still pass.

I hope you're OK with it.


	Andreas

> Signed-off-by: Krzysztof Opasiak <k.opasiak@xxxxxxxxxxx>
> ---
>  src/cmocka.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/cmocka.c b/src/cmocka.c
> index f02e412614e4..2d1af8d9b309 100644
> --- a/src/cmocka.c
> +++ b/src/cmocka.c
> @@ -2874,7 +2874,7 @@ int _cmocka_run_group_tests(const char *group_name,
>                  cmprintf(PRINTF_TEST_ERROR,
>                           test_number,
>                           cmtest->test->name,
> -                         "Could not run the test - check test fixtures");
> +			 cmtest->error_message);
>                  total_errors++;
>              }
>          }


-- 
Andreas Schneider                   GPG-ID: CC014E3D
www.cryptomilk.org                asn@xxxxxxxxxxxxxx

Follow-Ups:
Re: [PATCH] cmocka: print exact error message on test setup failureKrzysztof Opasiak <k.opasiak@xxxxxxxxxxx>
References:
[PATCH] cmocka: print exact error message on test setup failureKrzysztof Opasiak <k.opasiak@xxxxxxxxxxx>