/usr/share/phoronix-test-suite/pts-core/commands/info.php is in phoronix-test-suite 4.8.3-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 | <?php
/*
Phoronix Test Suite
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
Copyright (C) 2008 - 2012, Phoronix Media
Copyright (C) 2008 - 2012, Michael Larabel
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
class info implements pts_option_interface
{
const doc_section = 'Information';
const doc_description = 'This option will show details about the supplied test, suite, virtual suite, or result file.';
public static function argument_checks()
{
return array(
new pts_argument_check(0, array('pts_types', 'identifier_to_object'), 'object')
);
}
public static function run($args)
{
echo PHP_EOL;
if($args['object'] instanceof pts_test_suite)
{
pts_client::$display->generic_heading($args['object']->get_title());
echo 'Run Identifier: ' . $args['object']->get_identifier() . PHP_EOL;
echo 'Suite Version: ' . $args['object']->get_version() . PHP_EOL;
echo 'Maintainer: ' . $args['object']->get_maintainer() . PHP_EOL;
echo 'Suite Type: ' . $args['object']->get_suite_type() . PHP_EOL;
echo 'Unique Tests: ' . $args['object']->get_unique_test_count() . PHP_EOL;
echo 'Suite Description: ' . $args['object']->get_description() . PHP_EOL;
echo PHP_EOL;
echo $args['object']->pts_format_contained_tests_string();
echo PHP_EOL;
}
else if($args['object'] instanceof pts_test_profile)
{
$test_title = $args['object']->get_title();
$test_version = $args['object']->get_app_version();
if(!empty($test_version))
{
$test_title .= ' ' . $test_version;
}
pts_client::$display->generic_heading($test_title);
echo 'Run Identifier: ' . $args['object']->get_identifier() . PHP_EOL;
echo 'Profile Version: ' . $args['object']->get_test_profile_version() . PHP_EOL;
echo 'Maintainer: ' . $args['object']->get_maintainer() . PHP_EOL;
echo 'Test Type: ' . $args['object']->get_test_hardware_type() . PHP_EOL;
echo 'Software Type: ' . $args['object']->get_test_software_type() . PHP_EOL;
echo 'License Type: ' . $args['object']->get_license() . PHP_EOL;
echo 'Test Status: ' . $args['object']->get_status() . PHP_EOL;
echo 'Project Web-Site: ' . $args['object']->get_project_url() . PHP_EOL;
if($args['object']->get_estimated_run_time() > 1)
{
echo 'Estimated Run-Time: ' . $args['object']->get_estimated_run_time() . ' Seconds' . PHP_EOL;
}
$download_size = $args['object']->get_download_size();
if(!empty($download_size))
{
echo 'Download Size: ' . $download_size . ' MB' . PHP_EOL;
}
$environment_size = $args['object']->get_environment_size();
if(!empty($environment_size))
{
echo 'Environment Size: ' . $environment_size . ' MB' . PHP_EOL;
}
echo PHP_EOL . 'Description: ' . $args['object']->get_description() . PHP_EOL;
if($args['object']->test_installation != false)
{
$last_run = $args['object']->test_installation->get_last_run_date();
$last_run = $last_run == '0000-00-00' ? 'Never' : $last_run;
$avg_time = $args['object']->test_installation->get_average_run_time();
$avg_time = !empty($avg_time) ? pts_strings::format_time($avg_time, 'SECONDS') : 'N/A';
$latest_time = $args['object']->test_installation->get_latest_run_time();
$latest_time = !empty($latest_time) ? pts_strings::format_time($latest_time, 'SECONDS') : 'N/A';
echo PHP_EOL . 'Test Installed: Yes' . PHP_EOL;
echo 'Last Run: ' . $last_run . PHP_EOL;
if($last_run != 'Never')
{
if($args['object']->test_installation->get_run_count() > 1)
{
echo 'Average Run-Time: ' . $avg_time . PHP_EOL;
}
echo 'Latest Run-Time: ' . $latest_time . PHP_EOL;
echo 'Times Run: ' . $args['object']->test_installation->get_run_count() . PHP_EOL;
}
}
else
{
echo PHP_EOL . 'Test Installed: No' . PHP_EOL;
}
$dependencies = $args['object']->get_dependencies();
if(!empty($dependencies) && !empty($dependencies[0]))
{
echo PHP_EOL . 'Software Dependencies:' . PHP_EOL;
echo pts_user_io::display_text_list($args['object']->get_dependency_names());
}
echo PHP_EOL;
}
else if($args['object'] instanceof pts_result_file)
{
echo 'Title: ' . $args['object']->get_title() . '\nIdentifier: ' . $args['object']->get_identifier() . PHP_EOL;
echo PHP_EOL . 'Test Result Identifiers:' . PHP_EOL;
echo pts_user_io::display_text_list($args['object']->get_system_identifiers());
if(count(($tests = $args['object']->get_unique_test_titles())) > 0)
{
echo PHP_EOL . 'Contained Tests:' . PHP_EOL;
echo pts_user_io::display_text_list($tests);
}
echo PHP_EOL;
}
else if($args['object'] instanceof pts_virtual_test_suite)
{
pts_client::$display->generic_heading($args['object']->get_title());
echo 'Virtual Suite Description: ' . $args['object']->get_description() . PHP_EOL . PHP_EOL;
foreach($args['object']->get_contained_test_profiles() as $test_profile)
{
echo '- ' . $test_profile . PHP_EOL;
}
echo PHP_EOL;
}
}
}
?>
|