FOSSology  3.2.0rc1
Open Source License Compliance by Open Source Software
myrun.php
1 #!/usr/bin/php
2 <?php
3 /***********************************************************
4  Copyright (C) 2008 Hewlett-Packard Development Company, L.P.
5 
6  This program is free software; you can redistribute it and/or
7  modify it under the terms of the GNU General Public License
8  version 2 as published by the Free Software Foundation.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License along
16  with this program; if not, write to the Free Software Foundation, Inc.,
17  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18  ***********************************************************/
19 
30 $path = '/usr/local/simpletest' . PATH_SEPARATOR;
31 set_include_path(get_include_path() . PATH_SEPARATOR . $path);
32 if (!defined('SIMPLE_TEST'))
33  define('SIMPLE_TEST', '/usr/local/simpletest/');
34 
35 /* simpletest includes */
36 require_once SIMPLE_TEST . 'unit_tester.php';
37 require_once SIMPLE_TEST . 'reporter.php';
38 require_once SIMPLE_TEST . 'web_tester.php';
39 
40 require_once ('TestEnvironment.php');
41 
42 $test = new TestSuite("Sample Fossology test");
43 $test->addTestFile('mytest.php');
44 /*
45  * leave the code below alone, it allows the tests to be run either by
46  * the cli or in a web browser
47  */
48 if (TextReporter :: inCli())
49 {
50  exit ($test->run(new TextReporter()) ? 0 : 1);
51 }
52 $test->run(new HtmlReporter());
53 ?>