FOSSology  3.2.0rc1
Open Source License Compliance by Open Source Software
runVerifyUploadsTests.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 global $home;
37 
38 class verifyUploadsTest extends TestSuite
39 {
40  function __construct($label=FALSE)
41  {
42  parent::__construct($label);
43  global $home;
44 
45  //echo "runVU is at:" . getcwd() . "\n";
46  if(chdir( '../ui/tests') === FALSE )
47  {
48  echo "FATAL! Cannot cd to the ui/tests directory\n";
49  exit(1);
50  }
51  $testPath = getcwd();
52  // Verify uploads
53  $this->collect($testPath . '/VerifyTests',
54  new SimplePatternCollector('/Test.php/'));
55 
56  if (chdir($home) === FALSE)
57  {
58  $cUInoHome = "FATAL! can't cd to $home\n";
59  //LogAndPrint($LF, $cUInoHome);
60  echo $cUInoHome;
61  exit(1);
62  }
63  // nomos, only 2 major tests right now, just add them.
64  // @todo when there are more nomos tests, change to pattern expectation.
65  $this->addTestFile('nomos/ckZendTest.php');
66  $this->addTestFile('nomos/verifyRedHatTest.php');
67  $this->addTestFile('copyright/verify3filesTest.php');
68  }
69 }
70 
71 $home = getcwd();
72 
73 // collect the verify tests
74 $testRun = new verifyUploadsTest('Fossology Upload Functional Tests');
75 
76 // run the collected tests
77 $testRun->run(new JUnitXMLReporter());
78 
79 // Need to seperate the reports in the file...
80 ?>