summaryrefslogtreecommitdiffstats
path: root/pts-core/objects
diff options
context:
space:
mode:
authorMichael Larabel <michael@phx-laptop.(none)>2008-11-12 09:55:33 -0500
committerMichael Larabel <michael@phx-laptop.(none)>2008-11-13 10:34:15 -0500
commite86cd227a3acd75c9c79a365e0c2ed4e3b4e3dbe (patch)
tree525020b6d8de36762451a6d5adb800a0f4d38331 /pts-core/objects
parent56a329682c95d67895ca2a0b24c9c0f70b6d2950 (diff)
downloadphoronix-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
Diffstat (limited to 'pts-core/objects')
-rw-r--r--pts-core/objects/pts-generic-classes.php51
1 files changed, 51 insertions, 0 deletions
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;