From a769de4d5a3338dd91bbfe930e248f8dd2a5e597 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Mon, 16 Nov 2009 01:15:37 +0000 Subject: [PATCH] Add a test for win32/config.h synchronisation. --- tests/Makefile.am | 4 +++- tests/check-build | 23 +++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100755 tests/check-build diff --git a/tests/Makefile.am b/tests/Makefile.am index 65f57e3..48eb792 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -6,9 +6,11 @@ if USE_CPPUNIT cppunit_tests = caca-test endif +EXTRA_DIST = check-build + noinst_PROGRAMS = simple bench $(cppunit_tests) -TESTS = simple $(cppunit_tests) +TESTS = simple check-build $(cppunit_tests) simple_SOURCES = simple.c simple_LDADD = ../caca/libcaca.la diff --git a/tests/check-build b/tests/check-build new file mode 100755 index 0000000..a5f82c5 --- /dev/null +++ b/tests/check-build @@ -0,0 +1,23 @@ +#!/bin/sh + +failure=0 + +config_h_in=$(dirname "$0")/../config.h.in +win32_config_h=$(dirname "$0")/../win32/config.h + +for key in $(sed -ne 's/.*#undef *\([A-Za-z0-9_]*\).*/\1/p' "$config_h_in"); +do + if ! grep '[ef] \<'"$key"'\>' "$win32_config_h" >/dev/null 2>&1; then + echo "error: $key missing from win32/config.h" + failure=1 + fi +done + +if test "$failure" != "0"; then + exit 1 +else + echo "0 errors in Win32 config.h" +fi + +exit 0 +