projects / phoronix-test-suite.git / commitdiff
Build Results
 
Summary

Description: Phoronix Test Suite open-source benchmarking development
Last Change: Fri 11/21/14 15:52

Recent Commits
Time
Signed-Off By
Description
Commit Diff
Fri 11/21/14 15:52
Michael Larabel  
phoromatic: Fix salted... 
Fri 11/21/14 10:56
Michael Larabel  
 
Fri 11/21/14 10:52
Michael Larabel  
phoromatic: Allow... 
Fri 11/21/14 10:34
Michael Larabel  
phoromatic: Add... 
Wed 11/19/14 9:58
Michael Larabel  
pts-core: Assume http://... 
Wed 11/19/14 9:53
Michael Larabel  
pts-core: Check for file... 
 
> --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,+248,@@ 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,+22,@@ function pts_user_config_init()
     
$config->addXmlObject("PhoronixTestSuite/Options/Benchmarking/EnvironmentDirectory"2pts_read_user_config("PhoronixTestSuite/Options/Benchmarking/EnvironmentDirectory""~/pts-benchmark-env/"$read_config));
     
$config->addXmlObject("PhoronixTestSuite/Options/Benchmarking/SleepTimeBetweenTests"2pts_read_user_config("PhoronixTestSuite/Options/Benchmarking/SleepTimeBetweenTests""5"$read_config));

-    
$config->addXmlObject("PhoronixTestSuite/Options/Benchmarking/SleepTimeBetweenTests"2pts_read_user_config("PhoronixTestSuite/Options/Benchmarking/SleepTimeBetweenTests""5"$read_config));
+    
$config->addXmlObject("PhoronixTestSuite/Options/BatchMode/SaveResults"3pts_read_user_config("PhoronixTestSuite/Options/BatchMode/SaveResults""TRUE"$read_config));
+    
$config->addXmlObject("PhoronixTestSuite/Options/BatchMode/OpenBrowser"3pts_read_user_config("PhoronixTestSuite/Options/BatchMode/OpenBrowser""FALSE"$read_config));
+    
$config->addXmlObject("PhoronixTestSuite/Options/BatchMode/UploadResults"3pts_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,+74,@@ 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,+244,@@ 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";
<
 
Phoronix.com
Linux Driver Forums
Copyright © 2014 by Phoronix Media