From 01f10fb27a675ff26bb0c0ca6748479215e6d6bd Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 18 Sep 2006 13:28:29 -0400 Subject: [PATCH] check-headers.sh: Add a test for cairo_public decorators in public headers Test fails currently because of bug 8313 and similar issues. --- src/Makefile.am | 2 +- src/check-headers.sh | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100755 src/check-headers.sh diff --git a/src/Makefile.am b/src/Makefile.am index b61d29105..a0e30ee65 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -281,7 +281,7 @@ install-data-local: false ; \ fi -TESTS = check-def.sh check-plt.sh +TESTS = check-def.sh check-plt.sh check-headers.sh EXTRA_DIST += $(TESTS) CLEANFILES = cairo.def cairo-features.h diff --git a/src/check-headers.sh b/src/check-headers.sh new file mode 100755 index 000000000..1e8d59001 --- /dev/null +++ b/src/check-headers.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +LANG=C + +test -z "$srcdir" && srcdir=. +status=0 + +echo Checking public headers for missing cairo_public decorators + +find "$srcdir" -name '*.h' -not -name '*-private.h' -not -name '*-test.h' -not -name 'cairoint.h' | +xargs grep -B 1 '^cairo_.*[ ]\+(' | +awk ' +/^--$/ { context=""; public=0; next; } +/:cairo_.*[ ]+\(/ { if (!public) {print context; print; print "--";} next; } +/-cairo_public\>/ {public=1;} +{ context=$0; } +' | +sed 's/[.]h-/.h:/' | +grep . && status=1 + +exit $status