* refactored the foo* model entities into a different package
[vsc.git] / run-tests.php
blob5443fcb2a5c9f0f5bda9cda30c01c8c45cd33e30
1 #!/usr/bin/php
2 <?php
3 //require_once ('./_tests/config.inc.php');
4 //require_once ('./_res/config.inc.php');
5 //include ('_lib/functions.inc.php');
6 include ('vsc.inc.php');
8 set_error_handler('exceptions_error_handler');
9 include ('_tests/config.inc.php');
10 try {
11 import ('imported/simpletest');
12 require_once ('unit_tester.php');
13 require_once ('mock_objects.php');
14 require_once ('collector.php');
15 require_once ('default_reporter.php');
16 } catch (tsExceptionPackageImport $e) {
17 // problems with the simpletest imported package
18 echo $e->getMessage() . "\n";
21 try {
22 usingPackage ('tests');
23 $result = tsUnitTest::execute ($_SERVER['argc'], $_SERVER['argv']);
24 } catch (tsExceptionPackageImport $e) {
25 // could not import the tests package
26 echo $e->getMessage() . "\n";
27 echo $e->getFile() . ' - ' .$e->getLine () ."\n";
28 echo $e->getTraceAsString();
29 exit (1);
30 } catch (tsExceptionAutoload $e) {
31 // could not load the tsUnitTest class
32 echo $e->getMessage() . "\n";
33 exit (1);
36 if (SimpleReporter::inCli()) {
37 exit ($result ? 0 : 1);