FOSSology  4.4.0
Open Source License Compliance by Open Source Software
runVerifyUploadsTests.php
1 #!/usr/bin/php
2 <?php
3 /*
4  SPDX-FileCopyrightText: © 2011 Hewlett-Packard Development Company, L.P.
5 
6  SPDX-License-Identifier: GPL-2.0-only
7 */
18 /* simpletest includes */
19 require_once '/usr/local/simpletest/unit_tester.php';
20 require_once '/usr/local/simpletest/collector.php';
21 require_once '/usr/local/simpletest/web_tester.php';
22 require_once '/usr/local/simpletest/reporter.php';
23 require_once '/usr/local/simpletest/extensions/junit_xml_reporter.php';
24 
25 global $home;
26 
27 class verifyUploadsTest extends TestSuite
28 {
29  function __construct($label=FALSE)
30  {
31  parent::__construct($label);
32  global $home;
33 
34  //echo "runVU is at:" . getcwd() . "\n";
35  if(chdir( '../ui/tests') === FALSE )
36  {
37  echo "FATAL! Cannot cd to the ui/tests directory\n";
38  exit(1);
39  }
40  $testPath = getcwd();
41  // Verify uploads
42  $this->collect($testPath . '/VerifyTests',
43  new SimplePatternCollector('/Test.php/'));
44 
45  if (chdir($home) === FALSE)
46  {
47  $cUInoHome = "FATAL! can't cd to $home\n";
48  //LogAndPrint($LF, $cUInoHome);
49  echo $cUInoHome;
50  exit(1);
51  }
52  // nomos, only 2 major tests right now, just add them.
53  // @todo when there are more nomos tests, change to pattern expectation.
54  $this->addTestFile('nomos/ckZendTest.php');
55  $this->addTestFile('nomos/verifyRedHatTest.php');
56  $this->addTestFile('copyright/verify3filesTest.php');
57  }
58 }
59 
60 $home = getcwd();
61 
62 // collect the verify tests
63 $testRun = new verifyUploadsTest('Fossology Upload Functional Tests');
64 
65 // run the collected tests
66 $testRun->run(new JUnitXMLReporter());
67 
68 // Need to seperate the reports in the file...