test: add a build-test for -pedantic

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>
This commit is contained in:
Peter Hutterer 2013-12-06 14:18:39 +10:00
parent 0049641116
commit fab5cc3439
2 changed files with 16 additions and 1 deletions

View 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

8
test/build-pedantic.c Normal file
View file

@ -0,0 +1,8 @@
#include <libinput.h>
/* This is a build-test only */
int
main(int argc, char **argv) {
return 0;
}