diff options
author | Michael Larabel <michael@phx-laptop.(none)> | 2008-09-11 22:02:24 -0400 |
---|---|---|
committer | Michael Larabel <michael@phx-laptop.(none)> | 2008-09-11 22:02:24 -0400 |
commit | f1947262c47adb59d252fec04e1c42389dc59fc0 (patch) | |
tree | 28da14432115d75c5cf934706d3383a6671f7e98 /pts-core/functions/pts-functions_tests.php | |
parent | 0c5dc21e9a0a43c5c8c0d2b16693553da30c8da4 (diff) | |
download | phoronix-test-suite-upstream-f1947262c47adb59d252fec04e1c42389dc59fc0.tar.gz phoronix-test-suite-upstream-f1947262c47adb59d252fec04e1c42389dc59fc0.tar.xz phoronix-test-suite-upstream-f1947262c47adb59d252fec04e1c42389dc59fc0.zip |
pts-core: When running a test (or suite that contains a test) on an
unsupported architecture or platform, don't abruptly exit
Diffstat (limited to 'pts-core/functions/pts-functions_tests.php')
-rw-r--r-- | pts-core/functions/pts-functions_tests.php | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/pts-core/functions/pts-functions_tests.php b/pts-core/functions/pts-functions_tests.php index 6df46af..e6121e1 100644 --- a/pts-core/functions/pts-functions_tests.php +++ b/pts-core/functions/pts-functions_tests.php @@ -202,5 +202,58 @@ function pts_test_estimated_environment_size($identifier) return $estimated_size; } +function pts_test_architecture_supported($identifier) +{ + // Check if the system's architecture is supported by a test + $supported = true; + + if(is_test($identifier)) + { + $xml_parser = new pts_test_tandem_XmlReader(pts_location_test($identifier)); + $archs = $xml_parser->getXMLValue(P_TEST_SUPPORTEDARCHS); + + if(!empty($archs)) + { + $archs = explode(",", $archs); + + foreach($archs as $key => $value) + $archs[$key] = trim($value); + + $this_arch = kernel_arch(); + + if(strlen($this_arch) > 3 && substr($this_arch, -2) == "86") + $this_arch = "x86"; + + if(!in_array($this_arch, $archs)) + $supported = false; + } + } + + return $supported; +} +function pts_test_platform_supported($identifier) +{ + // Check if the system's OS is supported by a test + $supported = true; + + if(is_test($identifier)) + { + $xml_parser = new pts_test_tandem_XmlReader(pts_location_test($identifier)); + $platforms = $xml_parser->getXMLValue(P_TEST_SUPPORTEDPLATFORMS); + + if(!empty($platforms)) + { + $platforms = explode(",", $platforms); + + foreach($platforms as $key => $value) + $platforms[$key] = trim($value); + + if(!in_array(OPERATING_SYSTEM, $platforms) && OPERATING_SYSTEM != "Unknown") + $supported = false; + } + } + + return $supported; +} ?> |