FOSSology  3.2.0rc1
Open Source License Compliance by Open Source Software
runBasicTests.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 to run Basic 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 $start = new timer();
35 $Svn = `svnversion`;
36 $date = date('Y-m-d');
37 $time = date('h:i:s-a');
38 print "\nStarting Basic Functional Tests on: " . $date . " at " . $time . "\n";
39 print "Using Svn Version:$Svn\n";
40 $test = new TestSuite('Fossology Repo UI Basic Functional tests');
41 // Must run BasicSetup first, it creates the folder the other tests need.
42 $test->addTestFile('BasicSetup.php');
43 $test->addTestFile('UploadFileTest.php');
44 $test->addTestFile('UploadUrlTest.php');
45 $test->addTestFile('UploadSrvArchiveTest.php');
46 $test->addTestFile('uploadSrvDirTest.php');
47 $test->addTestFile('uploadSrvFileTest.php');
48 $test->addTestFile('CreateFolderTest.php');
49 $test->addTestFile('DeleteFolderTest.php');
50 $test->addTestFile('editFolderTest.php');
51 $test->addTestFile('editFolderNameOnlyTest.php');
52 $test->addTestFile('editFolderDescriptionOnlyTest.php');
53 $test->addTestFile('moveFolderTest.php');
54 $test->addTestFile('DupFolderTest.php');
55 $test->addTestFile('DupUploadTest.php');
56 $test->addTestFile('createFldrDeleteIt.php');
57 
58 if (TextReporter::inCli())
59 {
60  $results = $test->run(new TextReporter()) ? 0 : 1;
61  print "Ending Basic Tests at: " . date('r') . "\n";
62  $elapseTime = $start->TimeAgo($start->getStartTime());
63  print "The Basic Tests took {$elapseTime}to run\n\n";
64  exit($results);
65 }
66 $test->run(new HtmlReporter());
67 $elapseTime = $start->TimeAgo($start->getStartTime());
68 print "<pre>The Basic Functional Tests took {$elapseTime}to run</pre>\n\n";
69 ?>
Definition: timer.php:42