+ added functions unit testing
[vsc.git] / run-tests.php
blobd835173d19f474568663ca57adf1ca903fff2e5d
1 #!/usr/bin/php
2 <?php
3 include ('vsc.inc.php');
5 set_error_handler('exceptions_error_handler');
6 include ('_tests/config.inc.php');
7 try {
8 import ('imported/simpletest');
9 require_once ('unit_tester.php');
10 require_once ('mock_objects.php');
11 require_once ('collector.php');
12 require_once ('default_reporter.php');
13 } catch (tsExceptionPackageImport $e) {
14 // problems with the simpletest imported package
15 echo $e->getMessage() . "\n";
18 try {
19 usingPackage ('tests');
20 $result = tsUnitTest::execute ($_SERVER['argc'], $_SERVER['argv']);
21 } catch (tsExceptionPackageImport $e) {
22 // could not import the tests package
23 echo $e->getMessage() . "\n";
24 echo $e->getFile() . ' - ' .$e->getLine () ."\n";
25 echo $e->getTraceAsString();
26 exit (1);
27 } catch (tsExceptionAutoload $e) {
28 // could not load the tsUnitTest class
29 echo $e->getMessage() . "\n";
30 exit (1);
33 if (SimpleReporter::inCli()) {
34 exit ($result ? 0 : 1);