summaryrefslogtreecommitdiffstats
path: root/pts-core/functions
diff options
context:
space:
mode:
authorMichael Larabel <michael@phx-laptop.(none)>2008-11-29 17:56:56 -0500
committerMichael Larabel <michael@phx-laptop.(none)>2008-11-29 17:56:56 -0500
commit1180e121b7e89d66c03e739f76ef9fec7e03a5d5 (patch)
tree4c024102a9b17949e9b0e3f1e85fd41bb233bbbb /pts-core/functions
parentdf552f28054a3291643162838cfae1e7da5574de (diff)
downloadphoronix-test-suite-upstream-1180e121b7e89d66c03e739f76ef9fec7e03a5d5.tar.gz
phoronix-test-suite-upstream-1180e121b7e89d66c03e739f76ef9fec7e03a5d5.tar.xz
phoronix-test-suite-upstream-1180e121b7e89d66c03e739f76ef9fec7e03a5d5.zip
pts-core: Rework the pts_run_option interface to set options to run next
pts-core: Change benchmark option to using the revised pts_run_option interface to avoid double pts-core initalization
Diffstat (limited to 'pts-core/functions')
-rw-r--r--pts-core/functions/pts-functions.php38
1 files changed, 28 insertions, 10 deletions
diff --git a/pts-core/functions/pts-functions.php b/pts-core/functions/pts-functions.php
index e80bb3b..5319549 100644
--- a/pts-core/functions/pts-functions.php
+++ b/pts-core/functions/pts-functions.php
@@ -64,16 +64,6 @@ define("TEST_RESOURCE_LOCAL_CTP_BASE_DIR", TEST_RESOURCE_LOCAL_DIR . "base/");
// Phoronix Test Suite - Functions
function pts_run_option_command($command, $pass_args = null, $command_descriptor = "")
{
- if(empty($command_descriptor))
- {
- $command_descriptor = $command;
- }
- if(!empty($pass_args) && !is_array($pass_args))
- {
- $pass_args = array($pass_args);
- }
- $command = strtolower($command);
-
pts_clear_assignments();
pts_set_assignment(array("START_TIME", "THIS_OPTION_IDENTIFIER"), time()); // For now THIS_OPTION_IDENTIFIER is also time
pts_set_assignment("COMMAND", $command_descriptor);
@@ -91,6 +81,34 @@ function pts_run_option_command($command, $pass_args = null, $command_descriptor
}
pts_clear_assignments();
}
+function pts_run_option_next($command = false, $pass_args = null, $command_descriptor = "")
+{
+ static $options;
+ $return = null;
+
+ if(!is_array($options))
+ {
+ $options = array();
+ }
+
+ if($command == false)
+ {
+ if(count($options) == 0)
+ {
+ $return = false;
+ }
+ else
+ {
+ $return = array_shift($options);
+ }
+ }
+ else
+ {
+ array_push($options, new pts_run_option($command, $pass_args, $command_descriptor));
+ }
+
+ return $return;
+}
function p_str($str_o)
{
// $_ENV["LANG"]