FOSSology  3.2.0rc1
Open Source License Compliance by Open Source Software
runFunctionalTests.php
1 #!/usr/bin/php
2 <?php
3 /***********************************************************
4  Copyright (C) 2011 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  ***********************************************************/
29 /* simpletest includes */
30 require_once '/usr/local/simpletest/unit_tester.php';
31 require_once '/usr/local/simpletest/collector.php';
32 require_once '/usr/local/simpletest/web_tester.php';
33 require_once '/usr/local/simpletest/reporter.php';
34 require_once '/usr/local/simpletest/extensions/junit_xml_reporter.php';
35 
36 class groupFuncTests extends TestSuite
37 {
38  function __construct($label=FALSE)
39  {
40  parent::__construct($label);
41  // run createUIUsers first
42  $this->addTestFile('createUIUsers.php');
43  if(chdir( '../ui/tests') === FALSE )
44  {
45  echo "FATAL! Cannot cd to the ui/tests directory\n";
46  }
47  $testPath = getcwd();
48  //echo "RFTCLASS: testPath is:$testPath\n";
49 
50  $this->collect($testPath . '/SiteTests',
51  new SimplePatternCollector('/Test.php/'));
52  // BasicSetup Must be run before any of the BasicTests, they depend on it.
53  $this->addTestFile('BasicTests/BasicSetup.php');
54  $this->collect($testPath . '/BasicTests',
55  new SimplePatternCollector('/Test.php/'));
56  $this->collect($testPath . '/Users',
57  new SimplePatternCollector('/Test.php/'));
58  $this->collect($testPath . '/EmailNotification',
59  new SimplePatternCollector('/Test.php/'));
60  if(chdir( '../../tests') === FALSE )
61  {
62  echo "FATAL! Cannot cd to the ../../tests directory\n";
63  }
64  }
65 }
66 
67 // collect the tests
68 $testRun = new groupFuncTests('Fossology UI Functional Tests');
69 
70 // run the collected tests
71 $testRun->run(new JUnitXMLReporter());
72 ?>
Run the simpletest FOSSology functional tests.