From a742d253b72b6c1adf060dab6d347ecd73304b24 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Fri, 22 Nov 2013 12:15:19 +1000 Subject: [PATCH] test: add a build test for -Wpedantic 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 Reviewed-by: David Herrmann --- test/.gitignore | 1 + test/Makefile.am | 5 ++++- test/test-compile-pedantic.c | 6 ++++++ 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 test/test-compile-pedantic.c diff --git a/test/.gitignore b/test/.gitignore index 3117f82..08a722d 100644 --- a/test/.gitignore +++ b/test/.gitignore @@ -1,2 +1,3 @@ gcov-report.txt test-libevdev +test-compile-pedantic diff --git a/test/Makefile.am b/test/Makefile.am index a232f86..8cdd370 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -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 index 0000000..6faea86 --- /dev/null +++ b/test/test-compile-pedantic.c @@ -0,0 +1,6 @@ +#include +#include + +int main(void) { + return 0; +} -- 2.7.4