diff options
author | Christophe Lyon <christophe.lyon@linaro.org> | 2015-11-20 00:40:34 +0100 |
---|---|---|
committer | Christophe Lyon <christophe.lyon@linaro.org> | 2015-11-20 17:25:22 +0100 |
commit | a8755e829d2ed36fd9e7e1072b0f167fe83456d6 (patch) | |
tree | 10a1c93e06ce263e73a2bacaae845275845768e0 | |
parent | 19142d7c736f10f9ff81140e0870b10c70c9347c (diff) |
For HTML/XML reports, show improvements as BETTER (green).
No difference is reported as PASSED (light green),
and regressions as FAILED (red).
Change-Id: I9d37bcab237701edca9310847a3f69f86b07aa85
-rwxr-xr-x | compare_jobs.sh | 32 | ||||
-rwxr-xr-x | compare_tests | 16 |
2 files changed, 34 insertions, 14 deletions
diff --git a/compare_jobs.sh b/compare_jobs.sh index 6e8b383..e653900 100755 --- a/compare_jobs.sh +++ b/compare_jobs.sh @@ -21,10 +21,13 @@ function xml_report_print_row { local target=${1?} local failed=${2?} + local improved=${3?} local log_url=BUILD_URL/artifact/artifacts/logs/diff-${target}.txt - local color='#00FF00' - $failed && color='#FF0000' + local color='lightgreen' local message=PASSED + $improved && color='green' + $improved && message=BETTER + $failed && color='red' $failed && message=FAILED cat <<EOF <tr> @@ -39,10 +42,13 @@ function html_report_print_row { local target=${1?} local failed=${2?} + local improved=${3?} local log_url=diff-${target}.txt - local color='#00FF00' - $failed && color='#FF0000' + local color='lightgreen' local message=PASSED + $improved && color='green' + $improved && message=BETTER + $failed && color='red' $failed && message=FAILED cat <<EOF <tr> @@ -184,17 +190,29 @@ do echo "REF = "${ref} echo "BUILD = "${build} failed=false + improved=false mylog=${mydir}/diff-${buildtarget}.txt target=`echo ${buildtarget} | cut -d. -f2` printf "\t# ============================================================== #\n" > ${mylog} printf "\t#\t\t*** ${buildtarget} ***\n" >> ${mylog} printf "\t# ============================================================== #\n\n" >> ${mylog} [ -d "${build}" -a -d "${ref}" ] && ${mydir}/compare_tests -target ${target} \ - ${ref} ${build} >> ${mylog} || failed=true + ${ref} ${build} >> ${mylog} + ret=$? + case $ret in + 0) # No change + ;; + 1) # Improvement + improved=true + ;; + 2) # Regression + failed=true + ;; + esac ${failed} && status=1 - xml_report_print_row "${buildtarget}" "${failed}" >> $XML_REPORT.part - html_report_print_row "${buildtarget}" "${failed}" >> $HTML_REPORT.part + xml_report_print_row "${buildtarget}" "${failed}" $improved >> $XML_REPORT.part + html_report_print_row "${buildtarget}" "${failed}" $improved >> $HTML_REPORT.part xml_log_print_field "${buildtarget}" ${mylog} >> $XML_LOG.part html_log_print_field "${buildtarget}" ${mylog} >> $HTML_LOG.part done diff --git a/compare_tests b/compare_tests index 4c72c6f..74da3be 100755 --- a/compare_tests +++ b/compare_tests @@ -116,15 +116,17 @@ if [ -d "$1" -a -d "$2" ] ; then done ${CONFIG_SHELL-/usr/bin/perl} ${my_path}/compare_dg_tests.pl -l --unstable-test=${my_path}/unstable-tests.txt ${unstable_target} $sum1 $sum2 ret=$? - if [ $ret -eq 2 ]; then - exit_status=`expr $exit_status + 1` + case $ret in + 2) + exit_status=`expr $exit_status + 2` echo "# Regressions found" - else - if [ $ret -eq 1 ]; then + ;; + 1) + exit_status=`expr $exit_status + 1` echo "# Improvements found" - fi - fi - if [ $exit_status -ne 0 ]; then + ;; + esac + if [ $ret -eq 2 ]; then echo "# Regressions in $cmnsums common sum files found" else echo "# No regression found in $cmnsums common sum files" |