test: add basic link test
authorPeter Hutterer <peter.hutterer@who-t.net>
Thu, 12 Dec 2013 03:13:54 +0000 (13:13 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Thu, 12 Dec 2013 03:19:52 +0000 (13:19 +1000)
This test doesn't do anything but compile and link against libevdev. It's a
simple protection to avoid linker errors. If we ever have libs we depend on
and they don't get resolved properly, this test should warn us in time.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
test/.gitignore
test/Makefile.am
test/test-link.c [new file with mode: 0644]

index 08a722de940ec7e3532bb6223a4c6cc3c802f67a..42cb1399269743d1fef532ce97fb1af41fc94552 100644 (file)
@@ -1,3 +1,4 @@
 gcov-report.txt
 test-libevdev
+test-link
 test-compile-pedantic
index cc9d6bd75c66382ea760b0250ca528d321cd2128..3e8116982ba37971507ee8c28e9f16bf62f60c5d 100644 (file)
@@ -1,6 +1,6 @@
 if BUILD_TESTS
 run_tests = test-libevdev
-build_tests = test-compile-pedantic
+build_tests = test-compile-pedantic test-link
 
 noinst_PROGRAMS = $(run_tests) $(build_tests)
 
@@ -39,6 +39,10 @@ test_libevdev_LDADD =  $(CHECK_LIBS) $(GCOV_LDFLAGS)
 test_compile_pedantic_SOURCES = test-compile-pedantic.c
 test_compile_pedantic_CFLAGS = $(AM_CPPFLAGS) -pedantic -Werror -std=c90
 
+test_link_SOURCES = test-link.c
+test_link_CFLAGS = -I$(top_srcdir)
+test_link_LDADD = $(top_builddir)/libevdev/libevdev.la
+
 if GCOV_ENABLED
 
 CLEANFILES = gcov-report.txt
diff --git a/test/test-link.c b/test/test-link.c
new file mode 100644 (file)
index 0000000..a66ea86
--- /dev/null
@@ -0,0 +1,6 @@
+#include <stddef.h>
+#include <libevdev/libevdev.h>
+
+int main(void) {
+       return libevdev_new_from_fd(0, NULL);
+}