From: Peter Hutterer Date: Fri, 6 Dec 2013 04:18:39 +0000 (+1000) Subject: test: add a build-test for -pedantic X-Git-Tag: 0.1.0~85 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fab5cc3439395e62dfd9fbdd8dbeb488ce39d34f;p=platform%2Fupstream%2Flibinput.git 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 --- diff --git a/test/Makefile.am b/test/Makefile.am index 444c1408..9b047325 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -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 index 00000000..1dfb67df --- /dev/null +++ b/test/build-pedantic.c @@ -0,0 +1,8 @@ +#include + +/* This is a build-test only */ + +int +main(int argc, char **argv) { + return 0; +}