summaryrefslogtreecommitdiffstats
path: root/pts-core/functions
diff options
context:
space:
mode:
authorMichael Larabel <michael@phx-laptop.(none)>2008-12-26 10:41:49 -0500
committerMichael Larabel <michael@phx-laptop.(none)>2008-12-26 10:41:49 -0500
commit91ef3e8ec172cc2154fa59c25e227ec1958d79ec (patch)
tree52af8fe768498b4fb77022cf1fb95c1a34067e0a /pts-core/functions
parent0a120772bd4f503d59af2018d7402b412e6138aa (diff)
downloadphoronix-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/functions')
-rw-r--r--pts-core/functions/pts-functions-run.php2
-rw-r--r--pts-core/functions/pts-functions_tests.php12
2 files changed, 9 insertions, 5 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);