summaryrefslogtreecommitdiff
path: root/db-4.8.30/test/scr020/chk.inc
diff options
context:
space:
mode:
authorJesse Morgan <jesse@jesterpm.net>2016-12-17 21:28:53 -0800
committerJesse Morgan <jesse@jesterpm.net>2016-12-17 21:28:53 -0800
commit54df2afaa61c6a03cbb4a33c9b90fa572b6d07b8 (patch)
tree18147b92b969d25ffbe61935fb63035cac820dd0 /db-4.8.30/test/scr020/chk.inc
Berkeley DB 4.8 with rust build script for linux.
Diffstat (limited to 'db-4.8.30/test/scr020/chk.inc')
-rw-r--r--db-4.8.30/test/scr020/chk.inc45
1 files changed, 45 insertions, 0 deletions
diff --git a/db-4.8.30/test/scr020/chk.inc b/db-4.8.30/test/scr020/chk.inc
new file mode 100644
index 0000000..d73e898
--- /dev/null
+++ b/db-4.8.30/test/scr020/chk.inc
@@ -0,0 +1,45 @@
+#!/bin/sh -
+#
+# $Id$
+#
+# Check for inclusion of db_config.h after "const" or other includes.
+
+d=../..
+
+# Test must be run from the top-level directory, not from a test directory.
+[ -f $d/LICENSE ] || {
+ echo 'FAIL: cannot find source distribution directory.'
+ exit 1
+}
+
+t1=__1
+t2=__2
+
+(cd $d && find . -name '*.[chys]' -o -name '*.cpp' |
+ xargs egrep -l '#include.*db_config.h') | tee /tmp/o |
+ sed -e '/dbdemo.c$/d' \
+ -e '/db_java_wrap.c$/d' \
+ -e '/ex_apprec.c$/d' > $t1
+
+(for i in `cat $t1`; do
+ egrep -w 'db_config.h|const' /dev/null $d/$i | head -1
+done) > $t2
+
+if egrep const $t2 > /dev/null; then
+ echo 'FAIL: found const before include of db_config.h'
+ egrep const $t2
+ exit 1
+fi
+
+:> $t2
+for i in `cat $t1`; do
+ egrep -w '#include' /dev/null $d/$i | head -1 >> $t2
+done
+
+if egrep -v db_config.h $t2 > /dev/null; then
+ echo 'FAIL: found includes before include of db_config.h'
+ egrep -v db_config.h $t2
+ exit 1
+fi
+
+exit 0