diff options
author | Michael Larabel <michael@phx-laptop.(none)> | 2008-11-20 21:16:22 -0500 |
---|---|---|
committer | Michael Larabel <michael@phx-laptop.(none)> | 2008-11-20 21:16:22 -0500 |
commit | b4bc4d902cc65d39dda6ceaa4b4bdd7543579e1e (patch) | |
tree | 93a3d03cd9c74bae97a3791bcd47ac5f44d5dc56 /pts-core/functions/pts-functions-run.php | |
parent | e23ce796e67fbe7f475dc958061503ff5e238801 (diff) | |
download | phoronix-test-suite-upstream-b4bc4d902cc65d39dda6ceaa4b4bdd7543579e1e.tar.gz phoronix-test-suite-upstream-b4bc4d902cc65d39dda6ceaa4b4bdd7543579e1e.tar.xz phoronix-test-suite-upstream-b4bc4d902cc65d39dda6ceaa4b4bdd7543579e1e.zip |
pts-core: Finish eliminating use of all global variables throughout
pts-core
Diffstat (limited to 'pts-core/functions/pts-functions-run.php')
-rw-r--r-- | pts-core/functions/pts-functions-run.php | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/pts-core/functions/pts-functions-run.php b/pts-core/functions/pts-functions-run.php index d6168c0..a1caa36 100644 --- a/pts-core/functions/pts-functions-run.php +++ b/pts-core/functions/pts-functions-run.php @@ -176,8 +176,32 @@ function pts_promt_user_tags($default_tags = "") } function pts_add_test_note($note) { - if(!empty($note) && !in_array($note, $GLOBALS["TEST_NOTES_ARRAY"])) - array_push($GLOBALS["TEST_NOTES_ARRAY"], $note); + pts_test_note("ADD", $note); +} +function pts_test_note($process, $value = null) +{ + static $note_r; + $return = null; + + if(empty($note_r)) + { + $note_r = array(); + } + + switch($process) + { + case "ADD": + if(!empty($value) && !in_array($value, $note_r)) + { + array_push($note_r, $value); + } + break; + case "TO_STRING": + $return = implode(". \n", $note_r); + break; + } + + return $return; } function pts_generate_test_notes($test_type) { @@ -247,7 +271,7 @@ function pts_generate_test_notes($test_type) } } - return implode(". \n", $GLOBALS["TEST_NOTES_ARRAY"]); + return pts_test_note("TO_STRING"); } function pts_input_string_to_identifier($input) { @@ -642,7 +666,7 @@ function pts_run_test($test_identifier, $extra_arguments = "", $arguments_descri if(!empty($RETURN_STRING)) { echo $this_result = pts_string_header($RETURN_STRING, "#"); - $GLOBALS["TEST_RESULTS_TEXT"] .= $this_result; + pts_text_save_buffer($this_result); } else { |