From e0d291a9f7495afda37cdee8e9db75823cdf876b Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Fri, 13 Jan 2012 14:22:55 +0000 Subject: [PATCH] scripts/run-regression-tests: Check sparse exit code git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4070 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scripts/run-regression-tests | 41 +++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/scripts/run-regression-tests b/scripts/run-regression-tests index dc977561c..5f7bad5f5 100755 --- a/scripts/run-regression-tests +++ b/scripts/run-regression-tests @@ -301,25 +301,28 @@ function run_sparse { shift echo "Running sparse on the patched kernel in ${subdir} $@ ..." - ( - cd "${outputdir}/linux-$k" \ - && make -s prepare \ - && make -s scripts \ - && if grep -q '^CONFIG_PPC=y$' .config; then LC_ALL=C make -k M=arch/powerpc/lib; fi \ - && LC_ALL=C make -k C=2 CF=-D__CHECK_ENDIAN__ M="${subdir}" "$@" - ) &> "${outputfile}" - local errors=$(grep -c ' error:' "${outputfile}") - local warnings=$(grep -c ' warning:' "${outputfile}") - echo "${errors} errors / ${warnings} warnings." - cat "${outputfile}" \ - | grep -E 'warning:|error:' \ - | sed -e 's/^[^ ]*:[^ ]*:[^ ]*: //' \ - -e "s/context imbalance in '[^']*':/context imbalance in :/g" \ - -e "s/context problem in '[^']*': '[^']*'/context problem in : /g" \ - -e "s/function '[^']*'/function/g" \ - -e "s/symbol '[^']*'/symbol/g" \ - | sort \ - | uniq -c + if (cd "${outputdir}/linux-$k" \ + && make -s prepare \ + && make -s scripts \ + && if grep -q '^CONFIG_PPC=y$' .config; then LC_ALL=C make -k M=arch/powerpc/lib; fi \ + && LC_ALL=C make -k C=2 CF=-D__CHECK_ENDIAN__ M="${subdir}" "$@" + ) &> "${outputfile}" + then + local errors=$(grep -c ' error:' "${outputfile}") + local warnings=$(grep -c ' warning:' "${outputfile}") + echo "${errors} errors / ${warnings} warnings." + cat "${outputfile}" \ + | grep -E 'warning:|error:' \ + | sed -e 's/^[^ ]*:[^ ]*:[^ ]*: //' \ + -e "s/context imbalance in '[^']*':/context imbalance in :/g" \ + -e "s/context problem in '[^']*': '[^']*'/context problem in : /g" \ + -e "s/function '[^']*'/function/g" \ + -e "s/symbol '[^']*'/symbol/g" \ + | sort \ + | uniq -c + else + echo FAILED + fi return 0 }