[PATCH libinput 2/2] test: abort if we trigger a libinput bug message

Jonas Ådahl jadahl at gmail.com
Wed Jul 29 00:50:11 PDT 2015


On Wed, Jul 29, 2015 at 05:45:45PM +1000, Peter Hutterer wrote:
> Only abort on client or libinput bugs, skip over kernel bugs.
> 
> Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

Both patches Reviewed-by: Jonas Ådahl <jadahl at gmail.com>


Jonas


> ---
>  test/litest.c | 4 ++++
>  test/path.c   | 2 ++
>  2 files changed, 6 insertions(+)
> 
> diff --git a/test/litest.c b/test/litest.c
> index 676485e..51085f1 100644
> --- a/test/litest.c
> +++ b/test/litest.c
> @@ -777,6 +777,10 @@ litest_log_handler(struct libinput *libinput,
>  
>  	fprintf(stderr, "litest %s: ", priority);
>  	vfprintf(stderr, format, args);
> +
> +	if (strstr(format, "client bug: ") ||
> +	    strstr(format, "libinput bug: "))
> +		litest_abort_msg("libinput bug triggered, aborting.\n");
>  }
>  
>  static int
> diff --git a/test/path.c b/test/path.c
> index 22db7ae..0b04b19 100644
> --- a/test/path.c
> +++ b/test/path.c
> @@ -331,7 +331,9 @@ START_TEST(path_add_invalid_path)
>  
>  	li = litest_create_context();
>  
> +	litest_disable_log_handler(li);
>  	device = libinput_path_add_device(li, "/tmp/");
> +	litest_restore_log_handler(li);
>  	ck_assert(device == NULL);
>  
>  	libinput_dispatch(li);
> -- 
> 2.4.3
> 
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel


More information about the wayland-devel mailing list