FOSSology  3.2.0rc1
Open Source License Compliance by Open Source Software
runSiteTests.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 /*
20  * Runner script that runs the web tests
21  */
22 // set the path for where simpletest is
23 $path = '/usr/share/php' . PATH_SEPARATOR;
24 set_include_path(get_include_path() . PATH_SEPARATOR . $path);
25 
26 /* simpletest includes */
27 require_once '/usr/local/simpletest/unit_tester.php';
28 require_once '/usr/local/simpletest/web_tester.php';
29 require_once '/usr/local/simpletest/reporter.php';
30 
31 require_once('../../../tests/TestEnvironment.php');
32 require_once('../../../tests/testClasses/timer.php');
33 
34 global $URL;
35 global $USER;
36 global $PASSWORD;
37 
38 $start = new timer();
39 $Svn = `svnversion`;
40 $date = date('Y-m-d');
41 $time = date('h:i:s-a');
42 print "\nStarting Site Tests on: " . $date . " at " . $time . "\n";
43 print "Using Svn Version:$Svn\n";
44 $test = new TestSuite('Fossology Repo Site UI tests');
45 $test->addTestFile('AboutMenuTest.php');
46 $test->addTestFile('login.php');
47 $test->addTestFile('SearchMenuTest.php');
48 $test->addTestFile('OrgFoldersMenuTest-Create.php');
49 $test->addTestFile('OrgFoldersMenuTest-Delete.php');
50 $test->addTestFile('OrgFoldersMenuTest-Edit.php');
51 $test->addTestFile('OrgFoldersMenuTest-Move.php');
52 $test->addTestFile('OrgUploadsMenuTest-Delete.php');
53 $test->addTestFile('OrgUploadsMenuTest-Move.php');
54 $test->addTestFile('UploadInstructMenuTest.php');
55 $test->addTestFile('UploadFileMenuTest.php');
56 $test->addTestFile('UploadServerMenuTest.php');
57 $test->addTestFile('UploadUrlMenuTest.php');
58 $test->addTestFile('UploadOne-ShotMenuTest.php');
59 if (TextReporter::inCli())
60 {
61  $results = $test->run(new TextReporter()) ? 0 : 1;
62  print "Ending Site Tests at: " . date('r') . "\n";
63  $elapseTime = $start->TimeAgo($start->getStartTime());
64  print "The Site Tests took {$elapseTime}to run\n\n";
65  exit($results);
66 }
67 $test->run(new HtmlReporter());
68 $elapseTime = $start->TimeAgo($start->getStartTime());
69 print "<pre>The Site Tests took {$elapseTime}to run</pre>\n\n";
70 ?>
Definition: timer.php:42