diff options
author | Michael Larabel <michael@phx-laptop.(none)> | 2008-12-08 17:09:08 -0500 |
---|---|---|
committer | Michael Larabel <michael@phx-laptop.(none)> | 2008-12-08 17:09:08 -0500 |
commit | 45796a86a1572d545b2a4b0074abca7df916def5 (patch) | |
tree | 0ac34b3b8ef0083d31308d25c0c548a2ca3ec3d6 /pts-core | |
parent | 90246c6ed42a41b61f54a0e3965c6b02b150373e (diff) | |
download | phoronix-test-suite-upstream-45796a86a1572d545b2a4b0074abca7df916def5.tar.gz phoronix-test-suite-upstream-45796a86a1572d545b2a4b0074abca7df916def5.tar.xz phoronix-test-suite-upstream-45796a86a1572d545b2a4b0074abca7df916def5.zip |
pts-core: Add initial functions needed for virtual suite support
Diffstat (limited to 'pts-core')
-rw-r--r-- | pts-core/functions/pts-functions.php | 5 | ||||
-rw-r--r-- | pts-core/functions/pts-functions_io.php | 6 | ||||
-rw-r--r-- | pts-core/functions/pts-functions_types.php | 66 |
3 files changed, 72 insertions, 5 deletions
diff --git a/pts-core/functions/pts-functions.php b/pts-core/functions/pts-functions.php index 9cb43a4..6078da1 100644 --- a/pts-core/functions/pts-functions.php +++ b/pts-core/functions/pts-functions.php @@ -83,11 +83,6 @@ function pts_run_option_next($command = false, $pass_args = null, $command_descr return $return; } -function p_str($str_o) -{ - // $_ENV["LANG"] - return $str_o; -} function pts_env_variables() { // The PTS environmental variables passed during the testing process, etc diff --git a/pts-core/functions/pts-functions_io.php b/pts-core/functions/pts-functions_io.php index 5d74770..773bb4e 100644 --- a/pts-core/functions/pts-functions_io.php +++ b/pts-core/functions/pts-functions_io.php @@ -21,6 +21,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +function p_str($str_o) +{ + // $_ENV["LANG"] + return $str_o; +} function pts_text_input($question) { do diff --git a/pts-core/functions/pts-functions_types.php b/pts-core/functions/pts-functions_types.php index bc9f2ad..0bf183a 100644 --- a/pts-core/functions/pts-functions_types.php +++ b/pts-core/functions/pts-functions_types.php @@ -30,6 +30,7 @@ define("TYPE_OS_LOCAL_TEST", "OS_LOCAL_TEST"); // Type is test define("TYPE_LOCAL_TEST_SUITE", "LOCAL_TEST_SUITE"); // Type is a test suite define("TYPE_SCTP_TEST", "LOCAL_SCTP_TEST"); // Type is a SCTP test define("TYPE_BASE_TEST", "BASE_TEST"); // Type is a SCTP test +define("TYPE_VIRT_SUITE_SUBSYSTEM", "VIRT_SUITE_SUBSYSTEM"); // Type is a virtual suite for a subsystem function pts_is_run_object($object) { @@ -41,6 +42,10 @@ function pts_is_suite($object) return $type == TYPE_TEST_SUITE || $type == TYPE_LOCAL_TEST_SUITE; } +function pts_is_virtual_suite($object) +{ + return pts_location_virtual_suite($object) != false; +} function pts_is_test($object) { $type = pts_test_type($object); @@ -128,6 +133,32 @@ function pts_location_suite($identifier) return $cache[$identifier]; } +function pts_location_virtual_suite($identifier) +{ + static $cache; + + if(!isset($cache[$identifier])) + { + $virtual_suite = false; + + if(!pts_is_test($identifier) && !pts_is_suite($identifier)) + { + // Check if object is a subsystem test type + foreach(pts_subsystem_test_types() as $type) + { + if(strtolower($type) == $identifier) + { + $virtual_suite = TYPE_VIRT_SUITE_SUBSYSTEM; + break; + } + } + } + + $cache[$identifier] = $virtual_suite; + } + + return $cache[$identifier]; +} function pts_location_test($identifier) { static $cache; @@ -327,9 +358,44 @@ function pts_contained_tests($object, $include_extensions = false) } } } + /* else if(pts_is_virtual_suite($object)) + { + foreach(pts_virtual_suite_tests($object) as $virt_test) + { + array_push($tests, $virt_test); + } + } */ return array_unique($tests); } +function pts_virtual_suite_tests($object) +{ + $virtual_suite_type = pts_location_virtual_suite($object); + $contained_tests = array(); + + switch($virtual_suite_type) + { + case TYPE_VIRT_SUITE_SUBSYSTEM: + foreach(pts_available_tests_array() as $test) + { + $xml_parser = new pts_test_tandem_XmlReader(pts_location_test($test)); + $type = $xml_parser->getXMLValue(P_TEST_HARDWARE_TYPE); + + if(strtolower($type) == $object && pts_test_supported($test)) + { + array_push($contained_tests, $test); + } + } + break; + } + + if(count($contained_tests) > 0) + { + pts_set_assignment_once("IS_DEFAULTS_MODE", true); // Use the defaults mode for the suite + } + + return $contained_tests; +} function pts_find_result_file($file, $check_global = true) { // PTS Find A Saved File |