-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.php
More file actions
executable file
·36 lines (34 loc) · 974 Bytes
/
test.php
File metadata and controls
executable file
·36 lines (34 loc) · 974 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
<?php
/**
* IPPcode22 test script
* @author Aleksandr Verevkin (xverev00), VUT FIT IPP 2021/2022
*/
require_once "test_ext/ParseArgs.php";
require_once "test_ext/TestUtils.php";
require_once "test_ext/FindTests.php";
require_once "test_ext/CreateHTML.php";
// setting to show errors on stderr
ini_set('display_errors', 'stderr');
// process arguments
$args_parser = new ParseArgs($argc);
$args_parser->set_params();
// process tests
$tests = new FindTests($args_parser);
$tests->find_tests($args_parser->dir);
// execute tests
$tests_results = [];
foreach ($tests->tests as $name => $test) {
// filter test and add absent files
if (!$test->set_test()) {
continue;
}
// run test
$tests_results[$name] = $test->run_test();
//clean temporary files
if (!$args_parser->noclean) {
$tests_results[$name]->clean();
}
}
// create html representation of test results
$html = new CreateHTML($tests_results);
echo $html->get_html();