Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- # Строка, выводимая при успешном выполнении теста.
- # Должна совпадать с аналогичной строкой из test.php.
- define('TEST_DONE_STR', 'TEST DONE');
- define('TEST_PATH', dirname(__FILE__));
- define('CLI_PATH', 'sapi/cli/php');
- # Ищем директории PHP в текущей папке
- $dirs = array();
- foreach(scandir('./') as $item) {
- if(preg_match("#^php-#", $item) AND is_dir($item)) {
- if(file_exists($item . "/sapi/cli/php"))
- $dirs[] = $item;
- else
- print "$item - php-cli not found\n";
- }
- }
- # В каждой из них запускаем test.php
- foreach($dirs as $dir) {
- $output = array();
- exec(TEST_PATH . "/$dir/" . CLI_PATH . " " . TEST_PATH . "/test.php", $output);
- print "$dir - " . (implode("", $output) == TEST_DONE_STR ? "OK" : "FAILED") . "\n";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement