Ejemplo n.º 1
0
            }
        }
        $type = $_GET['run'] == "all" ? "полное" : "только группы " . $_GET['run'];
        echo <<<HTML
\t\tТестирование <b>{$type}</b>. <span style="display:none" id="results"></span>
\t\t<br>
\t\t<ul style="list-style: none">
HTML;
        if (count($list) > 0) {
            $tester = new EMTTester();
            $tester->double_test = isset($_GET['double_test']);
            $tester->set_typoclass("EMTypograph");
            foreach ($list as $file) {
                include "../tests/{$file}";
            }
            $ok = $tester->testit();
            $result = $tester->results;
        } else {
            $result['error'] = "В каталоге tests тесты не обнаружены";
        }
        if (isset($result['error']) && $result['error']) {
            $text = $result['error'];
        } else {
            if ($ok) {
                $text = "УСПЕХ. ТЕСТОВ ПРОЙДЕНО: " . $tester->get_test_count() . ".";
            } else {
                $cnt = $tester->get_test_count();
                $err = count($tester->results['errors']);
                $text = "ОБНАРУЖЕНЫ ОШИБКИ. ПРОЙДЕНО " . ($cnt - $err) . " из {$cnt}.";
            }
        }