From: <pet...@us...> - 2007-07-05 14:02:12
|
Revision: 12952 http://svn.sourceforge.net/jikesrvm/?rev=12952&view=rev Author: peter_donald Date: 2007-07-05 07:02:11 -0700 (Thu, 05 Jul 2007) Log Message: ----------- Include % deviation for black and lower colors. Partial fix for: RVM-108 Modified Paths: -------------- cattrack/trunk/app/helpers/reports/test_run_by_revision_report_helper.rb cattrack/trunk/test/helpers/reports/test_run_by_revision_report_helper_test.rb Modified: cattrack/trunk/app/helpers/reports/test_run_by_revision_report_helper.rb =================================================================== --- cattrack/trunk/app/helpers/reports/test_run_by_revision_report_helper.rb 2007-07-05 13:54:57 UTC (rev 12951) +++ cattrack/trunk/app/helpers/reports/test_run_by_revision_report_helper.rb 2007-07-05 14:02:11 UTC (rev 12952) @@ -46,12 +46,16 @@ elsif value > (best_score - (std_deviation * 0.4)) style = 'color: green;' elsif value > (best_score - (std_deviation * 0.8)) + include_suffix = true style = '' elsif value > (best_score - (std_deviation * 1.2)) + include_suffix = true style = 'color: red;' elsif value < (best_score - (std_deviation * 1.6)) + include_suffix = true style = 'color: red; font-weight: bold;' end - "<span style=\"#{style}\">#{str_value}</span>" + suffix = include_suffix ? " (-#{((best_score-value)/best_score*100).to_i}%)" : '' + "<span style=\"#{style}\">#{str_value}#{suffix}</span>" end end Modified: cattrack/trunk/test/helpers/reports/test_run_by_revision_report_helper_test.rb =================================================================== --- cattrack/trunk/test/helpers/reports/test_run_by_revision_report_helper_test.rb 2007-07-05 13:54:57 UTC (rev 12951) +++ cattrack/trunk/test/helpers/reports/test_run_by_revision_report_helper_test.rb 2007-07-05 14:02:11 UTC (rev 12952) @@ -31,9 +31,9 @@ assert_equal("", MyClass.new.perf_stat(1, row.merge({"test_run_1" => nil}))) assert_equal("<span style=\"color: green; font-weight: bold;\">2</span>", MyClass.new.perf_stat(1, row.merge({"test_run_1" => '2'}))) assert_equal("<span style=\"color: green;\">1.9</span>", MyClass.new.perf_stat(1, row.merge({"test_run_1" => '1.9'}))) - assert_equal("<span style=\"\">1.5</span>", MyClass.new.perf_stat(1, row.merge({"test_run_1" => '1.5'}))) - assert_equal("<span style=\"color: red;\">1.1</span>", MyClass.new.perf_stat(1, row.merge({"test_run_1" => '1.1'}))) - assert_equal("<span style=\"color: red; font-weight: bold;\">0.2</span>", MyClass.new.perf_stat(1, row.merge({"test_run_1" => '0.2'}))) + assert_equal("<span style=\"\">1.5 (-25%)</span>", MyClass.new.perf_stat(1, row.merge({"test_run_1" => '1.5'}))) + assert_equal("<span style=\"color: red;\">1.1 (-44%)</span>", MyClass.new.perf_stat(1, row.merge({"test_run_1" => '1.1'}))) + assert_equal("<span style=\"color: red; font-weight: bold;\">0.2 (-90%)</span>", MyClass.new.perf_stat(1, row.merge({"test_run_1" => '0.2'}))) end end This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |