Summary
Description: Phoronix Test Suite open-source benchmarking development
Last Change: Fri 5/17/13 22:52
Recent Commits
>
--git a/pts-core/functions/pts-functions.php b/pts-core/functions/pts-functions.php
index 3f853bd..349e2be 100644
--- a/pts-core/functions/pts-functions.php
+++ b/pts-core/functions/pts-functions.php
@@ -248,7 +248,7 @@ function pts_process_active($process)
}
function display_web_browser($URL)
{
- $view_results = pts_bool_question("Do you want to view the results in your web browser (y/N)?", false);
+ $view_results = pts_bool_question("Do you want to view the results in your web browser (y/N)?", false, "OPEN_BROWSER");
if($view_results)
shell_exec("firefox $URL &");
@@ -361,11 +361,27 @@ function pts_trim_double($double, $accuracy = 2)
return $return;
}
-function pts_bool_question($question, $default = true)
+function pts_bool_question($question, $default = true, $question_id = "UNKNOWN")
{
if(defined("PTS_BATCH_MODE"))
{
- $answer = $default;
+ switch($question_id)
+ {
+ case "SAVE_RESULTS":
+ $auto_answer = pts_read_user_config("PhoronixTestSuite/Options/BatchMode/SaveResults", "TRUE");
+ break;
+ case "OPEN_BROWSER":
+ $auto_answer = pts_read_user_config("PhoronixTestSuite/Options/BatchMode/OpenBrowser", "FALSE");
+ break;
+ case "UPLOAD_RESULTS":
+ $auto_answer = pts_read_user_config("PhoronixTestSuite/Options/BatchMode/UploadResults", "TRUE");
+ break;
+ }
+
+ if(isset($auto_answer))
+ $answer = $auto_answer == "TRUE" || $auto_answer == "1";
+ else
+ $answer = $default;
}
else
{
diff --git a/pts-core/functions/pts-functions_config.php b/pts-core/functions/pts-functions_config.php
index afd93fd..4291044 100644
--- a/pts-core/functions/pts-functions_config.php
+++ b/pts-core/functions/pts-functions_config.php
@@ -22,7 +22,9 @@ function pts_user_config_init()
$config->addXmlObject("PhoronixTestSuite/Options/Benchmarking/EnvironmentDirectory", 2, pts_read_user_config("PhoronixTestSuite/Options/Benchmarking/EnvironmentDirectory", "~/pts-benchmark-env/", $read_config));
$config->addXmlObject("PhoronixTestSuite/Options/Benchmarking/SleepTimeBetweenTests", 2, pts_read_user_config("PhoronixTestSuite/Options/Benchmarking/SleepTimeBetweenTests", "5", $read_config));
- $config->addXmlObject("PhoronixTestSuite/Options/Benchmarking/SleepTimeBetweenTests", 2, pts_read_user_config("PhoronixTestSuite/Options/Benchmarking/SleepTimeBetweenTests", "5", $read_config));
+ $config->addXmlObject("PhoronixTestSuite/Options/BatchMode/SaveResults", 3, pts_read_user_config("PhoronixTestSuite/Options/BatchMode/SaveResults", "TRUE", $read_config));
+ $config->addXmlObject("PhoronixTestSuite/Options/BatchMode/OpenBrowser", 3, pts_read_user_config("PhoronixTestSuite/Options/BatchMode/OpenBrowser", "FALSE", $read_config));
+ $config->addXmlObject("PhoronixTestSuite/Options/BatchMode/UploadResults", 3, pts_read_user_config("PhoronixTestSuite/Options/BatchMode/UploadResults", "TRUE", $read_config));
file_put_contents(PTS_USER_DIR . "user-config.xml", $config->getXML());
}
diff --git a/pts-core/pts-run-benchmark.php b/pts-core/pts-run-benchmark.php
index d5c32f2..73504a4 100644
--- a/pts-core/pts-run-benchmark.php
+++ b/pts-core/pts-run-benchmark.php
@@ -74,7 +74,7 @@ if(!$TO_RUN_TYPE)
}
else
{
- $SAVE_RESULTS = pts_bool_question("Would you like to save these benchmark results (Y/n)?");
+ $SAVE_RESULTS = pts_bool_question("Would you like to save these benchmark results (Y/n)?", true, "SAVE_RESULTS");
if($SAVE_RESULTS)
echo "Benchmark results will be saved.\n";
@@ -244,7 +244,7 @@ if($SAVE_RESULTS)
echo "Results Saved To: " . SAVE_RESULTS_LOCATION . "$PROPOSED_FILE_NAME.xml\n";
display_web_browser(SAVE_RESULTS_LOCATION . "$PROPOSED_FILE_NAME.xml");
- $upload_results = pts_bool_question("Would you like to upload these results to PTS Global (Y/n)?", true);
+ $upload_results = pts_bool_question("Would you like to upload these results to PTS Global (Y/n)?", true, "UPLOAD_RESULTS");
if($upload_results)
echo "Results Uploaded To: " . pts_global_upload_result(SAVE_RESULTS_LOCATION . "$PROPOSED_FILE_NAME.xml") . "\n";
<
Copyright © 2013 by Phoronix Media