summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CHANGE-LOG1
-rw-r--r--pts-core/functions/pts-functions-run.php2
-rw-r--r--pts-core/functions/pts-functions_tests.php12
-rw-r--r--pts-core/objects/pts_test_profile_details.php2
-rw-r--r--pts-core/options/remove_installed_test.php2
5 files changed, 12 insertions, 7 deletions
diff --git a/CHANGE-LOG b/CHANGE-LOG
index 5d81e84..b1ff9d8 100644
--- a/CHANGE-LOG
+++ b/CHANGE-LOG
@@ -6,6 +6,7 @@ Phoronix Test Suite (Git)
- pts-core: Improve lspci support for distributions using /sbin/lspci (such as OpenSuSE)
- pts-core: Move base test profiles and resources to pts/base-test-profiles/ and pts/base-test-resources/
- pts-core: Improve motherboard southbridge detection for some Intel ICH Chipsets
+- pts-core: Add pts_test_installed() boolean function
- pts_Graph: Tweak formatting of basic graph attributes
- pts: Add UXA acceleration check to GtkPerf test note reporting
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))
{