Arquivos
hhvm/hphp/tools/update_expected_tcr_output.php
T
ptarjan eb401ae91f move TestCodeRun tests from strings to files
I changed the ##run_verify.sh## script to recursivly search for a ##config.hdf## file and use that one. This allows us to easiy customize the options for each suite.

I converted the 6 different runtime options we supported to symlinks of ##.opts## files to the option that the test wants. If I was smarter I would then convert these to ##config.hdf## if the whole suite wanted the same options, but I'll save that for later cleanup if we want it.

I moved the config files around a bit. `test/cli.hdf` became the default `test/config.hdf`. `test/config.hdf` became `test/tcr/config.hdf`. `test/zend/config.hdf` is also now an empty file so it doesn't inherit `test/config.hdf`.

I'll handle the Repo part of the tests in the next diff. Then the next one after that will delete all the cpp code and Makefile targets and force you to just use ##tools/run_verify.sh## which I think we should rename ##test/run## or something easy.
2013-04-15 12:56:31 -07:00

30 linhas
810 B
PHP
Arquivo Executável

#!/bin/env php
<?php
$php = `which hhvm`;
if (!$php) $php = `which php`;
$config = json_decode(file_get_contents('tools/update_expected_tcr_output.json'), true);
function ends_with($big, $little) {
return strpos($big, $little, strlen($big) - strlen($little)) !== false;
}
// More efficient lookups than array_search
foreach ($config as $key => &$value) {
$value = array_fill_keys($value, true);
}
foreach (new RecursiveIteratorIterator (new RecursiveDirectoryIterator ('test/tcr')) as $f) {
$filename = $f->getRealPath();
$name = str_replace('.php', '', $f->getFilename());
if (!$f->isFile() ||
!ends_with($filename, '.php') ||
isset($config['no_zend'][$name])) {
continue;
}
$opts = '-dapc.enable_cli=1 -ddisplay_errors=off';
`$php $opts $filename > $filename.expect`;
}