-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbenchmark.php
More file actions
41 lines (34 loc) · 832 Bytes
/
benchmark.php
File metadata and controls
41 lines (34 loc) · 832 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
<?php
include 'vendor/autoload.php';
/**
* Laravel shim
*/
function base_path(string $path = '') : string
{
echo __DIR__ . '/' . $path . "\n";
return __DIR__ . '/' . $path;
}
$configs = new \SOB\Configurations(__DIR__ . '/config.php');
$testRunner = new \SOB\TestRunner($configs);
$testsToRun = [];
array_shift($argv);
foreach ($argv as $arg)
{
$testsToRun[] = (int)$arg;
}
$testRunner->runTests($testsToRun);
// write results at the top of the file for easy reference
$resultsFile = 'results.csv';
if (file_exists($resultsFile))
{
$fileReader = new \SOB\CSV\FileReader($resultsFile);
foreach ($fileReader as $row)
{
$testRunner->addResults($row);
}
}
$fileWriter = new \SOB\CSV\FileWriter($resultsFile, download:false);
foreach ($testRunner->getResults() as $row)
{
$fileWriter->outputRow($row);
}