function &get_group_tests($tablo) { $g =& new TestSuite("All Tests"); foreach ($tablo as $plugin => $tests) { $o =& new TestSuite($plugin . ' Tests'); foreach ($tests as $c => $t) { add_test_to_group($t, $c, array('group' => &$o, 'path' => $GLOBALS['config']['plugins_root'] . ($plugin == 'Codendi' ? 'tests' : $plugin) . $GLOBALS['config']['tests_root'])); } $g->add($o); } return $g; }
function add_test_to_group($test, $categ, $params) { if (is_array($test)) { if ($categ != '_tests') { $g =& new GroupTest($categ . ' Results'); foreach ($test as $c => $t) { add_test_to_group($t, $c, array('group' => &$g, 'path' => $params['path'] . "/{$categ}/")); } $params['group']->addTestCase($g); } else { foreach ($test as $t) { $params['group']->addTestFile($params['path'] . '/' . $t); } } } else { if ($test) { $params['group']->addTestFile($params['path'] . $categ); } } }