diff --git a/bin/test-patch b/bin/test-patch index 8c113c2b5b..d789e58adc 100755 --- a/bin/test-patch +++ b/bin/test-patch @@ -132,6 +132,8 @@ updateJira() { ############################################################################### cleanupAndExit() { updateJira + echo "test-patch exit code: $1" + echo exit $1 } ############################################################################### @@ -407,5 +409,5 @@ cat ${SUMMARYFILE} | sed -e 's/{color}//' -e 's/{color:green}//' -e 's/{color:re cat ${SUMMARYFILETXT} -grep "\-1" ${SUMMARYFILE} &> /dev/null -cleanupAndExit `expr $? = 0` +grep "^+1 Overall result" ${SUMMARYFILETXT} &> /dev/null +cleanupAndExit "$?" diff --git a/bin/test-patch-05-patch-raw-analysis b/bin/test-patch-05-patch-raw-analysis index 1dab3114c8..7f9f2b62c1 100755 --- a/bin/test-patch-05-patch-raw-analysis +++ b/bin/test-patch-05-patch-raw-analysis @@ -74,7 +74,7 @@ parseArgs() { } ############################################################################### checkNoAuthors() { - authorTags=`grep "^+ " ${PATCHFILE} | grep -c -i -e ".*\*.* @author"` + authorTags=`grep "^+" ${PATCHFILE} | grep -v "^+++" | grep -c -i -e ".*\*.* @author"` if [[ ${authorTags} != 0 ]] ; then REPORT+=("{color:red}-1{color} the patch seems to contain ${authorTags} line(s) with @author tags") else @@ -83,7 +83,7 @@ checkNoAuthors() { } ############################################################################### checkNoTabs() { - tabs=`grep "^+ " ${PATCHFILE} | grep -c -P "\t"` + tabs=`grep "^+" ${PATCHFILE} | grep -v "^+++" | grep -c $'\t'` if [[ ${tabs} != 0 ]] ; then REPORT+=("{color:red}-1{color} the patch contains ${tabs} line(s) with tabs") else @@ -92,7 +92,7 @@ checkNoTabs() { } ############################################################################### checkNoTrailingSpaces() { - trailingSpaces=`grep "^+ " ${PATCHFILE} | grep -c -e " $"` + trailingSpaces=`grep "^+" ${PATCHFILE} | grep -v "^+++" | grep -c -e " $"` if [[ ${trailingSpaces} != 0 ]] ; then REPORT+=("{color:red}-1{color} the patch contains ${trailingSpaces} line(s) with trailing spaces") else @@ -102,7 +102,7 @@ checkNoTrailingSpaces() { ############################################################################### checkLinesLength() { # We check for > 133 to account for the "+" sign - longLines=`grep "^+ " ${PATCHFILE} | awk 'BEGIN{count=0}{if ( length > 133 ) { count=count+1} }END{ print count}'` + longLines=`grep "^+" ${PATCHFILE} | grep -v "^+++" | awk 'BEGIN{count=0}{if ( length > 133 ) { count=count+1} }END{ print count}'` if [[ ${longLines} != 0 ]] ; then REPORT+=("{color:red}-1{color} the patch contains ${longLines} line(s) longer than 132 characters") else