diff options
author | Michael Larabel <michael@phx-laptop.(none)> | 2008-08-25 21:44:24 -0400 |
---|---|---|
committer | Michael Larabel <michael@phx-laptop.(none)> | 2008-08-25 21:44:24 -0400 |
commit | 3a90c84c198da72e5db522f97c886a20ae523d03 (patch) | |
tree | 22f29f4eb1384042d9d61f1c074c1033b9dbef51 | |
parent | c6ba9b98a6227442a20a612a14c0030f6b92ec08 (diff) | |
download | phoronix-test-suite-upstream-3a90c84c198da72e5db522f97c886a20ae523d03.tar.gz phoronix-test-suite-upstream-3a90c84c198da72e5db522f97c886a20ae523d03.tar.xz phoronix-test-suite-upstream-3a90c84c198da72e5db522f97c886a20ae523d03.zip |
pts-coere: Add SupportedPlatforms tag for optionally specifying on what
operating systems this test is compatible with (Linux, Solaris, and
FreeBSD)
-rw-r--r-- | pts-core/functions/pts-functions-install.php | 30 | ||||
-rw-r--r-- | pts-core/functions/pts-interfaces.php | 1 |
2 files changed, 30 insertions, 1 deletions
diff --git a/pts-core/functions/pts-functions-install.php b/pts-core/functions/pts-functions-install.php index 16246aa..de127cc 100644 --- a/pts-core/functions/pts-functions-install.php +++ b/pts-core/functions/pts-functions-install.php @@ -316,7 +316,11 @@ function pts_install_test($identifier) { if(!pts_test_architecture_supported($identifier)) { - echo pts_string_header($identifier . " is not supported on this platform (" . kernel_arch() . ")."); + echo pts_string_header($identifier . " is not supported with this processor architecture (" . kernel_arch() . ")."); + } + else if(!pts_test_platform_supported($identifier)) + { + echo pts_string_header($identifier . " is not supported by this operating system (" . OPERATING_SYSTEM . ")."); } else { @@ -618,6 +622,30 @@ function pts_test_architecture_supported($identifier) return $supported; } +function pts_test_platform_supported($identifier) +{ + // Check if the system's OS is supported by a test + $supported = true; + + if(is_file(XML_PROFILE_DIR . $identifier . ".xml")) + { + $xml_parser = new tandem_XmlReader(XML_PROFILE_DIR . $identifier . ".xml"); + $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; +} function pts_estimated_download_size($identifier) { // Estimate the size of files to be downloaded diff --git a/pts-core/functions/pts-interfaces.php b/pts-core/functions/pts-interfaces.php index ffb39d2..873d104 100644 --- a/pts-core/functions/pts-interfaces.php +++ b/pts-core/functions/pts-interfaces.php @@ -46,6 +46,7 @@ define("P_TEST_MAINTAINER", "PhoronixTestSuite/TestProfile/Maintainer"); // Test define("P_TEST_LICENSE", "PhoronixTestSuite/TestProfile/License"); // Test software license define("P_TEST_STATUS", "PhoronixTestSuite/TestProfile/Status"); // The status of the test profile define("P_TEST_SUPPORTEDARCHS", "PhoronixTestSuite/TestProfile/SupportedArchitectures"); // The system architectures supported by this test +define("P_TEST_SUPPORTEDPLATFORMS", "PhoronixTestSuite/TestProfile/SupportedPlatforms"); // The OS software platforms supported by this test define("P_TEST_ROOTNEEDED", "PhoronixTestSuite/TestProfile/RequiresRoot"); // Is root access needed? (TODO: Implement RequiresRoot) define("P_TEST_DOWNLOADSIZE", "PhoronixTestSuite/TestProfile/DownloadSize"); // Estimated size of capacity needed for downloads (in MB) define("P_TEST_ENVIRONMENTSIZE", "PhoronixTestSuite/TestProfile/EnvironmentSize"); // Estimated size of capacity needed for testing environment (in MB) |