FOSSology  4.4.0
Open Source License Compliance by Open Source Software
runBasicTests.php
1 #!/usr/bin/php
2 <?php
3 /*
4  SPDX-FileCopyrightText: © 2008 Hewlett-Packard Development Company, L.P.
5 
6  SPDX-License-Identifier: GPL-2.0-only
7 */
8 /*
9  * Runner script to run Basic tests
10  */
11 // set the path for where simpletest is
12 $path = '/usr/share/php' . PATH_SEPARATOR;
13 set_include_path(get_include_path() . PATH_SEPARATOR . $path);
14 
15 /* simpletest includes */
16 require_once '/usr/local/simpletest/unit_tester.php';
17 require_once '/usr/local/simpletest/web_tester.php';
18 require_once '/usr/local/simpletest/reporter.php';
19 
20 require_once ('../../../tests/TestEnvironment.php');
21 require_once('../../../tests/testClasses/timer.php');
22 
23 $start = new timer();
24 $Svn = `svnversion`;
25 $date = date('Y-m-d');
26 $time = date('h:i:s-a');
27 print "\nStarting Basic Functional Tests on: " . $date . " at " . $time . "\n";
28 print "Using Svn Version:$Svn\n";
29 $test = new TestSuite('Fossology Repo UI Basic Functional tests');
30 // Must run BasicSetup first, it creates the folder the other tests need.
31 $test->addTestFile('BasicSetup.php');
32 $test->addTestFile('UploadFileTest.php');
33 $test->addTestFile('UploadUrlTest.php');
34 $test->addTestFile('UploadSrvArchiveTest.php');
35 $test->addTestFile('uploadSrvDirTest.php');
36 $test->addTestFile('uploadSrvFileTest.php');
37 $test->addTestFile('CreateFolderTest.php');
38 $test->addTestFile('DeleteFolderTest.php');
39 $test->addTestFile('editFolderTest.php');
40 $test->addTestFile('editFolderNameOnlyTest.php');
41 $test->addTestFile('editFolderDescriptionOnlyTest.php');
42 $test->addTestFile('moveFolderTest.php');
43 $test->addTestFile('DupFolderTest.php');
44 $test->addTestFile('DupUploadTest.php');
45 $test->addTestFile('createFldrDeleteIt.php');
46 
47 if (TextReporter::inCli())
48 {
49  $results = $test->run(new TextReporter()) ? 0 : 1;
50  print "Ending Basic Tests at: " . date('r') . "\n";
51  $elapseTime = $start->TimeAgo($start->getStartTime());
52  print "The Basic Tests took {$elapseTime}to run\n\n";
53  exit($results);
54 }
55 $test->run(new HtmlReporter());
56 $elapseTime = $start->TimeAgo($start->getStartTime());
57 print "<pre>The Basic Functional Tests took {$elapseTime}to run</pre>\n\n";
Definition: timer.php:31