Commit 50efcd8efbea41668c05dd5eb24af4a383d22799
1 parent
5e7024d8
All-in-one test runner.
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@5399 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
27 additions
and
0 deletions
tests/runtests.php
0 → 100644
| 1 | +<?php | |
| 2 | + | |
| 3 | +require_once('test.php'); | |
| 4 | + | |
| 5 | +class UnitTests extends GroupTest { | |
| 6 | + function UnitTests() { | |
| 7 | + $this->GroupTest('Unit tests'); | |
| 8 | + $this->addTestFile('SQLFile/test_sqlfile.php'); | |
| 9 | + $this->addTestFile('cache/testCache.php'); | |
| 10 | + $this->addTestFile('config/testConfig.php'); | |
| 11 | + $this->addTestFile('document/testDocument.php'); | |
| 12 | + } | |
| 13 | + | |
| 14 | + function addTestFile($file) { | |
| 15 | + if (!KTUtil::isAbsolutePath($file)) { | |
| 16 | + $file = sprintf('%s/%s', dirname(__FILE__), $file); | |
| 17 | + } | |
| 18 | + return parent::addTestFile($file); | |
| 19 | + } | |
| 20 | +} | |
| 21 | + | |
| 22 | +$test = &new UnitTests(); | |
| 23 | +if (SimpleReporter::inCli()) { | |
| 24 | + exit ($test->run(new TextReporter()) ? 0 : 1); | |
| 25 | +} | |
| 26 | +$test->run(new HtmlReporter()); | |
| 27 | + | ... | ... |