URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [fixincludes/] [check.tpl] - Rev 849
Go to most recent revision | Compare with Previous | Blame | View Log
[= autogen5 template sh=check.sh =][=## This file contains the shell template to run tests on the fixes#=]#!/bin/shset -eTESTDIR=testsTESTBASE=`cd $1;${PWDCMD-pwd}`[ -d ${TESTDIR} ] || mkdir ${TESTDIR}cd ${TESTDIR}TESTDIR=`${PWDCMD-pwd}`TARGET_MACHINE='*'DESTDIR=`${PWDCMD-pwd}`/resSRCDIR=`${PWDCMD-pwd}`/incFIND_BASE='.'VERBOSE=[=` echo ${VERBOSE-1} `=]INPUT=`${PWDCMD-pwd}`ORIGDIR=${INPUT}export TARGET_MACHINE DESTDIR SRCDIR FIND_BASE VERBOSE INPUT ORIGDIRrm -rf ${DESTDIR} ${SRCDIR}mkdir ${DESTDIR} ${SRCDIR}([=(shellf"for f in %sdo case $f in*/* ) echo $f | sed 's;/[^/]*$;;' ;;esacdone | sort -u | \while read gdo echo \" mkdir \\${SRCDIR}/$g || mkdir -p \\${SRCDIR}/$g || exit 1\"done" (join " " (stack "fix.files")) ) =]) 2> /dev/null[= # suppress 'No such file or directory' messages =]cd inc[=(define sfile "")(define HACK "")(define dfile "") =][=FOR fix =][=IF (> (count "test_text") 1) =][=(set! HACK (string-upcase! (get "hackname")))(set! sfile (if (exist? "files") (get "files[]") "testing.h"))(set! dfile (string-append(if (*==* sfile "/")(shellf "echo \"%s\"|sed 's,/[^/]*,/,'" sfile )"" )(string-tr! (get "hackname") "_A-Z" "-a-z")) ) =][=FOR test_text (for-from 1) =]cat >> [=(. sfile)=] <<_HACK_EOF_#if defined( [=(. HACK)=]_CHECK_[=(for-index)=] )[=test_text=]#endif /* [=(. HACK)=]_CHECK_[=(for-index)=] */_HACK_EOF_echo [=(. sfile)=] | ../../fixinclmv -f [=(. sfile)=] [=(. dfile)=]-[=(for-index)=].h[ -f ${DESTDIR}/[=(. sfile)=] ] && [=#=]mv ${DESTDIR}/[=(. sfile)=] ${DESTDIR}/[=(. dfile)=]-[=(for-index)=].h[=ENDFOR test_text =][=ENDIF multi-test =][=ENDFOR fix=][=FOR fix =][=(set! HACK (string-upcase! (get "hackname"))) =][=IF (not (exist? "test_text")) =][=(if (not (exist? "replace"))(error (sprintf "include fix '%s' has no test text"(get "hackname") )) )=][=ELSE =]cat >> [= (raw-shell-str (if (exist? "files") (get "files[0]") "testing.h"))=] <<_HACK_EOF_#if defined( [=(. HACK)=]_CHECK )[=test_text=]#endif /* [=(. HACK)=]_CHECK */_HACK_EOF_[=ENDIF =][=ENDFOR fix=]find . -type f | sed 's;^\./;;' | sort | ../../fixinclcd ${DESTDIR}exitok=truefind * -type f -print > ${TESTDIR}/LIST# Special hack for sys/types.h: the #define-d types for size_t,# ptrdiff_t and wchar_t are different for each port. Therefore,# strip off the defined-to type so that the test results are the# same for all platforms.#sed 's/\(#define __[A-Z_]*_TYPE__\).*/\1/' sys/types.h > XXmv -f XX sys/types.h# The following subshell weirdness is for saving an exit# status from within a while loop that reads input. If you can# think of a cleaner way, suggest away, please...#exitok=`exec < ${TESTDIR}/LISTwhile read fdoif [ ! -f ${TESTBASE}/$f ]thenecho "Newly fixed header: $f" >&2exitok=falseelif cmp $f ${TESTBASE}/$f >&2then:else${DIFF:-diff} -c $f ${TESTBASE}/$f >&2 || :exitok=falsefidoneecho $exitok`cd $TESTBASEfind * -type f -print | \fgrep -v 'CVS/' | \fgrep -v '.svn/' > ${TESTDIR}/LISTexitok=`exec < ${TESTDIR}/LISTwhile read fdoif [ -s $f ] && [ ! -f ${DESTDIR}/$f ]thenecho "Missing header fix: $f" >&2exitok=falsefidoneecho $exitok`echoif $exitokthencd ${TESTDIR}rm -rf inc res LISTcd ..rmdir ${TESTDIR} > /dev/null 2>&1 || :echo All fixinclude tests pass >&2elseecho There were fixinclude test FAILURES >&2fi$exitok[=(if (defined? 'set-writable) (set-writable))=]
Go to most recent revision | Compare with Previous | Blame | View Log
