From a30f4cfa8a14780ccc5c3024cd03a87d63f12df1 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Sat, 29 Jun 2013 17:57:31 +1000 Subject: [PATCH] test: prepare a common header file for all tests Signed-off-by: Peter Hutterer --- test/Makefile.am | 2 +- test/test-common.h | 34 ++++++++++++++++++++++++++++++++++ test/test-event-names.c | 4 +--- test/test-int-queue.c | 7 +++---- test/test-libevdev-events.c | 5 +---- test/test-libevdev-has-event.c | 5 +---- test/test-libevdev-init.c | 5 +---- 7 files changed, 42 insertions(+), 20 deletions(-) create mode 100644 test/test-common.h diff --git a/test/Makefile.am b/test/Makefile.am index 5941e4a..e151bff 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -6,7 +6,7 @@ libevdev_sources = $(top_srcdir)/libevdev/libevdev.c \ $(top_srcdir)/libevdev/libevdev.h \ $(top_srcdir)/libevdev/libevdev-util.h \ $(top_srcdir)/libevdev/libevdev-int.h -common_sources = $(libevdev_sources) test-common-uinput.c test-common-uinput.h +common_sources = $(libevdev_sources) test-common-uinput.c test-common-uinput.h test-common.h # include builddir for event-names.h AM_CPPFLAGS = -I$(top_srcdir) -I$(top_builddir)/libevdev $(CHECK_CFLAGS) $(GCOV_CFLAGS) diff --git a/test/test-common.h b/test/test-common.h new file mode 100644 index 0000000..79715f1 --- /dev/null +++ b/test/test-common.h @@ -0,0 +1,34 @@ +/* + * Copyright © 2013 Red Hat, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that copyright + * notice and this permission notice appear in supporting documentation, and + * that the name of the copyright holders not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. The copyright holders make no representations + * about the suitability of this software for any purpose. It is provided "as + * is" without express or implied warranty. + * + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +#include +#include + +#include + +#ifndef _TEST_COMMON_H_ +#define _TEST_COMMON_H_ + +#include "test-common-uinput.h" + + +#endif /* _TEST_COMMON_H_ */ diff --git a/test/test-event-names.c b/test/test-event-names.c index 539ccc3..09b1e97 100644 --- a/test/test-event-names.c +++ b/test/test-event-names.c @@ -21,9 +21,7 @@ */ #include -#include - -#include +#include "test-common.h" START_TEST(test_limits) { diff --git a/test/test-int-queue.c b/test/test-int-queue.c index 667398d..e809048 100644 --- a/test/test-int-queue.c +++ b/test/test-int-queue.c @@ -21,13 +21,12 @@ */ #include - #include - -#include #include +#include "test-common.h" + + -#include START_TEST(test_queue_alloc) { diff --git a/test/test-libevdev-events.c b/test/test-libevdev-events.c index d6bd8b6..307961b 100644 --- a/test/test-libevdev-events.c +++ b/test/test-libevdev-events.c @@ -22,15 +22,12 @@ #define _GNU_SOURCE #include -#include #include - -#include #include #include #include -#include "test-common-uinput.h" +#include "test-common.h" START_TEST(test_next_event) { diff --git a/test/test-libevdev-has-event.c b/test/test-libevdev-has-event.c index f1a7893..f1daf78 100644 --- a/test/test-libevdev-has-event.c +++ b/test/test-libevdev-has-event.c @@ -21,15 +21,12 @@ */ #include -#include #include - -#include #include #include #include -#include "test-common-uinput.h" +#include "test-common.h" static int evbits[] = { EV_SYN, EV_KEY, EV_REL, EV_ABS, EV_MSC, diff --git a/test/test-libevdev-init.c b/test/test-libevdev-init.c index 7d7c9e3..6faddb1 100644 --- a/test/test-libevdev-init.c +++ b/test/test-libevdev-init.c @@ -21,13 +21,10 @@ */ #include -#include - -#include #include #include -#include "test-common-uinput.h" +#include "test-common.h" START_TEST(test_new_device) { -- 2.7.4