当前位置: 首页>>代码示例>>PHP>>正文


PHP pts_client::test_profile_debug_message方法代码示例

本文整理汇总了PHP中pts_client::test_profile_debug_message方法的典型用法代码示例。如果您正苦于以下问题:PHP pts_client::test_profile_debug_message方法的具体用法?PHP pts_client::test_profile_debug_message怎么用?PHP pts_client::test_profile_debug_message使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pts_client的用法示例。


在下文中一共展示了pts_client::test_profile_debug_message方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: parse_result_process


//.........这里部分代码省略.........
             }
         }
         if (!empty($frame_time_values) && isset($frame_time_values[3])) {
             // Get rid of the first value
             array_shift($frame_time_values);
             foreach ($frame_time_values as $f => &$v) {
                 if (!is_numeric($v) || $v == 0) {
                     unset($frame_time_values[$f]);
                     continue;
                 }
                 $v = 1000 / $v;
             }
             switch ($prefix) {
                 case 'MIN_':
                     $val = min($frame_time_values);
                     break;
                 case 'MAX_':
                     $val = max($frame_time_values);
                     break;
                 case 'AVG_':
                 default:
                     $val = array_sum($frame_time_values) / count($frame_time_values);
                     break;
             }
             if ($val != 0) {
                 array_push($test_results, $val);
             }
         }
         if (($search_key != null || isset($result_line_before_hint[$i]) && $result_line_before_hint[$i] != null || (isset($result_line_after_hint[$i]) && $result_line_after_hint[$i]) != null || isset($result_key[$i]) && $result_template_r[0] == $result_key[$i]) && $already_processed == false) {
             $is_multi_match = !empty($multi_match[$i]) && $multi_match[$i] != 'NONE';
             do {
                 $result_count = count($test_results);
                 if ($result_line_before_hint[$i] != null) {
                     pts_client::test_profile_debug_message('Result Parsing Line Before Hint: ' . $result_line_before_hint[$i]);
                     $result_line = substr($result_output, strpos($result_output, "\n", strrpos($result_output, $result_line_before_hint[$i])));
                     $result_line = substr($result_line, 0, strpos($result_line, "\n", 1));
                     $result_output = substr($result_output, 0, strrpos($result_output, "\n", strrpos($result_output, $result_line_before_hint[$i]))) . "\n";
                 } else {
                     if ($result_line_after_hint[$i] != null) {
                         pts_client::test_profile_debug_message('Result Parsing Line After Hint: ' . $result_line_after_hint[$i]);
                         $result_line = substr($result_output, 0, strrpos($result_output, "\n", strrpos($result_output, $result_line_before_hint[$i])));
                         $result_line = substr($result_line, strrpos($result_line, "\n", 1) + 1);
                         $result_output = null;
                     } else {
                         if ($search_key != null) {
                             $search_key = trim($search_key);
                             pts_client::test_profile_debug_message('Result Parsing Search Key: ' . $search_key);
                             $result_line = substr($result_output, 0, strpos($result_output, "\n", strrpos($result_output, $search_key)));
                             $start_of_line = strrpos($result_line, "\n");
                             $result_output = substr($result_line, 0, $start_of_line) . "\n";
                             $result_line = substr($result_line, $start_of_line + 1);
                         } else {
                             // Condition $result_template_r[0] == $result_key[$i], include entire file since there is nothing to search
                             pts_client::test_profile_debug_message('No Result Parsing Hint, Including Entire Result Output');
                             $result_line = trim($result_output);
                         }
                     }
                 }
                 pts_client::test_profile_debug_message('Result Line: ' . $result_line);
                 $result_r = explode(' ', pts_strings::trim_spaces(str_replace($space_out_chars, ' ', str_replace('=', ' = ', $result_line))));
                 $result_r_pos = array_search($result_key[$i], $result_r);
                 if (!empty($result_before_string[$i])) {
                     // Using ResultBeforeString tag
                     $result_before_this = array_search($result_before_string[$i], $result_r);
                     if ($result_before_this !== false) {
                         array_push($test_results, $result_r[$result_before_this - 1]);
开发者ID:Grdflo,项目名称:phoronix-test-suite,代码行数:67,代码来源:pts_test_result_parser.php

示例2: run_test


//.........这里部分代码省略.........
     }
     if ($allow_cache_share && !is_file($cache_share_pt2so)) {
         $cache_share = new pts_storage_object(false, false);
     }
     if ($test_run_manager->get_results_identifier() != null && $test_run_manager->get_file_name() != null && pts_config::read_bool_config('PhoronixTestSuite/Options/Testing/SaveTestLogs', 'FALSE')) {
         $backup_test_log_dir = PTS_SAVE_RESULTS_PATH . $test_run_manager->get_file_name() . '/test-logs/active/' . $test_run_manager->get_results_identifier() . '/';
         pts_file_io::delete($backup_test_log_dir);
         pts_file_io::mkdir($backup_test_log_dir, 0777, true);
     } else {
         $backup_test_log_dir = false;
     }
     for ($i = 0, $abort_testing = false, $time_test_start_actual = time(), $defined_times_to_run = $times_to_run; $i < $times_to_run && $i < 256 && !$abort_testing; $i++) {
         pts_client::$display->test_run_instance_header($test_run_request);
         $test_log_file = $test_directory . basename($test_identifier) . '-' . $runtime_identifier . '-' . ($i + 1) . '.log';
         $is_expected_last_run = $i == $times_to_run - 1;
         $test_extra_runtime_variables = array_merge($extra_runtime_variables, array('LOG_FILE' => $test_log_file, 'DISPLAY' => getenv('DISPLAY'), 'PATH' => getenv('PATH')));
         $restored_from_cache = false;
         if ($cache_share_present) {
             $cache_share = pts_storage_object::recover_from_file($cache_share_pt2so);
             if ($cache_share) {
                 $test_result = $cache_share->read_object('test_results_output_' . $i);
                 $test_extra_runtime_variables['LOG_FILE'] = $cache_share->read_object('log_file_location_' . $i);
                 if ($test_extra_runtime_variables['LOG_FILE'] != null) {
                     file_put_contents($test_extra_runtime_variables['LOG_FILE'], $cache_share->read_object('log_file_' . $i));
                     $test_run_time = 0;
                     // This wouldn't be used for a cache share since it would always be the same, but declare the value so the variable is at least initialized
                     $restored_from_cache = true;
                 }
             }
             unset($cache_share);
         }
         if ($restored_from_cache == false) {
             $test_run_command = 'cd ' . $to_execute . ' && ' . $execute_binary_prepend . './' . $execute_binary . ' ' . $pts_test_arguments . ' 2>&1';
             pts_client::test_profile_debug_message('Test Run Command: ' . $test_run_command);
             $is_monitoring = pts_test_result_parser::system_monitor_task_check($test_run_request->test_profile);
             $test_run_time_start = time();
             if (phodevi::is_windows() || pts_client::read_env('USE_PHOROSCRIPT_INTERPRETER') != false) {
                 $phoroscript = new pts_phoroscript_interpreter($to_execute . '/' . $execute_binary, $test_extra_runtime_variables, $to_execute);
                 $phoroscript->execute_script($pts_test_arguments);
                 $test_result = null;
             } else {
                 //$test_result = pts_client::shell_exec($test_run_command, $test_extra_runtime_variables);
                 $descriptorspec = array(0 => array('pipe', 'r'), 1 => array('pipe', 'w'), 2 => array('pipe', 'w'));
                 $test_process = proc_open('exec ' . $execute_binary_prepend . './' . $execute_binary . ' ' . $pts_test_arguments . ' 2>&1', $descriptorspec, $pipes, $to_execute, array_merge($_ENV, pts_client::environmental_variables(), $test_extra_runtime_variables));
                 if (is_resource($test_process)) {
                     //echo proc_get_status($test_process)['pid'];
                     pts_module_manager::module_process('__test_running', $test_process);
                     $test_result = stream_get_contents($pipes[1]);
                     fclose($pipes[1]);
                     fclose($pipes[2]);
                     $return_value = proc_close($test_process);
                 }
             }
             $test_run_time = time() - $test_run_time_start;
             $monitor_result = $is_monitoring ? pts_test_result_parser::system_monitor_task_post_test($test_run_request->test_profile) : 0;
         }
         if (!isset($test_result[10240]) || pts_client::is_debug_mode() || $full_output) {
             pts_client::$display->test_run_instance_output($test_result);
         }
         if (is_file($test_log_file) && trim($test_result) == null && (filesize($test_log_file) < 10240 || pts_client::is_debug_mode() || $full_output)) {
             $test_log_file_contents = file_get_contents($test_log_file);
             pts_client::$display->test_run_instance_output($test_log_file_contents);
             unset($test_log_file_contents);
         }
         $test_run_request->test_result_standard_output = $test_result;
         $exit_status_pass = true;
开发者ID:pacificIT,项目名称:phoronix-test-suite,代码行数:67,代码来源:pts_test_execution.php


注:本文中的pts_client::test_profile_debug_message方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。