1 [= autogen5 template sh=check.sh =]
4 # This file contanes the shell template to run tests on the fixes
12 [ -d ${TESTDIR} ] || mkdir ${TESTDIR}
24 export TARGET_MACHINE DESTDIR SRCDIR FIND_BASE VERBOSE INPUT ORIGDIR
26 rm -rf ${DESTDIR} ${SRCDIR}
27 mkdir ${DESTDIR} ${SRCDIR}
37 */* ) echo $f | sed 's;/[^/]*$;;' ;;
41 ` " (join " " (stack "fix.files")) ) =]
43 mkdir $f || mkdir -p $f
44 done ) > /dev/null 2>&1
51 IF (> (count "test_text") 1) =]
53 # [=hackname=] has [=(count "test_text")=] tests
56 IF (exist? "files") =][=
60 FOR test_text FROM 1 =]
61 dfile=`dirname $sfile`/[=(string-tr! (get "hackname") "_A-Z" "-a-z")
63 cat >> $sfile <<_HACK_EOF_
66 #if defined( [=(string-upcase! (get "hackname"))=]_CHECK_[=(for-index)=] )
68 #endif /* [=(string-upcase! (get "hackname"))=]_CHECK_[=(for-index)=] */
70 echo $sfile | ../../fixincl
72 [ -f ${DESTDIR}/$sfile ] && mv ${DESTDIR}/$sfile ${DESTDIR}/$dfile[=
82 IF (not (exist? "test_text")) =][=
83 IF (not (exist? "replace")) =]
84 echo No test for [=hackname=] in inc/[=
85 IF (exist? "files") =][=
92 IF (exist? "files") =][=
98 #if defined( [=(string-upcase! (get "hackname"))=]_CHECK )
100 #endif /* [=(string-upcase! (get "hackname"))=]_CHECK */
108 find . -type f | sed 's;\./;;' | sort | ../../fixincl
113 find * -type f -print > ${TESTDIR}/LIST
115 # Special hack for sys/types.h: the #define-d types for size_t,
116 # ptrdiff_t and wchar_t are different for each port. Therefore,
117 # strip off the defined-to type so that the test results are the
118 # same for all platforms.
120 sed 's/\(#define __[A-Z_]*_TYPE__\).*/\1/' sys/types.h > XX
123 # The following subshell weirdness is for saving an exit
124 # status from within a while loop that reads input. If you can
125 # think of a cleaner way, suggest away, please...
128 exec < ${TESTDIR}/LIST
131 if [ ! -f ${TESTBASE}/$f ]
133 echo "Newly fixed header: $f" >&2
136 elif cmp $f ${TESTBASE}/$f >&2
141 diff -c $f ${TESTBASE}/$f >&2 || :
149 find * -type f -print | \
150 fgrep -v 'CVS/' > ${TESTDIR}/LIST
153 exec < ${TESTDIR}/LIST
156 if [ -s $f ] && [ ! -f ${DESTDIR}/$f ]
158 echo "Missing header fix: $f" >&2
170 rmdir ${TESTDIR} > /dev/null 2>&1 || :
171 echo All fixinclude tests pass >&2
173 echo There were fixinclude test FAILURES >&2