summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Larabel <michael@phx-laptop.(none)>2008-09-11 20:55:02 -0400
committerMichael Larabel <michael@phx-laptop.(none)>2008-09-11 20:55:02 -0400
commit2ca4be349d96e9fe442fe8de46b03d45d97dd3b6 (patch)
tree37a833f2e8f9bdb171c686d84f022a28ab6fb85e
parent99597c9f94c017c468e751cd7869a4ef1fe25096 (diff)
downloadphoronix-test-suite-upstream-2ca4be349d96e9fe442fe8de46b03d45d97dd3b6.tar.gz
phoronix-test-suite-upstream-2ca4be349d96e9fe442fe8de46b03d45d97dd3b6.tar.xz
phoronix-test-suite-upstream-2ca4be349d96e9fe442fe8de46b03d45d97dd3b6.zip
pts-core: Add test type caching support
-rw-r--r--EXPERIMENTAL-CHANGE-LOG1
-rw-r--r--pts-core/functions/pts-functions.php22
2 files changed, 16 insertions, 7 deletions
diff --git a/EXPERIMENTAL-CHANGE-LOG b/EXPERIMENTAL-CHANGE-LOG
index 32e8e44..e78719b 100644
--- a/EXPERIMENTAL-CHANGE-LOG
+++ b/EXPERIMENTAL-CHANGE-LOG
@@ -3,3 +3,4 @@ PHORONIX TEST SUITE EXPERIMENTAL CHANGE-LOG
Phoronix Test Suite
- pts-core: Change test/suite type strings to define statements
+- pts-core: Add test type caching support
diff --git a/pts-core/functions/pts-functions.php b/pts-core/functions/pts-functions.php
index 88ebb08..a1dfdb0 100644
--- a/pts-core/functions/pts-functions.php
+++ b/pts-core/functions/pts-functions.php
@@ -68,14 +68,22 @@ if(function_exists("pts_module_start_process"))
function pts_test_type($identifier)
{
// Determine type of test based on identifier
-
- $test_type = false;
- if(!empty($identifier))
+ if(isset($GLOBALS["PTS_VAR_CACHE"]["TEST_TYPE"][$identifier]))
+ {
+ $test_type = $GLOBALS["PTS_VAR_CACHE"]["TEST_TYPE"][$identifier];
+ }
+ else
{
- if(is_file(XML_PROFILE_DIR . $identifier . ".xml"))
- $test_type = TYPE_TEST;
- else if(is_file(XML_SUITE_DIR . $identifier . ".xml"))
- $test_type = TYPE_TEST_SUITE;
+ $test_type = false;
+ if(!empty($identifier))
+ {
+ if(is_file(XML_PROFILE_DIR . $identifier . ".xml"))
+ $test_type = TYPE_TEST;
+ else if(is_file(XML_SUITE_DIR . $identifier . ".xml"))
+ $test_type = TYPE_TEST_SUITE;
+
+ $GLOBALS["PTS_VAR_CACHE"]["TEST_TYPE"][$identifier] = $test_type;
+ }
}
return $test_type;