test: add a build test for -Wpedantic
authorPeter Hutterer <peter.hutterer@who-t.net>
Fri, 22 Nov 2013 02:15:19 +0000 (12:15 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Fri, 22 Nov 2013 23:00:53 +0000 (09:00 +1000)
A user of libevdev may be compiled with -Wpedantic. Our header files should
not produce any warnings, so add a simple test that merely includes both
public header files and compiles with -Wpedantic -Werror.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
test/.gitignore
test/Makefile.am
test/test-compile-pedantic.c [new file with mode: 0644]

index 3117f8294aad42d2bdb35e9e94be136011be8f11..08a722de940ec7e3532bb6223a4c6cc3c802f67a 100644 (file)
@@ -1,2 +1,3 @@
 gcov-report.txt
 test-libevdev
+test-compile-pedantic
index a232f861642abdbee3abf79665309abcf972e3b7..8cdd370624a4ac73264916ec6e682f7b1e196bca 100644 (file)
@@ -1,5 +1,5 @@
 if BUILD_TESTS
-noinst_PROGRAMS = test-libevdev
+noinst_PROGRAMS = test-libevdev test-compile-pedantic
 
 TESTS = $(noinst_PROGRAMS)
 
@@ -33,6 +33,9 @@ test_libevdev_SOURCES = \
 
 test_libevdev_LDADD =  $(CHECK_LIBS) $(GCOV_LDFLAGS)
 
+test_compile_pedantic_SOURCES = test-compile-pedantic.c
+test_compile_pedantic_CFLAGS = $(AM_CPPFLAGS) -Wpedantic -Werror -std=c90
+
 if GCOV_ENABLED
 
 CLEANFILES = gcov-report.txt
diff --git a/test/test-compile-pedantic.c b/test/test-compile-pedantic.c
new file mode 100644 (file)
index 0000000..6faea86
--- /dev/null
@@ -0,0 +1,6 @@
+#include <libevdev/libevdev.h>
+#include <libevdev/libevdev-uinput.h>
+
+int main(void) {
+       return 0;
+}