diff options
author | Michael Larabel <michael@phx-laptop.(none)> | 2008-09-11 21:00:02 -0400 |
---|---|---|
committer | Michael Larabel <michael@phx-laptop.(none)> | 2008-09-11 21:00:02 -0400 |
commit | 38dd3e138712c1e8f59eeb977f42dcb8a9e64c71 (patch) | |
tree | 6bd1d3af1c9d1d1f3f469b65b615de878672594b | |
parent | 8aafc741b1c12da38facdf0689d26d26df39e5ea (diff) | |
download | phoronix-test-suite-upstream-38dd3e138712c1e8f59eeb977f42dcb8a9e64c71.tar.gz phoronix-test-suite-upstream-38dd3e138712c1e8f59eeb977f42dcb8a9e64c71.tar.xz phoronix-test-suite-upstream-38dd3e138712c1e8f59eeb977f42dcb8a9e64c71.zip |
pts-core: Switch the recurse-based test verify installation function to
using the new type handler
-rw-r--r-- | pts-core/functions/pts-functions-run.php | 57 |
1 files changed, 14 insertions, 43 deletions
diff --git a/pts-core/functions/pts-functions-run.php b/pts-core/functions/pts-functions-run.php index 718cb40..7dd004c 100644 --- a/pts-core/functions/pts-functions-run.php +++ b/pts-core/functions/pts-functions-run.php @@ -135,8 +135,21 @@ function pts_prompt_save_file_name($check_env = true) function pts_verify_test_installation($TO_RUN) { // Verify a test is installed + $tests = pts_test_objects($TO_RUN); $needs_installing = array(); - pts_recurse_verify_installation($TO_RUN, $needs_installing); + + foreach($tests as $test) + { + if(!is_file(TEST_ENV_DIR . $test . "/pts-install.xml")) + { + array_push($needs_installing, $test); + } + else + { + if(!defined("TEST_INSTALL_PASS")) + define("TEST_INSTALL_PASS", true); + } + } if(count($needs_installing) > 0) { @@ -161,48 +174,6 @@ function pts_verify_test_installation($TO_RUN) pts_exit(); } } -function pts_recurse_verify_installation($TO_VERIFY, &$NEEDS_INSTALLING) -{ - // Verify tests are installed - $type = pts_test_type($TO_VERIFY); - - if($type == TYPE_TEST) - { - if(!is_file(TEST_ENV_DIR . $TO_VERIFY . "/pts-install.xml")) - array_push($NEEDS_INSTALLING, $TO_VERIFY); - else - { - if(!defined("TEST_INSTALL_PASS")) - define("TEST_INSTALL_PASS", true); - } - } - else if($type == TYPE_TEST_SUITE) - { - $xml_parser = new tandem_XmlReader(XML_SUITE_DIR . $TO_VERIFY . ".xml"); - $tests_in_suite = $xml_parser->getXMLArrayValues(P_SUITE_TEST_NAME); - - foreach($tests_in_suite as $test) - pts_recurse_verify_installation($test, $NEEDS_INSTALLING); - } - else if(is_file(pts_input_correct_results_path($TO_VERIFY))) - { - $xml_parser = new tandem_XmlReader(pts_input_correct_results_path($TO_VERIFY)); - $tests_in_suite = $xml_parser->getXMLArrayValues(P_RESULTS_TEST_TESTNAME); - - foreach($tests_in_suite as $test) - pts_recurse_verify_installation($test, $NEEDS_INSTALLING); - } - else if(pts_is_global_id($TO_VERIFY)) - { - $xml_parser = new tandem_XmlReader(pts_global_download_xml($TO_VERIFY)); - $tests_in_suite = $xml_parser->getXMLArrayValues(P_RESULTS_TEST_TESTNAME); - - foreach($tests_in_suite as $test) - pts_recurse_verify_installation($test, $NEEDS_INSTALLING); - } - //else - // echo "\nNot recognized: $TO_VERIFY.\n"; -} function pts_recurse_call_tests($tests_to_run, $arguments_array, $save_results = false, &$tandem_xml = "", $results_identifier = "", $arguments_description = "") { // Call the tests |