public function test_run_end(&$test_result) { $end_print = $test_result->test_profile->get_title() . ':' . PHP_EOL . $test_result->get_arguments_description(); $end_print .= PHP_EOL . ($test_result->get_arguments_description() != null ? PHP_EOL : null); if (in_array($test_result->test_profile->get_display_format(), array('NO_RESULT', 'FILLED_LINE_GRAPH', 'LINE_GRAPH', 'IMAGE_COMPARISON'))) { return; } else { if (in_array($test_result->test_profile->get_display_format(), array('PASS_FAIL', 'MULTI_PASS_FAIL'))) { $end_print .= PHP_EOL . 'Final: ' . $test_result->active->get_result() . ' (' . $test_result->test_profile->get_result_scale() . ')' . PHP_EOL; } else { foreach ($test_result->active->results as $result) { $end_print .= $result . ' ' . $test_result->test_profile->get_result_scale() . PHP_EOL; } $end_print .= PHP_EOL . pts_strings::result_quantifier_to_string($test_result->test_profile->get_result_quantifier()) . ': ' . $test_result->active->get_result() . ' ' . $test_result->test_profile->get_result_scale(); } } echo self::string_header($end_print, '#'); }
public function test_run_end(&$test_result) { echo PHP_EOL; if (in_array($test_result->test_profile->get_display_format(), array('NO_RESULT', 'IMAGE_COMPARISON'))) { $end_print = null; } else { if (in_array($test_result->test_profile->get_display_format(), array('PASS_FAIL', 'MULTI_PASS_FAIL'))) { $end_print = $this->tab . $this->tab . 'Final: ' . $test_result->get_result() . ' (' . $test_result->test_profile->get_result_scale() . ')' . PHP_EOL; } else { if (in_array($test_result->test_profile->get_display_format(), array('FILLED_LINE_GRAPH', 'LINE_GRAPH'))) { $values = explode(',', $test_result->get_result()); $end_print = null; if (count($values) > 1) { $avg = pts_math::set_precision(array_sum($values) / count($values), 2); $min = pts_math::set_precision(min($values), 2); $max = pts_math::set_precision(max($values), 2); $end_print .= $this->tab . $this->tab . 'Average: ' . $avg . ' (' . $test_result->test_profile->get_result_scale() . ')' . PHP_EOL; $end_print .= $this->tab . $this->tab . 'Minimum: ' . $min . ' (' . $test_result->test_profile->get_result_scale() . ')' . PHP_EOL; $end_print .= $this->tab . $this->tab . 'Maximum: ' . $max . ' (' . $test_result->test_profile->get_result_scale() . ')' . PHP_EOL; } } else { $end_print = PHP_EOL . $this->tab . 'Test Results:' . PHP_EOL; foreach ($test_result->test_result_buffer->get_values() as $result) { $end_print .= $this->tab . $this->tab . $result . PHP_EOL; } $end_print .= PHP_EOL . $this->tab . pts_strings::result_quantifier_to_string($test_result->test_profile->get_result_quantifier()) . ': ' . $test_result->get_result() . ' ' . $test_result->test_profile->get_result_scale(); if ($test_result->get_min_result()) { $end_print .= PHP_EOL . $this->tab . 'Minimum: ' . $test_result->get_min_result(); } if ($test_result->get_max_result()) { $end_print .= PHP_EOL . $this->tab . 'Maximum: ' . $test_result->get_max_result(); } if ($test_result->get_result() == 0) { $end_print .= PHP_EOL . $this->tab . 'This test failed to run properly.'; } $end_print .= PHP_EOL; } } } echo $end_print; }
public function test_run_end(&$test_result) { $test_run_manager = null; $this->update_benchmark_status($test_run_manager, $test_result); // TODO XXX: DO THIS echo PHP_EOL; if (!in_array($test_result->test_profile->get_display_format(), array('NO_RESULT', 'IMAGE_COMPARISON', 'PASS_FAIL', 'MULTI_PASS_FAIL', 'FILLED_LINE_GRAPH', 'LINE_GRAPH'))) { // TODO XXX: At least implement line_graph support as may be fairly popular $end_print = PHP_EOL . $this->tab . 'Test Results:' . PHP_EOL; foreach ($test_result->active->results as $result) { $end_print .= $this->tab . $this->tab . $result . PHP_EOL; } $end_print .= PHP_EOL . $this->tab . pts_strings::result_quantifier_to_string($test_result->test_profile->get_result_quantifier()) . ': ' . $test_result->active->get_result() . ' ' . $test_result->test_profile->get_result_scale(); if ($test_result->active->get_min_result()) { $end_print .= PHP_EOL . $this->tab . 'Minimum: ' . $test_result->active->get_min_result(); } if ($test_result->active->get_max_result()) { $end_print .= PHP_EOL . $this->tab . 'Maximum: ' . $test_result->active->get_max_result(); } if ($test_result->active->get_result() == 0) { $end_print .= PHP_EOL . $this->tab . 'This test failed to run properly.'; } $end_print .= PHP_EOL; } echo $end_print; }
public function test_run_end(&$test_result) { if (in_array($test_result->test_profile->get_display_format(), array('NO_RESULT', 'IMAGE_COMPARISON'))) { $end_print = null; } else { if (in_array($test_result->test_profile->get_display_format(), array('PASS_FAIL', 'MULTI_PASS_FAIL'))) { $end_print = 'Final: ' . $test_result->get_result() . ' (' . $test_result->test_profile->get_result_scale() . ')'; } else { if (in_array($test_result->test_profile->get_display_format(), array('FILLED_LINE_GRAPH', 'LINE_GRAPH'))) { $values = explode(',', $test_result->get_result()); $end_print = null; if (count($values) > 1) { $avg = pts_math::set_precision(array_sum($values) / count($values), 2); $min = pts_math::set_precision(min($values), 2); $max = pts_math::set_precision(max($values), 2); $end_print .= 'AVG: ' . $avg . ' (' . $test_result->test_profile->get_result_scale() . ') / '; $end_print .= 'MIN: ' . $min . ' (' . $test_result->test_profile->get_result_scale() . ') / '; $end_print .= 'MAX: ' . $max . ' (' . $test_result->test_profile->get_result_scale() . ') / '; } } else { $end_print = pts_strings::result_quantifier_to_string($test_result->test_profile->get_result_quantifier()) . ': ' . $test_result->get_result() . ' ' . $test_result->test_profile->get_result_scale(); } } } echo $this->print_test_identifier_prefix($test_result) . $end_print; }