diff options
author | Michael Larabel <michael@phx-laptop.(none)> | 2008-12-08 08:23:27 -0500 |
---|---|---|
committer | Michael Larabel <michael@phx-laptop.(none)> | 2008-12-08 08:23:27 -0500 |
commit | a2e5b29ccbf3d976d3a9cbd48cc52169b02cacc2 (patch) | |
tree | 29569d78f3f463c5b7c3e9cc33cc59c7d2d6f6ff | |
parent | ce2ac86de2b21184af90be394a262a18f6efc52b (diff) | |
download | phoronix-test-suite-upstream-a2e5b29ccbf3d976d3a9cbd48cc52169b02cacc2.tar.gz phoronix-test-suite-upstream-a2e5b29ccbf3d976d3a9cbd48cc52169b02cacc2.tar.xz phoronix-test-suite-upstream-a2e5b29ccbf3d976d3a9cbd48cc52169b02cacc2.zip |
pts-core: Switch IS_BATCH_MODE from using defines to PTS assignment
functions
-rw-r--r-- | TYDAL-CHANGE-LOG | 1 | ||||
-rw-r--r-- | pts-core/functions/pts-functions-install.php | 2 | ||||
-rw-r--r-- | pts-core/functions/pts-functions-run.php | 6 | ||||
-rw-r--r-- | pts-core/functions/pts-functions.php | 2 | ||||
-rw-r--r-- | pts-core/functions/pts-functions_io.php | 2 | ||||
-rw-r--r-- | pts-core/functions/pts-init.php | 10 | ||||
-rw-r--r-- | pts-core/options/run_test.php | 14 |
7 files changed, 17 insertions, 20 deletions
diff --git a/TYDAL-CHANGE-LOG b/TYDAL-CHANGE-LOG index 74b2a19..fc3304c 100644 --- a/TYDAL-CHANGE-LOG +++ b/TYDAL-CHANGE-LOG @@ -18,6 +18,7 @@ Phoronix Test Suite (Git) - pts-core: Allow multiple tests/suites/identifiers to be passed using the run and benchmark options - pts-core: Add pts_result_file object - pts-core: Add DefaultEntry tag to XML test specification for specifying defaults mode +- pts-core: Switch IS_BATCH_MODE from using defines to PTS assignment functions - pts: Remove bonnie test profile until clarifications made - pts: Add filesystem test suite - pts: Add jxrendermark as new X Render benchmark test profile diff --git a/pts-core/functions/pts-functions-install.php b/pts-core/functions/pts-functions-install.php index 4348b7a..0660394 100644 --- a/pts-core/functions/pts-functions-install.php +++ b/pts-core/functions/pts-functions-install.php @@ -173,7 +173,7 @@ function pts_download_test_files($identifier) do { - if(!IS_BATCH_MODE && pts_string_bool(pts_read_user_config(P_OPTION_PROMPT_DOWNLOADLOC, "FALSE")) && count($urls) > 1) + if(getenv("PTS_BATCH_MODE") == false && pts_string_bool(pts_read_user_config(P_OPTION_PROMPT_DOWNLOADLOC, "FALSE")) && count($urls) > 1) { // Prompt user to select mirror do diff --git a/pts-core/functions/pts-functions-run.php b/pts-core/functions/pts-functions-run.php index bce9ef2..5315e59 100644 --- a/pts-core/functions/pts-functions-run.php +++ b/pts-core/functions/pts-functions-run.php @@ -27,7 +27,7 @@ function pts_prompt_results_identifier($current_identifiers = null) $RESULTS_IDENTIFIER = null; $show_identifiers = array(); - if(!IS_BATCH_MODE || pts_read_user_config(P_OPTION_BATCH_PROMPTIDENTIFIER, "TRUE") == "TRUE") + if(pts_read_assignment("IS_BATCH_MODE") == false || pts_read_user_config(P_OPTION_BATCH_PROMPTIDENTIFIER, "TRUE") == "TRUE") { if(is_array($current_identifiers) && count($current_identifiers) > 0) { @@ -381,7 +381,7 @@ function pts_prompt_save_file_name($check_env = true, $to_run) } } - if(!IS_BATCH_MODE || pts_read_user_config(P_OPTION_BATCH_PROMPTSAVENAME, "FALSE") == "TRUE") + if(pts_read_assignment("IS_BATCH_MODE") == false || pts_read_user_config(P_OPTION_BATCH_PROMPTSAVENAME, "FALSE") == "TRUE") { $is_reserved_word = pts_is_test($PROPOSED_FILE_NAME) || pts_is_suite($PROPOSED_FILE_NAME); @@ -441,7 +441,7 @@ function pts_promt_user_tags($default_tags = "") { $tags_input = ""; - if(!IS_BATCH_MODE) + if(pts_read_assignment("IS_BATCH_MODE") == false) { echo "\nTags are optional and used on Phoronix Global for making it easy to share, search, and organize test results. Example tags could be the type of test performed (i.e. WINE tests) or the hardware used (i.e. Dual Core SMP).\n\nEnter the tags you wish to provide (separated by commas): "; $tags_input .= fgets(STDIN); diff --git a/pts-core/functions/pts-functions.php b/pts-core/functions/pts-functions.php index 4493157..9cb43a4 100644 --- a/pts-core/functions/pts-functions.php +++ b/pts-core/functions/pts-functions.php @@ -500,7 +500,7 @@ function pts_user_message($message) { echo $message . "\n"; - if(!IS_BATCH_MODE) + if(pts_read_assignment("IS_BATCH_MODE") == false) { echo "\nHit Any Key To Continue...\n"; fgets(STDIN); diff --git a/pts-core/functions/pts-functions_io.php b/pts-core/functions/pts-functions_io.php index ce19629..5d74770 100644 --- a/pts-core/functions/pts-functions_io.php +++ b/pts-core/functions/pts-functions_io.php @@ -53,7 +53,7 @@ function pts_text_select_menu($user_string, $options_r) function pts_bool_question($question, $default = true, $question_id = "UNKNOWN") { // Prompt user for yes/no question - if(defined("IS_BATCH_MODE") && IS_BATCH_MODE) + if(pts_read_assignment("IS_BATCH_MODE") != false) { switch($question_id) { diff --git a/pts-core/functions/pts-init.php b/pts-core/functions/pts-init.php index 840afa4..27a8586 100644 --- a/pts-core/functions/pts-init.php +++ b/pts-core/functions/pts-init.php @@ -224,16 +224,6 @@ function pts_extended_init() define("IS_UNKNOWN_GRAPHICS", ($found_gpu_match == false)); - // Check for batch mode - if(getenv("PTS_BATCH_MODE") != false) - { - define("IS_BATCH_MODE", true); - } - else - { - define("IS_BATCH_MODE", false); - } - // Self-Contained Test Profile Routines if(IS_SCTP_MODE) { diff --git a/pts-core/options/run_test.php b/pts-core/options/run_test.php index 4501c77..7b020b1 100644 --- a/pts-core/options/run_test.php +++ b/pts-core/options/run_test.php @@ -27,7 +27,13 @@ class run_test implements pts_option_interface pts_load_function_set("run"); pts_load_function_set("merge"); - if(IS_BATCH_MODE && pts_read_user_config(P_OPTION_BATCH_CONFIGURED, "FALSE") == "FALSE") + // Check for batch mode + if(getenv("PTS_BATCH_MODE") != false) + { + pts_set_assignment("IS_BATCH_MODE", true); + } + + if(pts_read_assignment("IS_BATCH_MODE") != false && pts_read_user_config(P_OPTION_BATCH_CONFIGURED, "FALSE") == "FALSE") { echo pts_string_header("The batch mode must first be configured\nRun: phoronix-test-suite batch-setup"); return false; @@ -145,7 +151,7 @@ class run_test implements pts_option_interface if(pts_is_test($to_run)) { - if(IS_BATCH_MODE) + if(pts_read_assignment("IS_BATCH_MODE") != false) { $option_output = pts_generate_batch_run_options($to_run); @@ -332,7 +338,7 @@ class run_test implements pts_option_interface // Prompt Description - if(!IS_BATCH_MODE || pts_read_user_config(P_OPTION_BATCH_PROMPTDESCRIPTION, "FALSE") == "TRUE") + if(pts_read_assignment("IS_BATCH_MODE") == false || pts_read_user_config(P_OPTION_BATCH_PROMPTDESCRIPTION, "FALSE") == "TRUE") { if($unique_test_names > 1) { @@ -402,7 +408,7 @@ class run_test implements pts_option_interface if($save_results) { - if(IS_BATCH_MODE) + if(pts_read_assignment("IS_BATCH_MODE") != false) { array_push($TEST_PROPERTIES, "PTS_BATCH_MODE"); } |