diff options
author | Michael Larabel <michael@phx-laptop.(none)> | 2008-12-26 10:41:49 -0500 |
---|---|---|
committer | Michael Larabel <michael@phx-laptop.(none)> | 2008-12-26 10:41:49 -0500 |
commit | 91ef3e8ec172cc2154fa59c25e227ec1958d79ec (patch) | |
tree | 52af8fe768498b4fb77022cf1fb95c1a34067e0a /pts-core | |
parent | 0a120772bd4f503d59af2018d7402b412e6138aa (diff) | |
download | phoronix-test-suite-upstream-91ef3e8ec172cc2154fa59c25e227ec1958d79ec.tar.gz phoronix-test-suite-upstream-91ef3e8ec172cc2154fa59c25e227ec1958d79ec.tar.xz phoronix-test-suite-upstream-91ef3e8ec172cc2154fa59c25e227ec1958d79ec.zip |
pts-core: Add pts_test_installed() boolean function
Diffstat (limited to 'pts-core')
-rw-r--r-- | pts-core/functions/pts-functions-run.php | 2 | ||||
-rw-r--r-- | pts-core/functions/pts-functions_tests.php | 12 | ||||
-rw-r--r-- | pts-core/objects/pts_test_profile_details.php | 2 | ||||
-rw-r--r-- | pts-core/options/remove_installed_test.php | 2 |
4 files changed, 11 insertions, 7 deletions
diff --git a/pts-core/functions/pts-functions-run.php b/pts-core/functions/pts-functions-run.php index 2072790..efb3079 100644 --- a/pts-core/functions/pts-functions-run.php +++ b/pts-core/functions/pts-functions-run.php @@ -598,7 +598,7 @@ function pts_verify_test_installation($identifiers) foreach($tests as $test) { - if(!is_file(TEST_ENV_DIR . $test . "/pts-install.xml")) + if(!pts_test_installed($test)) { $fail_count++; if(pts_test_supported($test)) diff --git a/pts-core/functions/pts-functions_tests.php b/pts-core/functions/pts-functions_tests.php index 8b9305f..6070120 100644 --- a/pts-core/functions/pts-functions_tests.php +++ b/pts-core/functions/pts-functions_tests.php @@ -230,7 +230,7 @@ function pts_get_results_viewer_xsl_formatted($format_type = "PNG") function pts_test_needs_updated_install($identifier) { // Checks if test needs updating - return !is_file(TEST_ENV_DIR . $identifier . "/pts-install.xml") || !pts_version_comparable(pts_test_profile_version($identifier), pts_test_installed_profile_version($identifier)) || pts_test_checksum_installer($identifier) != pts_test_installed_checksum_installer($identifier) || pts_test_installed_system_identifier($identifier) != pts_system_identifier_string(); + return !pts_test_installed($identifier) || !pts_version_comparable(pts_test_profile_version($identifier), pts_test_installed_profile_version($identifier)) || pts_test_checksum_installer($identifier) != pts_test_installed_checksum_installer($identifier) || pts_test_installed_system_identifier($identifier) != pts_system_identifier_string(); } function pts_test_checksum_installer($identifier) { @@ -253,7 +253,7 @@ function pts_test_installed_checksum_installer($identifier) // Read installer checksum of installed tests $version = ""; - if(is_file(TEST_ENV_DIR . $identifier . "/pts-install.xml")) + if(pts_test_installed($identifier)) { $xml_parser = new tandem_XmlReader(TEST_ENV_DIR . $identifier . "/pts-install.xml", false); $version = $xml_parser->getXMLValue(P_INSTALL_TEST_CHECKSUM); @@ -279,7 +279,7 @@ function pts_test_installed_system_identifier($identifier) // Read installer checksum of installed tests $value = ""; - if(is_file(TEST_ENV_DIR . $identifier . "/pts-install.xml")) + if(pts_test_installed($identifier)) { $xml_parser = new tandem_XmlReader(TEST_ENV_DIR . $identifier . "/pts-install.xml", false); $value = $xml_parser->getXMLValue(P_INSTALL_TEST_SYSIDENTIFY); @@ -300,12 +300,16 @@ function pts_test_profile_version($identifier) return $version; } +function pts_test_installed($identifier) +{ + return is_file(TEST_ENV_DIR . $identifier . "/pts-install.xml"); +} function pts_test_installed_profile_version($identifier) { // Checks installed version $version = ""; - if(is_file(TEST_ENV_DIR . $identifier . "/pts-install.xml")) + if(pts_test_installed($identifier)) { $xml_parser = new tandem_XmlReader(TEST_ENV_DIR . $identifier . "/pts-install.xml", false); $version = $xml_parser->getXMLValue(P_INSTALL_TEST_VERSION); diff --git a/pts-core/objects/pts_test_profile_details.php b/pts-core/objects/pts_test_profile_details.php index 7bfa489..2c02ac3 100644 --- a/pts-core/objects/pts_test_profile_details.php +++ b/pts-core/objects/pts_test_profile_details.php @@ -105,7 +105,7 @@ class pts_test_profile_details $str .= "\nDescription: " . $this->description . "\n"; - if(is_file(TEST_ENV_DIR . $this->identifier . "/pts-install.xml")) + if(pts_test_installed($this->identifier)) { $xml_parser = new tandem_XmlReader(TEST_ENV_DIR . $this->identifier . "/pts-install.xml", false); $last_run = $xml_parser->getXMLValue(P_INSTALL_TEST_LASTRUNTIME); diff --git a/pts-core/options/remove_installed_test.php b/pts-core/options/remove_installed_test.php index 8dfe8e0..3841b4e 100644 --- a/pts-core/options/remove_installed_test.php +++ b/pts-core/options/remove_installed_test.php @@ -25,7 +25,7 @@ class remove_installed_test implements pts_option_interface public static function run($r) { $identifier = $r[0]; - if(is_file(TEST_ENV_DIR . $identifier . "/pts-install.xml")) + if(pts_test_installed($identifier)) { if(pts_bool_question("Are you sure you wish to remove the test " . $identifier . " (y/N)?", false)) { |