diff --git dev-support/test-patch.sh dev-support/test-patch.sh index d3e1fc3..7ab3e65 100755 --- dev-support/test-patch.sh +++ dev-support/test-patch.sh @@ -43,6 +43,9 @@ FINDBUGS_HOME=${FINDBUGS_HOME} FORREST_HOME=${FORREST_HOME} ECLIPSE_HOME=${ECLIPSE_HOME} +RED=$(tput setaf 1) +RESET_COLOR=$(tput sgr0) + ############################################################################### printUsage() { echo "Usage: $0 [options] patch-file | defect-number" @@ -252,12 +255,17 @@ setup () { echo "" echo "$MVN clean test -DskipTests -D${PROJECT_NAME}PatchProcess > $PATCH_DIR/trunkJavacWarnings.txt 2>&1" export MAVEN_OPTS="${MAVEN_OPTS}" - # build core and tests $MVN clean test -DskipTests -D${PROJECT_NAME}PatchProcess > $PATCH_DIR/trunkJavacWarnings.txt 2>&1 - if [[ $? != 0 ]] ; then - ERR=`$GREP -A 5 'Compilation failure' $PATCH_DIR/trunkJavacWarnings.txt` - echo "Trunk compilation is broken? - {code}$ERR{code}" + + COMPILATION_ERROR=false + + eval $( awk '/ERROR/ {print "COMPILATION_ERROR=true"}' $PATCH_DIR/trunkJavacWarnings.txt) + if $COMPILATION_ERROR ; then + echo -e "${RED}======================================================================" + echo -e "${RED}Trunk compilation is broken?" + echo -e "${RED}======================================================================" + $AWK '/ERROR/ { print $0}' $PATCH_DIR/trunkJavacWarnings.txt + echo -e "${RESET_COLOR}" cleanupAndExit 1 fi }