HADOOP-8312. testpatch.sh should provide a simpler way to see which warnings changed (bobby)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1332417 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Joseph Evans 2012-04-30 21:47:51 +00:00
parent f484a3c019
commit bd956559c8
2 changed files with 17 additions and 2 deletions

View File

@ -39,6 +39,7 @@ WGET=${WGET:-wget}
SVN=${SVN:-svn} SVN=${SVN:-svn}
GREP=${GREP:-grep} GREP=${GREP:-grep}
PATCH=${PATCH:-patch} PATCH=${PATCH:-patch}
DIFF=${DIFF:-diff}
JIRACLI=${JIRA:-jira} JIRACLI=${JIRA:-jira}
FINDBUGS_HOME=${FINDBUGS_HOME} FINDBUGS_HOME=${FINDBUGS_HOME}
FORREST_HOME=${FORREST_HOME} FORREST_HOME=${FORREST_HOME}
@ -61,6 +62,7 @@ printUsage() {
echo "--svn-cmd=<cmd> The 'svn' command to use (default 'svn')" echo "--svn-cmd=<cmd> The 'svn' command to use (default 'svn')"
echo "--grep-cmd=<cmd> The 'grep' command to use (default 'grep')" echo "--grep-cmd=<cmd> The 'grep' command to use (default 'grep')"
echo "--patch-cmd=<cmd> The 'patch' command to use (default 'patch')" echo "--patch-cmd=<cmd> The 'patch' command to use (default 'patch')"
echo "--diff-cmd=<cmd> The 'diff' command to use (default 'diff')"
echo "--findbugs-home=<path> Findbugs home directory (default FINDBUGS_HOME environment variable)" echo "--findbugs-home=<path> Findbugs home directory (default FINDBUGS_HOME environment variable)"
echo "--forrest-home=<path> Forrest home directory (default FORREST_HOME environment variable)" echo "--forrest-home=<path> Forrest home directory (default FORREST_HOME environment variable)"
echo "--dirty-workspace Allow the local SVN workspace to have uncommitted changes" echo "--dirty-workspace Allow the local SVN workspace to have uncommitted changes"
@ -113,6 +115,9 @@ parseArgs() {
--patch-cmd=*) --patch-cmd=*)
PATCH=${i#*=} PATCH=${i#*=}
;; ;;
--diff-cmd=*)
DIFF=${i#*=}
;;
--jira-cmd=*) --jira-cmd=*)
JIRACLI=${i#*=} JIRACLI=${i#*=}
;; ;;
@ -430,14 +435,21 @@ checkJavacWarnings () {
fi fi
### Compare trunk and patch javac warning numbers ### Compare trunk and patch javac warning numbers
if [[ -f $PATCH_DIR/patchJavacWarnings.txt ]] ; then if [[ -f $PATCH_DIR/patchJavacWarnings.txt ]] ; then
trunkJavacWarnings=`$GREP '\[WARNING\]' $PATCH_DIR/trunkJavacWarnings.txt | $AWK 'BEGIN {total = 0} {total += 1} END {print total}'` $GREP '\[WARNING\]' $PATCH_DIR/trunkJavacWarnings.txt > $PATCH_DIR/filteredTrunkJavacWarnings.txt
patchJavacWarnings=`$GREP '\[WARNING\]' $PATCH_DIR/patchJavacWarnings.txt | $AWK 'BEGIN {total = 0} {total += 1} END {print total}'` $GREP '\[WARNING\]' $PATCH_DIR/patchJavacWarnings.txt > $PATCH_DIR/filteredPatchJavacWarnings.txt
trunkJavacWarnings=`cat $PATCH_DIR/filteredTrunkJavacWarnings.txt | $AWK 'BEGIN {total = 0} {total += 1} END {print total}'`
patchJavacWarnings=`cat $PATCH_DIR/filteredPatchJavacWarnings.txt | $AWK 'BEGIN {total = 0} {total += 1} END {print total}'`
echo "There appear to be $trunkJavacWarnings javac compiler warnings before the patch and $patchJavacWarnings javac compiler warnings after applying the patch." echo "There appear to be $trunkJavacWarnings javac compiler warnings before the patch and $patchJavacWarnings javac compiler warnings after applying the patch."
if [[ $patchJavacWarnings != "" && $trunkJavacWarnings != "" ]] ; then if [[ $patchJavacWarnings != "" && $trunkJavacWarnings != "" ]] ; then
if [[ $patchJavacWarnings -gt $trunkJavacWarnings ]] ; then if [[ $patchJavacWarnings -gt $trunkJavacWarnings ]] ; then
JIRA_COMMENT="$JIRA_COMMENT JIRA_COMMENT="$JIRA_COMMENT
-1 javac. The applied patch generated $patchJavacWarnings javac compiler warnings (more than the trunk's current $trunkJavacWarnings warnings)." -1 javac. The applied patch generated $patchJavacWarnings javac compiler warnings (more than the trunk's current $trunkJavacWarnings warnings)."
$DIFF $PATCH_DIR/filteredTrunkJavacWarnings.txt $PATCH_DIR/filteredPatchJavacWarnings.txt > $PATCH_DIR/diffJavacWarnings.txt
JIRA_COMMENT_FOOTER="Javac warnings: $BUILD_URL/artifact/trunk/$(basename $BASEDIR)/patchprocess/diffJavacWarnings.txt
$JIRA_COMMENT_FOOTER"
return 1 return 1
fi fi
fi fi

View File

@ -121,6 +121,9 @@ Trunk (unreleased changes)
HADOOP-7788. Add simple HealthMonitor class to watch an HAService (todd) HADOOP-7788. Add simple HealthMonitor class to watch an HAService (todd)
HADOOP-8312. testpatch.sh should provide a simpler way to see which
warnings changed (bobby)
OPTIMIZATIONS OPTIMIZATIONS
HADOOP-7761. Improve the performance of raw comparisons. (todd) HADOOP-7761. Improve the performance of raw comparisons. (todd)