diff options
author | jbj <devnull@localhost> | 2002-08-14 16:31:49 +0000 |
---|---|---|
committer | jbj <devnull@localhost> | 2002-08-14 16:31:49 +0000 |
commit | d481ba55c02407124c499c7800ea556786137bc5 (patch) | |
tree | e0d3fdb7906ae3290f019999e0661cfc5b1b3f58 /db/test/scr020 | |
parent | 9114d6ffea4ee330874ebc8febe225ce0e891eac (diff) | |
download | rpm-d481ba55c02407124c499c7800ea556786137bc5.tar.gz rpm-d481ba55c02407124c499c7800ea556786137bc5.tar.bz2 rpm-d481ba55c02407124c499c7800ea556786137bc5.zip |
Initial revision
CVS patchset: 5630
CVS date: 2002/08/14 16:31:49
Diffstat (limited to 'db/test/scr020')
-rw-r--r-- | db/test/scr020/chk.inc | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/db/test/scr020/chk.inc b/db/test/scr020/chk.inc new file mode 100644 index 000000000..258bf3c4d --- /dev/null +++ b/db/test/scr020/chk.inc @@ -0,0 +1,43 @@ +#!/bin/sh - +# +# Id: chk.inc,v 1.1 2002/02/10 17:14:33 bostic Exp +# +# 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') > $t1 + +:> $t2 +for i in `cat $t1`; do + egrep -w 'db_config.h|const' /dev/null $d/$i | head -1 >> $t2 +done + +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 |