diff options
author | Michael Larabel <michael@phx-laptop.(none)> | 2008-12-05 13:52:00 -0500 |
---|---|---|
committer | Michael Larabel <michael@phx-laptop.(none)> | 2008-12-05 13:52:00 -0500 |
commit | a109aa2766f33a4ec332b4e1a70095ecfce8f572 (patch) | |
tree | 40734ebcca295f945eed6c85affc4df593f22da7 /pts-core | |
parent | 2cfc561b54c8a9ac40c335be7fb8f075eb26e35a (diff) | |
download | phoronix-test-suite-upstream-a109aa2766f33a4ec332b4e1a70095ecfce8f572.tar.gz phoronix-test-suite-upstream-a109aa2766f33a4ec332b4e1a70095ecfce8f572.tar.xz phoronix-test-suite-upstream-a109aa2766f33a4ec332b4e1a70095ecfce8f572.zip |
pts-core: Allow multiple tests/suites/identifiers to be passed using the
install (and force-install) option
Diffstat (limited to 'pts-core')
-rw-r--r-- | pts-core/functions/pts-functions-install.php | 20 | ||||
-rw-r--r-- | pts-core/functions/pts-functions-install_dependencies.php | 16 | ||||
-rw-r--r-- | pts-core/options/install_dependencies.php | 1 | ||||
-rw-r--r-- | pts-core/options/install_test.php | 22 |
4 files changed, 42 insertions, 17 deletions
diff --git a/pts-core/functions/pts-functions-install.php b/pts-core/functions/pts-functions-install.php index 5e96e53..230aa35 100644 --- a/pts-core/functions/pts-functions-install.php +++ b/pts-core/functions/pts-functions-install.php @@ -23,15 +23,29 @@ require_once("pts-core/functions/pts-functions-install_dependencies.php"); -function pts_start_install($TO_INSTALL) +function pts_start_install($to_install) { + if(!is_array($to_install)) + { + $to_install = array($to_install); + } + if(IS_SCTP_MODE) { - $tests = array($TO_INSTALL); + $tests = array($to_install[0]); } else { - $tests = pts_contained_tests($TO_INSTALL, true); + $tests = array(); + + foreach($to_install as $to_install_test) + { + foreach(pts_contained_tests($to_install_test, true) as $test) + { + array_push($tests, $test); + } + } + $tests = array_unique($tests); if(count($tests) == 0) { diff --git a/pts-core/functions/pts-functions-install_dependencies.php b/pts-core/functions/pts-functions-install_dependencies.php index 2fd7274..6665099 100644 --- a/pts-core/functions/pts-functions-install_dependencies.php +++ b/pts-core/functions/pts-functions-install_dependencies.php @@ -21,7 +21,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ -function pts_install_package_on_distribution($identifier) +function pts_install_package_on_distribution($identifiers) { // PTS External Dependencies install on distribution if(pts_read_assignment("COMMAND") != "benchmark") @@ -29,9 +29,19 @@ function pts_install_package_on_distribution($identifier) echo "Checking For Needed External Dependencies.\n"; } - $identifier = strtolower($identifier); $install_objects = array(); - pts_start_install_dependencies($identifier, $install_objects); + + if(!is_array($identifiers)) + { + $identifiers = array($identifiers); + } + + foreach($identifiers as $identifier) + { + pts_start_install_dependencies($identifier, $install_objects); + } + $install_objects = array_unique($install_objects); + pts_install_packages_on_distribution_process($install_objects); } function pts_start_install_dependencies($TO_INSTALL, &$PLACE_LIST) diff --git a/pts-core/options/install_dependencies.php b/pts-core/options/install_dependencies.php index 08fc059..16341be 100644 --- a/pts-core/options/install_dependencies.php +++ b/pts-core/options/install_dependencies.php @@ -25,6 +25,7 @@ class install_dependencies implements pts_option_interface public static function run($r) { pts_load_function_set("install"); + $r = array_map("strtolower", $r); if(empty($r[0])) { diff --git a/pts-core/options/install_test.php b/pts-core/options/install_test.php index 10ab268..726563a 100644 --- a/pts-core/options/install_test.php +++ b/pts-core/options/install_test.php @@ -22,30 +22,30 @@ class install_test implements pts_option_interface { - public static function run($r) + public static function run($items_to_install) { pts_load_function_set("install"); - $test = $r[0]; - if(empty($test)) + if(count($items_to_install) == 0) { - echo "\nThe test or suite name to install must be supplied.\n"; + echo "\nThe test, suite name, or saved identifier must be supplied.\n"; } else { if(IS_SCTP_MODE) { - $test = basename($test); + $items_to_install[0] = basename($items_to_install[0]); } + $items_to_install = array_unique(array_map("strtolower", $items_to_install)); + if(pts_read_assignment("COMMAND") == "force-install") { pts_set_assignment("PTS_FORCE_INSTALL", 1); } - $test = strtolower($test); - - if(strpos($test, "pcqs") !== false && !is_file(XML_SUITE_LOCAL_DIR . "pcqs-license.txt")) + // TODO: Search $items_to_install and look for pcqs match instead of only first argument + if(strpos($items_to_install[0], "pcqs") !== false && !is_file(XML_SUITE_LOCAL_DIR . "pcqs-license.txt")) { // Install the Phoronix Certification & Qualification Suite $agreement = wordwrap(file_get_contents("http://www.phoronix-test-suite.com/pcqs/pcqs-license.txt"), 65); @@ -72,13 +72,13 @@ class install_test implements pts_option_interface } } - // Any external dependencies? echo "\n"; - pts_install_package_on_distribution($test); + // Any external dependencies? + pts_install_package_on_distribution($items_to_install); // Install tests - pts_start_install($test); + pts_start_install($items_to_install); } } } |