Exclude demo tests

This commit is contained in:
Bharat Mediratta
2008-11-01 09:02:24 +00:00
parent f8b4c66906
commit 08f9822b72
2 changed files with 14 additions and 1 deletions

View File

@@ -22,6 +22,17 @@ class Test_Controller extends Controller {
if (!defined('TEST_MODE')) {
print Kohana::show_404();
}
// Find all tests, excluding sample tests that come with the unit_test module.
$paths = array(APPPATH . "tests");
foreach (glob(MODPATH . "*/tests") as $path) {
if ($path != MODPATH . "unit_test/tests") {
$paths[] = $path;
}
}
Kohana::config_set('unit_test.paths', $paths);
$test = new Unit_Test(DOCROOT . "modules/gallery_unit_test/tests");
echo $test;
}

View File

@@ -51,8 +51,10 @@ foreach ($results as $class => $methods) {
}
printf(">> TOTAL\t%s: %.2f%%\t%s: %d\t%s: %d\t%s: %d\t%s: %d\n",
Kohana::lang("unit_test.score"), 100 * ($totals["passed"] / $totals["total"]),
Kohana::lang("unit_test.score"),
($totals["total"] ? 100 * ($totals["passed"] / $totals["total"]) : 0),
Kohana::lang("unit_test.total"), $totals["total"],
Kohana::lang("unit_test.passed"), $totals["passed"],
Kohana::lang("unit_test.failed"), $totals["failed"],
Kohana::lang("unit_test.errors"), $totals["errors"]);