test: add a build-test for -pedantic
authorPeter Hutterer <peter.hutterer@who-t.net>
Fri, 6 Dec 2013 04:18:39 +0000 (14:18 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Wed, 15 Jan 2014 01:26:08 +0000 (11:26 +1000)
We don't build with -pedantic, but a caller may try to actually stick to the
c99 standard, so let's make sure our public header doesn't cause any
issues there.

Likewise, make sure that our header compiles with GNU C90.

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

index 444c14085d2adf4f86961e4a147d816ca8ba4038..9b0473255fbee340e3943a929ae54be5851c5dfe 100644 (file)
@@ -2,9 +2,16 @@ if BUILD_TESTS
 AM_CPPFLAGS = -I$(top_srcdir)/src 
 
 run_tests =
-build_tests =
+build_tests = test-build-pedantic-c99 test-build-std-gnuc90
 
 noinst_PROGRAMS = $(build_tests) $(run_tests)
 TESTS = $(run_tests)
 
+# build-test only
+test_build_pedantic_c99_SOURCES = build-pedantic.c
+test_build_pedantic_c99_CFLAGS = $(AM_CPPFLAGS) -std=c99 -pedantic -Werror
+
+test_build_std_gnuc90_SOURCES = build-pedantic.c
+test_build_std_gnuc90_CFLAGS = $(AM_CPPFLAGS) -std=gnu90 -Werror
+
 endif
diff --git a/test/build-pedantic.c b/test/build-pedantic.c
new file mode 100644 (file)
index 0000000..1dfb67d
--- /dev/null
@@ -0,0 +1,8 @@
+#include <libinput.h>
+
+/* This is a build-test only */
+
+int
+main(int argc, char **argv) {
+       return 0;
+}