public static function invalid_command_helper($passed_args) { $showed_recent_results = self::recently_saved_results(); if (!empty($passed_args)) { $arg_soundex = soundex($passed_args); $similar_tests = array(); foreach (pts_openbenchmarking::linked_repositories() as $repo) { $repo_index = pts_openbenchmarking::read_repository_index($repo); foreach (array('tests', 'suites') as $type) { if (isset($repo_index[$type]) && is_array($repo_index[$type])) { foreach (array_keys($repo_index[$type]) as $identifier) { if (soundex($identifier) == $arg_soundex) { array_push($similar_tests, array('- ' . $repo . '/' . $identifier, ' [' . ucwords(substr($type, 0, -1)) . ']')); } } } } } foreach (pts_client::saved_test_results() as $result) { if (soundex($result) == $arg_soundex) { array_push($similar_tests, array('- ' . $result, ' [Test Result]')); } } if (count($similar_tests) > 0) { echo 'Possible Suggestions:' . PHP_EOL; if (isset($similar_tests[12])) { // lots of tests... trim it down $similar_tests = array_rand($similar_tests, 12); } echo pts_user_io::display_text_table($similar_tests) . PHP_EOL . PHP_EOL; } } if ($showed_recent_results == false) { echo 'See available tests to run by visiting OpenBenchmarking.org or running:' . PHP_EOL . PHP_EOL; echo ' phoronix-test-suite list-tests' . PHP_EOL . PHP_EOL; echo 'Tests can be installed by running:' . PHP_EOL . PHP_EOL; echo ' phoronix-test-suite install <test-name>' . PHP_EOL; } }
public function test_run_start(&$test_run_manager, &$test_result) { echo PHP_EOL . PHP_EOL . $test_result->test_profile->get_title() . ($test_result->test_profile->get_app_version() != null ? ' ' . $test_result->test_profile->get_app_version() : null) . ':' . PHP_EOL . $this->tab . $test_result->test_profile->get_identifier(); if (($test_description = $test_result->get_arguments_description()) != false) { echo ' [' . pts_client::swap_variables($test_description, array('pts_client', 'environmental_variables')) . ']'; } echo PHP_EOL; echo $this->tab . 'Test ' . $test_run_manager->get_test_run_position() . ' of ' . $test_run_manager->get_test_run_count_reported() . PHP_EOL; $this->trial_run_count_current = 0; $this->expected_trial_run_count = $test_result->test_profile->get_times_to_run(); $remaining_length = $test_run_manager->get_estimated_run_time(); $estimated_length = $test_result->test_profile->get_estimated_run_time(); $display_table = array(); array_push($display_table, array($this->tab . 'Estimated Trial Run Count:', $this->expected_trial_run_count)); if ($estimated_length > 1 && $estimated_length != $remaining_length) { array_push($display_table, array($this->tab . 'Estimated Test Run-Time:', pts_strings::format_time($estimated_length, 'SECONDS', true, 60))); } if ($remaining_length > 1) { array_push($display_table, array($this->tab . 'Estimated Time To Completion:', pts_strings::format_time($remaining_length, 'SECONDS', true, 60))); } echo pts_user_io::display_text_table($display_table); }