Skip to content

Commit

Permalink
Only install and activate modules that have tests to run.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim Almdal committed Oct 28, 2009
1 parent f16941a commit 2a21f3b
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions modules/gallery_unit_test/controllers/gallery_unit_test.php
Expand Up @@ -106,16 +106,17 @@ function Index() {

module::install("user");
module::activate("user");
$modules = $paths =array();
foreach ($active_modules as $module) {
if (file_exists($path = MODPATH . "{$module->name}/tests")) {
$paths[] = $path;
}
if (in_array($module->name, array("gallery", "user"))) {
$modules = $paths = array();
foreach (module::available() as $module_name => $unused) {
if (in_array($module_name, array("gallery", "user"))) {
$paths[] = MODPATH . "{$module_name}/tests";
continue;
}
module::install($module->name);
module::activate($module->name);
if (file_exists($path = MODPATH . "{$module_name}/tests")) {
$paths[] = $path;
module::install($module_name);
module::activate($module_name);
}
}

Kohana::config_set('unit_test.paths', $paths);
Expand Down

0 comments on commit 2a21f3b

Please sign in to comment.