-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrun-tests.php
More file actions
45 lines (38 loc) · 1020 Bytes
/
run-tests.php
File metadata and controls
45 lines (38 loc) · 1020 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
namespace HackUtils;
require_once __DIR__ . '/vendor/autoload.php';
class Coverage {
private $coverage;
public function __construct() {
$this->coverage = new \SebastianBergmann\CodeCoverage\CodeCoverage();
$this->coverage->setAddUncoveredFilesFromWhitelist(true);
$this->coverage->filter()->addDirectoryToWhitelist(SRC_DIR);
}
public function start() {
$this->coverage->start('Hack Utils');
}
public function stop() {
$this->coverage->stop();
}
public function write() {
$writer = new \SebastianBergmann\CodeCoverage\Report\Html\Facade();
$writer->process($this->coverage, __DIR__ . '/coverage');
}
}
function tests_main() {
\date_default_timezone_set('UTC');
\umask(0022);
\error_reporting(-1);
\ini_set('log_errors', '0');
\ini_set('display_errors', '1');
\ini_set('html_errors', '0');
$coverage = new Coverage();
$coverage->start();
try {
_Tests::main();
} finally {
$coverage->stop();
$coverage->write();
}
}
tests_main();