本文整理汇总了PHP中pts_client::save_test_result方法的典型用法代码示例。如果您正苦于以下问题:PHP pts_client::save_test_result方法的具体用法?PHP pts_client::save_test_result怎么用?PHP pts_client::save_test_result使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pts_client
的用法示例。
在下文中一共展示了pts_client::save_test_result方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
public static function run($args)
{
$result = $args[0];
$result_file = new pts_result_file($result);
$result_file_identifiers = $result_file->get_system_identifiers();
if (count($result_file_identifiers) < 2) {
echo PHP_EOL . 'There are not multiple test runs in this result file.' . PHP_EOL;
return false;
}
$extract_selects = array();
echo PHP_EOL . 'Enter The New Order To Display The New Results, From Left To Right.' . PHP_EOL;
do {
$extract_identifier = pts_user_io::prompt_text_menu('Select the test run to be showed next', $result_file_identifiers);
array_push($extract_selects, new pts_result_merge_select($result, $extract_identifier));
$old_identifiers = $result_file_identifiers;
$result_file_identifiers = array();
foreach ($old_identifiers as $identifier) {
if ($identifier != $extract_identifier) {
array_push($result_file_identifiers, $identifier);
}
}
} while (count($result_file_identifiers) > 0);
$ordered_result = pts_merge::merge_test_results_array($extract_selects);
pts_client::save_test_result($args[0] . '/composite.xml', $ordered_result);
pts_client::display_web_page(PTS_SAVE_RESULTS_PATH . $args[0] . '/index.html');
}
示例2: run
public static function run($r)
{
$result = $r[0];
$result_file = new pts_result_file($result);
$result_file_identifiers = $result_file->get_system_identifiers();
if (count($result_file_identifiers) < 2) {
echo PHP_EOL . 'There are not multiple test runs in this result file.' . PHP_EOL;
return false;
}
$remove_identifiers = explode(',', pts_user_io::prompt_text_menu('Select the test run(s) to remove', $result_file_identifiers, true));
$keep_identifiers = array();
foreach ($result_file_identifiers as $identifier) {
if (!in_array($identifier, $remove_identifiers)) {
array_push($keep_identifiers, $identifier);
}
}
foreach (array('test-logs', 'system-logs', 'installation-logs') as $dir_name) {
foreach ($remove_identifiers as $remove_identifier) {
if (is_dir(PTS_SAVE_RESULTS_PATH . $r[0] . '/' . $dir_name . '/' . $remove_identifier)) {
pts_file_io::delete(PTS_SAVE_RESULTS_PATH . $r[0] . '/' . $dir_name . '/' . $remove_identifier, null, true);
}
}
}
$extract_select = new pts_result_merge_select($result, $keep_identifiers);
$extract_result = pts_merge::merge_test_results($extract_select);
pts_client::save_test_result($r[0] . '/composite.xml', $extract_result);
pts_client::display_web_page(PTS_SAVE_RESULTS_PATH . $r[0] . '/index.html');
}
示例3: run
public static function run($args)
{
$result_file = new pts_result_file($args[0]);
$result_file_identifiers = $result_file->get_system_identifiers();
if (count($result_file_identifiers) < 2) {
echo PHP_EOL . 'There are not multiple test runs in this result file.' . PHP_EOL;
return false;
}
echo PHP_EOL . 'Enter The New Order To Display The New Results, From Left To Right.' . PHP_EOL;
$sorted_identifiers = array();
do {
$extract_identifier = pts_user_io::prompt_text_menu('Select the test run to be showed next', $result_file_identifiers);
$sorted_identifiers[] = $extract_identifier;
$old_identifiers = $result_file_identifiers;
$result_file_identifiers = array();
foreach ($old_identifiers as $identifier) {
if ($identifier != $extract_identifier) {
$result_file_identifiers[] = $identifier;
}
}
} while (count($result_file_identifiers) > 0);
$result_file->reorder_runs($sorted_identifiers);
pts_client::save_test_result($result_file->get_file_location(), $result_file->get_xml());
pts_client::display_web_page(PTS_SAVE_RESULTS_PATH . $args[0] . '/index.html');
}
示例4: run
public static function run($r)
{
$identifier = $r[0];
$test_xml_files = pts_file_io::glob(PTS_SAVE_RESULTS_PATH . $identifier . '/test-*.xml');
if (count($test_xml_files) == 0) {
echo PHP_EOL . 'No test XML data was found.' . PHP_EOL;
return false;
}
pts_client::save_test_result($identifier . '/composite.xml', pts_merge::merge_test_results_array($test_xml_files));
pts_client::regenerate_graphs($identifier, 'The ' . $identifier . ' result file XML has been rebuilt.');
}
示例5: run
public static function run($args)
{
$result_files = array();
foreach ($args as $id) {
$xml = pts_openbenchmarking::clone_openbenchmarking_result($id, true);
if ($xml) {
$result_file = new pts_result_file($xml);
pts_client::save_test_result($id . '/composite.xml', $result_file->get_xml(), true);
echo PHP_EOL . 'Result Saved To: ' . PTS_SAVE_RESULTS_PATH . $id . '/composite.xml' . PHP_EOL;
}
}
}
示例6: run
public static function run($args)
{
$result_files = array();
foreach ($args as $id) {
$xml = pts_openbenchmarking::clone_openbenchmarking_result($id, true);
array_push($result_files, new pts_result_file($xml));
}
$writer = new pts_result_file_writer(null);
pts_merge::merge_test_results_process($writer, $result_files);
pts_client::save_test_result($args[0] . '/composite.xml', $writer->get_xml(), true);
echo PHP_EOL . 'Result Saved To: ' . PTS_SAVE_RESULTS_PATH . $args[0] . '/composite.xml' . PHP_EOL;
}
示例7: run
public static function run($args)
{
$base_file = $args[0];
do {
$rand_file = rand(1000, 9999);
$save_to = 'analyze-' . $rand_file . '/';
} while (is_dir(PTS_SAVE_RESULTS_PATH . $save_to));
$save_to .= 'composite.xml';
// Analyze Results
$SAVED_RESULTS = pts_merge::generate_analytical_batch_xml($base_file);
pts_client::save_test_result($save_to, $SAVED_RESULTS);
echo 'Results Saved To: ' . PTS_SAVE_RESULTS_PATH . $save_to . PHP_EOL . PHP_EOL;
pts_client::display_web_page(PTS_SAVE_RESULTS_PATH . dirname($save_to) . '/index.html');
}
示例8: run
public static function run($args)
{
$result_file = new pts_result_file($args[0]);
$result_file_identifiers = $result_file->get_system_identifiers();
if (count($result_file_identifiers) < 2) {
echo PHP_EOL . 'There are not multiple test runs in this result file.' . PHP_EOL;
return false;
}
$extract_selects = array();
echo PHP_EOL . 'Automatically sorting the results...' . PHP_EOL;
sort($result_file_identifiers);
$result_file->reorder_runs($result_file_identifiers);
pts_client::save_test_result($result_file->get_file_location(), $result_file->get_xml());
pts_client::display_web_page(PTS_SAVE_RESULTS_PATH . $args[0] . '/index.html');
}
示例9: run
public static function run($r)
{
$result = $r[0];
$result_file = new pts_result_file($result);
$result_file_identifiers = $result_file->get_system_identifiers();
$rename_identifier = pts_user_io::prompt_text_menu('Select the test run to rename', $result_file_identifiers);
$rename_identifier_new = pts_user_io::prompt_user_input('Enter the new identifier');
foreach (array('test-logs', 'system-logs', 'installation-logs') as $dir_name) {
if (is_dir(PTS_SAVE_RESULTS_PATH . $r[0] . '/' . $dir_name . '/' . $rename_identifier)) {
rename(PTS_SAVE_RESULTS_PATH . $r[0] . '/' . $dir_name . '/' . $rename_identifier, PTS_SAVE_RESULTS_PATH . $r[0] . '/' . $dir_name . '/' . $rename_identifier_new);
}
}
$result_file->rename_run($rename_identifier, $rename_identifier_new);
pts_client::save_test_result($result_file->get_file_location(), $result_file->get_xml());
pts_client::display_web_page(PTS_SAVE_RESULTS_PATH . $r[0] . '/index.html');
}
示例10: run
public static function run($r)
{
$result_file = new pts_result_file($r[0]);
$result_title = $result_file->get_title();
echo PHP_EOL . 'Current Result Title: ' . $result_title . PHP_EOL;
$new_title = pts_user_io::prompt_user_input('Enter New Title');
if (!empty($new_title)) {
$result_file->set_title($new_title);
}
$result_description = $result_file->get_description();
echo PHP_EOL . 'Current Result Description: ' . $result_description . PHP_EOL;
$new_description = pts_user_io::prompt_user_input('Enter New Description');
if (!empty($new_description)) {
$result_file->set_description($new_description);
}
pts_client::save_test_result($result_file->get_file_location(), $result_file->get_xml());
pts_client::display_web_page(PTS_SAVE_RESULTS_PATH . $r[0] . '/index.html');
}
示例11: run
public static function run($args)
{
$result = $args[0];
$result_file = new pts_result_file($result);
$result_file_identifiers = $result_file->get_system_identifiers();
if (count($result_file_identifiers) < 2) {
echo PHP_EOL . 'There are not multiple test runs in this result file.' . PHP_EOL;
return false;
}
$extract_selects = array();
echo PHP_EOL . 'Automatically sorting the results...' . PHP_EOL;
sort($result_file_identifiers);
foreach ($result_file_identifiers as $identifier) {
array_push($extract_selects, new pts_result_merge_select($result, $identifier));
}
$ordered_result = pts_merge::merge_test_results_array($extract_selects);
pts_client::save_test_result($args[0] . '/composite.xml', $ordered_result);
pts_client::display_web_page(PTS_SAVE_RESULTS_PATH . $args[0] . '/index.html');
}
示例12: run
public static function run($args)
{
$result_file = new pts_result_file($args[0]);
$result_file_identifiers = $result_file->get_system_identifiers();
if (count($result_file_identifiers) < 2) {
echo PHP_EOL . 'There are not multiple test runs in this result file.' . PHP_EOL;
return false;
}
$extract_identifiers = pts_strings::comma_explode(pts_user_io::prompt_text_menu('Select the test run(s) to extract', $result_file_identifiers, true));
$remove_identifiers = array_diff($result_file_identifiers, $extract_identifiers);
$result_file->remove_run($remove_identifiers);
do {
echo PHP_EOL . 'Enter new result file to extract to: ';
$extract_to = pts_user_io::read_user_input();
$extract_to = pts_test_run_manager::clean_save_name($extract_to);
} while (empty($extract_to));
pts_client::save_test_result($extract_to . '/composite.xml', $result_file->get_xml());
pts_client::display_web_page(PTS_SAVE_RESULTS_PATH . $extract_to . '/index.html');
}
示例13: run
public static function run($r)
{
$result_file = new pts_result_file($r[0]);
$result_file_identifiers = $result_file->get_system_identifiers();
if (count($result_file_identifiers) < 2) {
echo PHP_EOL . 'There are not multiple test runs in this result file.' . PHP_EOL;
return false;
}
$remove_identifiers = explode(',', pts_user_io::prompt_text_menu('Select the test run(s) to remove', $result_file_identifiers, true));
$result_file->remove_run($remove_identifiers);
$result_dir = dirname($result_file->get_file_location()) . '/';
foreach (array('test-logs', 'system-logs', 'installation-logs') as $dir_name) {
foreach ($remove_identifiers as $remove_identifier) {
if (is_dir($result_dir . $dir_name . '/' . $remove_identifier)) {
pts_file_io::delete($result_dir . $dir_name . '/' . $remove_identifier, null, true);
}
}
}
pts_client::save_test_result($result_file->get_file_location(), $result_file->get_xml());
pts_client::display_web_page($result_dir . '/index.html');
}
示例14: run
public static function run($r)
{
$result_file = new pts_result_file($r[0]);
$result_title = $result_file->get_title();
echo PHP_EOL . 'Current Result Title: ' . $result_title . PHP_EOL;
$new_title = pts_user_io::prompt_user_input('Enter New Title');
if (!empty($new_title)) {
$result_title = $new_title;
}
$result_description = $result_file->get_description();
echo PHP_EOL . 'Current Result Description: ' . $result_description . PHP_EOL;
$new_description = pts_user_io::prompt_user_input('Enter New Description');
if (!empty($new_description)) {
$result_description = $new_description;
}
$result_file_writer = new pts_result_file_writer();
$result_file_writer->add_result_file_meta_data($result_file, null, $new_title, $new_description);
$result_file_writer->add_system_information_from_result_file($result_file);
$result_file_writer->add_results_from_result_file($result_file);
pts_client::save_test_result($r[0] . '/composite.xml', $result_file_writer->get_xml());
pts_client::display_web_page(PTS_SAVE_RESULTS_PATH . $r[0] . '/index.html');
}
示例15: run
public static function run($r)
{
$result_files_to_merge = array();
foreach ($r as $result_file) {
if (pts_types::is_result_file($result_file)) {
array_push($result_files_to_merge, $result_file);
}
}
if (count($result_files_to_merge) < 2) {
echo PHP_EOL . 'At least two saved result names must be supplied.';
return false;
}
do {
$rand_file = rand(1000, 9999);
$merge_to_file = 'merge-' . $rand_file . '/';
} while (is_dir(PTS_SAVE_RESULTS_PATH . $merge_to_file));
$merge_to_file .= 'composite.xml';
// Merge Results
$merged_results = call_user_func(array('pts_merge', 'merge_test_results_array'), $result_files_to_merge);
pts_client::save_test_result($merge_to_file, $merged_results);
echo 'Merged Results Saved To: ' . PTS_SAVE_RESULTS_PATH . $merge_to_file . PHP_EOL . PHP_EOL;
pts_client::display_web_page(PTS_SAVE_RESULTS_PATH . dirname($merge_to_file) . '/index.html');
}