diff options
author | Michael Larabel <michael@phx-laptop.(none)> | 2008-11-12 09:55:33 -0500 |
---|---|---|
committer | Michael Larabel <michael@phx-laptop.(none)> | 2008-11-13 10:34:15 -0500 |
commit | e86cd227a3acd75c9c79a365e0c2ed4e3b4e3dbe (patch) | |
tree | 525020b6d8de36762451a6d5adb800a0f4d38331 | |
parent | 56a329682c95d67895ca2a0b24c9c0f70b6d2950 (diff) | |
download | phoronix-test-suite-upstream-e86cd227a3acd75c9c79a365e0c2ed4e3b4e3dbe.tar.gz phoronix-test-suite-upstream-e86cd227a3acd75c9c79a365e0c2ed4e3b4e3dbe.tar.xz phoronix-test-suite-upstream-e86cd227a3acd75c9c79a365e0c2ed4e3b4e3dbe.zip |
pts-core: Add pts_test_suite_details class
-rw-r--r-- | TYDAL-CHANGE-LOG | 1 | ||||
-rw-r--r-- | pts-core/objects/pts-generic-classes.php | 51 | ||||
-rw-r--r-- | pts-core/pts-run-cmd.php | 31 |
3 files changed, 56 insertions, 27 deletions
diff --git a/TYDAL-CHANGE-LOG b/TYDAL-CHANGE-LOG index 8d6c454..221c220 100644 --- a/TYDAL-CHANGE-LOG +++ b/TYDAL-CHANGE-LOG @@ -3,4 +3,5 @@ Phoronix Test Suite (Git) - pts-core: Add pts_set_assignment(), pts_read_assignment(), pts_is_assignment(), pts_set_assignment_once(), pts_clear_assignment() and pts_clear_assignments() - pts-core: Switch over relevant define statements to using new PTS assignment functions for program-wide option-specific variable constants +- pts-core: Add pts_test_profile_details class - pts-core: Add pts_test_suite_details class diff --git a/pts-core/objects/pts-generic-classes.php b/pts-core/objects/pts-generic-classes.php index 5caa778..e09a7e1 100644 --- a/pts-core/objects/pts-generic-classes.php +++ b/pts-core/objects/pts-generic-classes.php @@ -65,6 +65,57 @@ class pts_test_file_download return $this->md5; } } +class pts_test_suite_details +{ + var $identifier; + var $identifier_show_prefix; + var $name; + var $version; + var $type; + var $test_type; + var $only_partially_supported = false; + + public function __construct($identifier) + { + $xml_parser = new tandem_XmlReader(pts_location_suite($identifier)); + $this->identifier = $identifier; + $this->name = $xml_parser->getXMLValue(P_SUITE_TITLE); + $this->test_type = $xml_parser->getXMLValue(P_SUITE_TYPE); + $this->version = $xml_parser->getXMLValue(P_SUITE_VERSION); + $this->type = $xml_parser->getXMLValue(P_SUITE_TYPE); + + $suite_support_code = pts_suite_supported($identifier); + + $this->identifier_show_prefix = " "; + if($suite_support_code > 0) + { + if($suite_support_code == 1) + { + $this->identifier_show_prefix = "*"; + $this->only_partially_supported = true; + } + } + } + public function partially_supported() + { + return $this->only_partially_supported; + } + public function __toString() + { + $str = ""; + + if(IS_DEBUG_MODE) + { + $str = sprintf("%-26ls - %-32ls %-4ls %-12ls\n", $this->identifier_show_prefix . " " . $this->identifier, $this->name, $this->version, $this->type); + } + else if(!empty($this->name)) + { + $str = sprintf("%-24ls - %-32ls [Type: %s]\n", $this->identifier_show_prefix . " " . $this->identifier, $this->name, $this->test_type); + } + + return $str; + } +} class pts_test_profile_details { var $identifier; diff --git a/pts-core/pts-run-cmd.php b/pts-core/pts-run-cmd.php index a5f892f..ee2c292 100644 --- a/pts-core/pts-run-cmd.php +++ b/pts-core/pts-run-cmd.php @@ -185,37 +185,14 @@ switch($COMMAND) $has_partially_supported_suite = false; foreach(pts_available_suites_array() as $identifier) { - $xml_parser = new tandem_XmlReader(pts_location_suite($identifier)); - $name = $xml_parser->getXMLValue(P_SUITE_TITLE); - $test_type = $xml_parser->getXMLValue(P_SUITE_TYPE); + $suite_info = new pts_test_suite_details($identifier); - if(IS_DEBUG_MODE) + if($has_partially_supported_suite == false && $suite_info->partially_supported()) { - $version = $xml_parser->getXMLValue(P_SUITE_VERSION); - $type = $xml_parser->getXMLValue(P_SUITE_TYPE); - - printf("%-26ls - %-32ls %-4ls %-12ls\n", $identifier, $name, $version, $type); + $has_partially_supported_suite = true; } - else - { - $suite_support_code = pts_suite_supported($identifier); - - if($suite_support_code > 0) - { - $identifier_prefix = " "; - if($suite_support_code == 1) - { - $identifier_prefix = "*"; - if(!$has_partially_supported_suite) - { - $has_partially_supported_suite = true; - } - } - - printf("%-24ls - %-32ls [Type: %s]\n", $identifier_prefix . " " . $identifier, $name, $test_type); - } - } + echo $suite_info; } echo "\n"; if($has_partially_supported_suite) |