diff options
author | Michael Larabel <michael@phx-laptop.(none)> | 2008-12-12 18:46:00 -0500 |
---|---|---|
committer | Michael Larabel <michael@phx-laptop.(none)> | 2008-12-12 18:46:00 -0500 |
commit | aebfda950b6faeab759342bf80e7020642025b22 (patch) | |
tree | bd279cd26897e77586b94a60c90052fd5fb3d219 /pts-core | |
parent | a39084a0e556986fbf0a080220665ed6eea0c392 (diff) | |
download | phoronix-test-suite-upstream-aebfda950b6faeab759342bf80e7020642025b22.tar.gz phoronix-test-suite-upstream-aebfda950b6faeab759342bf80e7020642025b22.tar.xz phoronix-test-suite-upstream-aebfda950b6faeab759342bf80e7020642025b22.zip |
pts-core: Add pts_suite_tandem_XmlReader() object for providing
pts_location_suite() in the constructor
Diffstat (limited to 'pts-core')
5 files changed, 43 insertions, 4 deletions
diff --git a/pts-core/functions/pts-functions-run.php b/pts-core/functions/pts-functions-run.php index 89d8f56..8bb7a4d 100644 --- a/pts-core/functions/pts-functions-run.php +++ b/pts-core/functions/pts-functions-run.php @@ -657,7 +657,7 @@ function pts_recurse_call_tests($tests_to_run, $arguments_array, $save_results = { if(pts_is_suite($tests_to_run[$i])) { - $xml_parser = new tandem_XmlReader(pts_location_suite($tests_to_run[$i])); + $xml_parser = new pts_suite_tandem_XmlReader($tests_to_run[$i]); $tests_in_suite = $xml_parser->getXMLArrayValues(P_SUITE_TEST_NAME); $sub_arguments = $xml_parser->getXMLArrayValues(P_SUITE_TEST_ARGUMENTS); $sub_arguments_description = $xml_parser->getXMLArrayValues(P_SUITE_TEST_DESCRIPTION); diff --git a/pts-core/objects/pts_test_profile_details.php b/pts-core/objects/pts_test_profile_details.php index 77bd725..7bfa489 100644 --- a/pts-core/objects/pts_test_profile_details.php +++ b/pts-core/objects/pts_test_profile_details.php @@ -148,7 +148,7 @@ class pts_test_profile_details $associated_suites = array(); foreach(pts_available_suites_array() as $identifier) { - $xml_parser = new tandem_XmlReader(pts_location_suite($identifier)); + $xml_parser = new pts_suite_tandem_XmlReader($identifier); $name = $xml_parser->getXMLValue(P_SUITE_TITLE); $tests = pts_contained_tests($identifier); diff --git a/pts-core/objects/pts_test_suite_details.php b/pts-core/objects/pts_test_suite_details.php index 5b3d326..5041d55 100644 --- a/pts-core/objects/pts_test_suite_details.php +++ b/pts-core/objects/pts_test_suite_details.php @@ -35,7 +35,7 @@ class pts_test_suite_details public function __construct($identifier) { - $xml_parser = new tandem_XmlReader(pts_location_suite($identifier)); + $xml_parser = new pts_suite_tandem_XmlReader($identifier); $this->identifier = $identifier; $this->name = $xml_parser->getXMLValue(P_SUITE_TITLE); $this->test_type = $xml_parser->getXMLValue(P_SUITE_TYPE); diff --git a/pts-core/objects/tandem_Xml/pts_suite_tandem_XmlReader.php b/pts-core/objects/tandem_Xml/pts_suite_tandem_XmlReader.php new file mode 100644 index 0000000..1842fec --- /dev/null +++ b/pts-core/objects/tandem_Xml/pts_suite_tandem_XmlReader.php @@ -0,0 +1,39 @@ +<?php + +/* + Phoronix Test Suite + URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/ + Copyright (C) 2008, Phoronix Media + Copyright (C) 2004-2008, Michael Larabel + pts_suite_tandem_XmlReader.php: The XML reading object for the Phoronix Test Suite for test suites + + Additional Notes: A very simple XML parser with a few extras... Does not currently support attributes on tags, etc. + A work in progress. This was originally designed for just some select needs in the past. No XML validation is done with this parser, etc. + + 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 pts_suite_tandem_XmlReader extends tandem_XmlReader +{ + public function __construct($read_xml, $cache_support = true) + { + if(!is_file($read_xml) || substr($read_xml, -3) != "xml") + { + $read_xml = pts_location_suite($read_xml); + } + + parent::__construct($read_xml, $cache_support); + } +} +?> diff --git a/pts-core/objects/tandem_Xml/pts_test_tandem_XmlReader.php b/pts-core/objects/tandem_Xml/pts_test_tandem_XmlReader.php index deba18b..73cdb45 100644 --- a/pts-core/objects/tandem_Xml/pts_test_tandem_XmlReader.php +++ b/pts-core/objects/tandem_Xml/pts_test_tandem_XmlReader.php @@ -46,7 +46,7 @@ class pts_test_tandem_XmlReader extends tandem_XmlReader if(!empty($test_extends) && pts_is_test($test_extends)) { - $test_below_parser = new pts_test_tandem_XmlReader(pts_location_test($test_extends)); + $test_below_parser = new pts_test_tandem_XmlReader($test_extends); $test_below_tag = $test_below_parser->getXMLValue($xml_tag); if(!empty($test_below_tag)) |