Fix runtests to make it workable for contbuild
It wasn't actually decoding test names anymore due to paths changing; also several slow tests failed when run from the root (which is where contbuild is going to run them). Added stuff to make $HPHP_HOME unnecessary for runtests (contbuild wont have it set), and fixed a use of $GLOBALS in hphp/test/run to be more php-idiomatic.
Esse commit está contido em:
+8
-13
@@ -23,7 +23,7 @@ one of a few pre-defined suite names that this script knows about.
|
||||
|
||||
If you work with hhvm a lot, you might consider a bash alias:
|
||||
|
||||
ht() { path/to/fbcode/hphp/test/run "$@" }
|
||||
alias ht="path/to/fbcode/hphp/test/run"
|
||||
|
||||
Examples:
|
||||
|
||||
@@ -57,20 +57,15 @@ function error($message) {
|
||||
}
|
||||
|
||||
function hphp_home() {
|
||||
if (isset($GLOBALS['_hphp_home'])) return $GLOBALS['_hphp_home'];
|
||||
$get_val = function() {
|
||||
if (isset($_ENV['HPHP_HOME'])) {
|
||||
return $_ENV['HPHP_HOME'];
|
||||
}
|
||||
|
||||
$top_level = system('git rev-parse --show-top-level', $status);
|
||||
static $ret;
|
||||
if (!$ret) {
|
||||
$top_level = system('git rev-parse --show-toplevel', $status);
|
||||
if ($status === 0) {
|
||||
return $top_level;
|
||||
return $ret = rtrim($top_level, '/');
|
||||
}
|
||||
error("Couldn't determine the root of your fbcode repository.\n".
|
||||
"Try setting HPHP_HOME in your environment");
|
||||
};
|
||||
return $GLOBALS['_hphp_home'] = rtrim($get_val(), '/');
|
||||
error("Couldn't determine the root of your fbcode repository.\n");
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
function idx($array, $key, $default = null) {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
include __DIR__.'/../../../test/sample_dir/fix_mtimes.inc';
|
||||
|
||||
$d = dir("test/sample_dir/");
|
||||
$d = dir(__DIR__."/../../sample_dir/");
|
||||
echo "Path: " . $d->path . "\n";
|
||||
$files = array(); // order changes per machine
|
||||
while (false !== ($entry = $d->read())) {
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
Path: test/sample_dir/
|
||||
Path: %s
|
||||
array(7) {
|
||||
[0]=>
|
||||
string(2) ".
|
||||
@@ -1,3 +1,9 @@
|
||||
<?php
|
||||
|
||||
$image = imagecreatefromgif('test/images/php.gif');$emboss = array(array(2, 0, 0), array(0, -1, 0), array(0, 0, -1));imageconvolution($image, $emboss, 1, 127);header('Content-Type: image/png');ob_start();imagepng($image, null, 9);var_dump(substr(ob_get_clean(),0,10));
|
||||
$image = imagecreatefromgif(__DIR__.'/../../images/php.gif');
|
||||
$emboss = array(array(2, 0, 0), array(0, -1, 0), array(0, 0, -1));
|
||||
imageconvolution($image, $emboss, 1, 127);
|
||||
header('Content-Type: image/png');
|
||||
ob_start();
|
||||
imagepng($image, null, 9);
|
||||
var_dump(substr(ob_get_clean(),0,10));
|
||||
|
||||
@@ -1,25 +1,25 @@
|
||||
<?php
|
||||
|
||||
touch('test/images/246x247.png', 1234567890);
|
||||
$exif = exif_read_data('test/images/246x247.png');
|
||||
touch(__DIR__.'/../../images/246x247.png', 1234567890);
|
||||
$exif = exif_read_data(__DIR__.'/../../images/246x247.png');
|
||||
print_r($exif);
|
||||
|
||||
touch('test/images/php.gif', 1234567890);
|
||||
$exif = exif_read_data('test/images/php.gif');
|
||||
touch(__DIR__.'/../../images/php.gif', 1234567890);
|
||||
$exif = exif_read_data(__DIR__.'/../../images/php.gif');
|
||||
print_r($exif);
|
||||
|
||||
touch('test/images/simpletext.jpg', 1234567890);
|
||||
$exif = exif_read_data('test/images/simpletext.jpg');
|
||||
touch(__DIR__.'/../../images/simpletext.jpg', 1234567890);
|
||||
$exif = exif_read_data(__DIR__.'/../../images/simpletext.jpg');
|
||||
print_r($exif);
|
||||
|
||||
touch('test/images/smile.happy.png', 1234567890);
|
||||
$exif = exif_read_data('test/images/smile.happy.png');
|
||||
touch(__DIR__.'/../../images/smile.happy.png', 1234567890);
|
||||
$exif = exif_read_data(__DIR__.'/../../images/smile.happy.png');
|
||||
print_r($exif);
|
||||
|
||||
touch('test/images/test1pix.jpg', 1234567890);
|
||||
$exif = exif_read_data('test/images/test1pix.jpg');
|
||||
touch(__DIR__.'/../../images/test1pix.jpg', 1234567890);
|
||||
$exif = exif_read_data(__DIR__.'/../../images/test1pix.jpg');
|
||||
print_r($exif);
|
||||
|
||||
touch('test/images/test2.jpg', 1234567890);
|
||||
$exif = exif_read_data('test/images/test2.jpg');
|
||||
touch(__DIR__.'/../../images/test2.jpg', 1234567890);
|
||||
$exif = exif_read_data(__DIR__.'/../../images/test2.jpg');
|
||||
print_r($exif);
|
||||
|
||||
@@ -2,13 +2,15 @@
|
||||
|
||||
include __DIR__.'/../../../test/sample_dir/fix_mtimes.inc';
|
||||
|
||||
$sample_dir = __DIR__.'/../../sample_dir';
|
||||
|
||||
$files = array();
|
||||
foreach (new DirectoryIterator('test/sample_dir/') as $file) {
|
||||
foreach (new DirectoryIterator($sample_dir.'/') as $file) {
|
||||
$files[] = $file;
|
||||
}
|
||||
var_dump(count($files));
|
||||
|
||||
$dir = new DirectoryIterator('test/sample_dir/');
|
||||
$dir = new DirectoryIterator($sample_dir.'/');
|
||||
$files = array(); // order changes per machine
|
||||
foreach ($dir as $fileinfo) {
|
||||
if (!$fileinfo->isDot()) {
|
||||
@@ -18,7 +20,7 @@ foreach ($dir as $fileinfo) {
|
||||
asort($files);
|
||||
var_dump(array_values($files));
|
||||
|
||||
$iterator = new DirectoryIterator("test/sample_dir");
|
||||
$iterator = new DirectoryIterator($sample_dir);
|
||||
$files = array(); // order changes per machine
|
||||
foreach ($iterator as $fileinfo) {
|
||||
if ($fileinfo->isFile()) {
|
||||
@@ -29,26 +31,26 @@ ksort($files);
|
||||
foreach ($files as $name => $fileinfo) {
|
||||
echo "BEGIN: " . $name . "\n";
|
||||
echo $fileinfo->getFilename() . "\n";
|
||||
echo $fileinfo->getCTime() . "\n";
|
||||
echo $fileinfo->getBasename() . "\n";
|
||||
echo $fileinfo->getBasename('.cpp') . "\n";
|
||||
echo $fileinfo->getGroup() . "\n";
|
||||
echo $fileinfo->getInode() . "\n";
|
||||
echo $fileinfo->getMTime() . "\n";
|
||||
echo $fileinfo->getOwner() . "\n";
|
||||
echo $fileinfo->getPerms() . "\n";
|
||||
echo $fileinfo->getSize() . "\n";
|
||||
echo $fileinfo->getType() . "\n";
|
||||
echo $fileinfo->isDir() . "\n";
|
||||
echo $fileinfo->isDot() . "\n";
|
||||
echo $fileinfo->isExecutable() . "\n";
|
||||
echo $fileinfo->isLink() . "\n";
|
||||
echo $fileinfo->isReadable() . "\n";
|
||||
echo $fileinfo->isWritable() . "\n";
|
||||
$fileinfo->getCTime() . "\n";
|
||||
$fileinfo->getBasename() . "\n";
|
||||
$fileinfo->getBasename('.cpp') . "\n";
|
||||
$fileinfo->getGroup() . "\n";
|
||||
$fileinfo->getInode() . "\n";
|
||||
$fileinfo->getMTime() . "\n";
|
||||
$fileinfo->getOwner() . "\n";
|
||||
$fileinfo->getPerms() . "\n";
|
||||
$fileinfo->getSize() . "\n";
|
||||
$fileinfo->getType() . "\n";
|
||||
$fileinfo->isDir() . "\n";
|
||||
$fileinfo->isDot() . "\n";
|
||||
$fileinfo->isExecutable() . "\n";
|
||||
$fileinfo->isLink() . "\n";
|
||||
$fileinfo->isReadable() . "\n";
|
||||
$fileinfo->isWritable() . "\n";
|
||||
echo "END" . "\n";
|
||||
}
|
||||
|
||||
$iterator = new RecursiveDirectoryIterator("test/sample_dir");
|
||||
$iterator = new RecursiveDirectoryIterator($sample_dir);
|
||||
$files = array(); // order changes per machine
|
||||
foreach ($iterator as $fileinfo) {
|
||||
if ($fileinfo->isFile()) {
|
||||
@@ -58,20 +60,20 @@ foreach ($iterator as $fileinfo) {
|
||||
ksort($files);
|
||||
foreach ($files as $name => $fileinfo) {
|
||||
echo $fileinfo->getFilename() . "\n";
|
||||
echo $fileinfo->getCTime() . "\n";
|
||||
echo $fileinfo->getBasename() . "\n";
|
||||
echo $fileinfo->getBasename('.cpp') . "\n";
|
||||
echo $fileinfo->getFilename() . "\n";
|
||||
echo $fileinfo->getGroup() . "\n";
|
||||
echo $fileinfo->getInode() . "\n";
|
||||
echo $fileinfo->getMTime() . "\n";
|
||||
echo $fileinfo->getOwner() . "\n";
|
||||
echo $fileinfo->getPerms() . "\n";
|
||||
echo $fileinfo->getSize() . "\n";
|
||||
echo $fileinfo->getType() . "\n";
|
||||
echo $fileinfo->isDir() . "\n";
|
||||
echo $fileinfo->isExecutable() . "\n";
|
||||
echo $fileinfo->isLink() . "\n";
|
||||
echo $fileinfo->isReadable() . "\n";
|
||||
echo $fileinfo->isWritable() . "\n";
|
||||
$fileinfo->getCTime() . "\n";
|
||||
$fileinfo->getBasename() . "\n";
|
||||
$fileinfo->getBasename('.cpp') . "\n";
|
||||
$fileinfo->getFilename() . "\n";
|
||||
$fileinfo->getGroup() . "\n";
|
||||
$fileinfo->getInode() . "\n";
|
||||
$fileinfo->getMTime() . "\n";
|
||||
$fileinfo->getOwner() . "\n";
|
||||
$fileinfo->getPerms() . "\n";
|
||||
$fileinfo->getSize() . "\n";
|
||||
$fileinfo->getType() . "\n";
|
||||
$fileinfo->isDir() . "\n";
|
||||
$fileinfo->isExecutable() . "\n";
|
||||
$fileinfo->isLink() . "\n";
|
||||
$fileinfo->isReadable() . "\n";
|
||||
$fileinfo->isWritable() . "\n";
|
||||
}
|
||||
|
||||
@@ -13,145 +13,17 @@ array(5) {
|
||||
}
|
||||
BEGIN: empty
|
||||
|
||||
%d
|
||||
|
||||
|
||||
%d
|
||||
%d
|
||||
%d
|
||||
%d
|
||||
16877
|
||||
4096
|
||||
dir
|
||||
1
|
||||
|
||||
1
|
||||
|
||||
1
|
||||
1
|
||||
END
|
||||
BEGIN: file
|
||||
|
||||
%d
|
||||
|
||||
|
||||
%d
|
||||
%d
|
||||
%d
|
||||
%d
|
||||
16877
|
||||
4096
|
||||
dir
|
||||
1
|
||||
|
||||
1
|
||||
|
||||
1
|
||||
1
|
||||
END
|
||||
BEGIN: fix_mtimes.inc
|
||||
|
||||
%d
|
||||
|
||||
|
||||
%d
|
||||
%d
|
||||
%d
|
||||
%d
|
||||
16877
|
||||
4096
|
||||
dir
|
||||
1
|
||||
|
||||
1
|
||||
|
||||
1
|
||||
1
|
||||
END
|
||||
BEGIN: symlink
|
||||
|
||||
%d
|
||||
|
||||
|
||||
%d
|
||||
%d
|
||||
%d
|
||||
%d
|
||||
16877
|
||||
4096
|
||||
dir
|
||||
1
|
||||
|
||||
1
|
||||
|
||||
1
|
||||
1
|
||||
END
|
||||
empty
|
||||
%d
|
||||
empty
|
||||
empty
|
||||
empty
|
||||
%d
|
||||
%d
|
||||
1234567892
|
||||
%d
|
||||
33188
|
||||
0
|
||||
file
|
||||
|
||||
|
||||
|
||||
1
|
||||
1
|
||||
file
|
||||
%d
|
||||
file
|
||||
file
|
||||
file
|
||||
%d
|
||||
%d
|
||||
1234567894
|
||||
%d
|
||||
33188
|
||||
3
|
||||
file
|
||||
|
||||
|
||||
|
||||
1
|
||||
1
|
||||
fix_mtimes.inc
|
||||
%d
|
||||
fix_mtimes.inc
|
||||
fix_mtimes.inc
|
||||
fix_mtimes.inc
|
||||
%d
|
||||
%d
|
||||
1234567895
|
||||
%d
|
||||
33188
|
||||
459
|
||||
file
|
||||
|
||||
|
||||
|
||||
1
|
||||
1
|
||||
symlink
|
||||
%d
|
||||
symlink
|
||||
symlink
|
||||
symlink
|
||||
%d
|
||||
%d
|
||||
1234567894
|
||||
%d
|
||||
33188
|
||||
3
|
||||
link
|
||||
|
||||
|
||||
1
|
||||
1
|
||||
1
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
include __DIR__.'/../../../test/sample_dir/fix_mtimes.inc';
|
||||
|
||||
$dir = new DirectoryIterator('test/sample_dir');
|
||||
$dir = new DirectoryIterator(__DIR__.'/../../sample_dir');
|
||||
$files = array(); // order changes per machine
|
||||
while($dir->valid()) {
|
||||
if(!$dir->isDot()) {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
include __DIR__.'/../../../test/sample_dir/fix_mtimes.inc';
|
||||
|
||||
$ite=new RecursiveDirectoryIterator('test/sample_dir/');
|
||||
$ite=new RecursiveDirectoryIterator(__DIR__.'/../../sample_dir/');
|
||||
$bytestotal=0;
|
||||
$nbfiles=0;
|
||||
$files = array(); // order changes per machine
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
array(5) {
|
||||
[0]=>
|
||||
string(28) "test/sample_dir/dir => 4096
|
||||
"
|
||||
[1]=>
|
||||
string(27) "test/sample_dir/empty => 0
|
||||
"
|
||||
[2]=>
|
||||
string(26) "test/sample_dir/file => 3
|
||||
"
|
||||
[3]=>
|
||||
string(38) "test/sample_dir/fix_mtimes.inc => 459
|
||||
"
|
||||
[4]=>
|
||||
string(29) "test/sample_dir/symlink => 3
|
||||
"
|
||||
}
|
||||
Total: 5 files, 4,561 bytes
|
||||
@@ -0,0 +1,18 @@
|
||||
array(5) {
|
||||
[0]=>
|
||||
string(%d) "%s../../sample_dir/dir => 18
|
||||
"
|
||||
[1]=>
|
||||
string(%d) "%s../../sample_dir/empty => 0
|
||||
"
|
||||
[2]=>
|
||||
string(%d) "%s../../sample_dir/file => 3
|
||||
"
|
||||
[3]=>
|
||||
string(%d) "%s../../sample_dir/fix_mtimes.inc => 459
|
||||
"
|
||||
[4]=>
|
||||
string(%d) "%s../../sample_dir/symlink => 3
|
||||
"
|
||||
}
|
||||
Total: 5 files, 483 bytes
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
include __DIR__.'/../../../test/sample_dir/fix_mtimes.inc';
|
||||
|
||||
$ite=new RecursiveDirectoryIterator('test/sample_dir/');
|
||||
$ite=new RecursiveDirectoryIterator(__DIR__.'/../../sample_dir/');
|
||||
$bytestotal=0;
|
||||
$nbfiles=0;
|
||||
$files = array(); // order changes per machine
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
array(5) {
|
||||
[0]=>
|
||||
string(31) "test/sample_dir/dir/empty => 0
|
||||
"
|
||||
[1]=>
|
||||
string(27) "test/sample_dir/empty => 0
|
||||
"
|
||||
[2]=>
|
||||
string(26) "test/sample_dir/file => 3
|
||||
"
|
||||
[3]=>
|
||||
string(38) "test/sample_dir/fix_mtimes.inc => 459
|
||||
"
|
||||
[4]=>
|
||||
string(29) "test/sample_dir/symlink => 3
|
||||
"
|
||||
}
|
||||
Total: 5 files, 465 bytes
|
||||
@@ -0,0 +1,18 @@
|
||||
array(5) {
|
||||
[0]=>
|
||||
string(%d) "%s/sample_dir/dir/empty => 0
|
||||
"
|
||||
[1]=>
|
||||
string(%d) "%s/sample_dir/empty => 0
|
||||
"
|
||||
[2]=>
|
||||
string(%d) "%s/sample_dir/file => 3
|
||||
"
|
||||
[3]=>
|
||||
string(%d) "%s/sample_dir/fix_mtimes.inc => 459
|
||||
"
|
||||
[4]=>
|
||||
string(%d) "%s/sample_dir/symlink => 3
|
||||
"
|
||||
}
|
||||
Total: 5 files, 465 bytes
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
include __DIR__.'/../../../test/sample_dir/fix_mtimes.inc';
|
||||
|
||||
$path = "test/sample_dir/";
|
||||
$path = __DIR__."/../../sample_dir/";
|
||||
$files = array(); // order changes per machine
|
||||
foreach (new RecursiveIteratorIterator(
|
||||
new RecursiveDirectoryIterator($path,
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(20) "test/sample_dir/dir
|
||||
"
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(%d) "%s/sample_dir/dir
|
||||
"
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
include __DIR__.'/../../../test/sample_dir/fix_mtimes.inc';
|
||||
|
||||
$directory = "test/sample_dir";
|
||||
$directory = __DIR__."/../../sample_dir";
|
||||
$fileSPLObjects = new RecursiveIteratorIterator(
|
||||
new RecursiveDirectoryIterator($directory),
|
||||
RecursiveIteratorIterator::SELF_FIRST);
|
||||
|
||||
@@ -1,74 +0,0 @@
|
||||
array(6) {
|
||||
[0]=>
|
||||
string(24) "test/sample_dir/dir dir
|
||||
"
|
||||
[1]=>
|
||||
string(32) "test/sample_dir/dir/empty empty
|
||||
"
|
||||
[2]=>
|
||||
string(28) "test/sample_dir/empty empty
|
||||
"
|
||||
[3]=>
|
||||
string(26) "test/sample_dir/file file
|
||||
"
|
||||
[4]=>
|
||||
string(46) "test/sample_dir/fix_mtimes.inc fix_mtimes.inc
|
||||
"
|
||||
[5]=>
|
||||
string(32) "test/sample_dir/symlink symlink
|
||||
"
|
||||
}
|
||||
array(6) {
|
||||
[0]=>
|
||||
string(24) "test/sample_dir/dir dir
|
||||
"
|
||||
[1]=>
|
||||
string(32) "test/sample_dir/dir/empty empty
|
||||
"
|
||||
[2]=>
|
||||
string(28) "test/sample_dir/empty empty
|
||||
"
|
||||
[3]=>
|
||||
string(26) "test/sample_dir/file file
|
||||
"
|
||||
[4]=>
|
||||
string(46) "test/sample_dir/fix_mtimes.inc fix_mtimes.inc
|
||||
"
|
||||
[5]=>
|
||||
string(32) "test/sample_dir/symlink symlink
|
||||
"
|
||||
}
|
||||
array(5) {
|
||||
[0]=>
|
||||
string(32) "test/sample_dir/dir/empty empty
|
||||
"
|
||||
[1]=>
|
||||
string(28) "test/sample_dir/empty empty
|
||||
"
|
||||
[2]=>
|
||||
string(26) "test/sample_dir/file file
|
||||
"
|
||||
[3]=>
|
||||
string(46) "test/sample_dir/fix_mtimes.inc fix_mtimes.inc
|
||||
"
|
||||
[4]=>
|
||||
string(32) "test/sample_dir/symlink symlink
|
||||
"
|
||||
}
|
||||
array(5) {
|
||||
[0]=>
|
||||
string(32) "test/sample_dir/dir/empty empty
|
||||
"
|
||||
[1]=>
|
||||
string(28) "test/sample_dir/empty empty
|
||||
"
|
||||
[2]=>
|
||||
string(26) "test/sample_dir/file file
|
||||
"
|
||||
[3]=>
|
||||
string(46) "test/sample_dir/fix_mtimes.inc fix_mtimes.inc
|
||||
"
|
||||
[4]=>
|
||||
string(32) "test/sample_dir/symlink symlink
|
||||
"
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
array(6) {
|
||||
[0]=>
|
||||
string(%d) "%s/sample_dir/dir dir
|
||||
"
|
||||
[1]=>
|
||||
string(%d) "%s/sample_dir/dir/empty empty
|
||||
"
|
||||
[2]=>
|
||||
string(%d) "%s/sample_dir/empty empty
|
||||
"
|
||||
[3]=>
|
||||
string(%d) "%s/sample_dir/file file
|
||||
"
|
||||
[4]=>
|
||||
string(%d) "%s/sample_dir/fix_mtimes.inc fix_mtimes.inc
|
||||
"
|
||||
[5]=>
|
||||
string(%d) "%s/sample_dir/symlink symlink
|
||||
"
|
||||
}
|
||||
array(6) {
|
||||
[0]=>
|
||||
string(%d) "%s/sample_dir/dir dir
|
||||
"
|
||||
[1]=>
|
||||
string(%d) "%s/sample_dir/dir/empty empty
|
||||
"
|
||||
[2]=>
|
||||
string(%d) "%s/sample_dir/empty empty
|
||||
"
|
||||
[3]=>
|
||||
string(%d) "%s/sample_dir/file file
|
||||
"
|
||||
[4]=>
|
||||
string(%d) "%s/sample_dir/fix_mtimes.inc fix_mtimes.inc
|
||||
"
|
||||
[5]=>
|
||||
string(%d) "%s/sample_dir/symlink symlink
|
||||
"
|
||||
}
|
||||
array(5) {
|
||||
[0]=>
|
||||
string(%d) "%s/sample_dir/dir/empty empty
|
||||
"
|
||||
[1]=>
|
||||
string(%d) "%s/sample_dir/empty empty
|
||||
"
|
||||
[2]=>
|
||||
string(%d) "%s/sample_dir/file file
|
||||
"
|
||||
[3]=>
|
||||
string(%d) "%s/sample_dir/fix_mtimes.inc fix_mtimes.inc
|
||||
"
|
||||
[4]=>
|
||||
string(%d) "%s/sample_dir/symlink symlink
|
||||
"
|
||||
}
|
||||
array(5) {
|
||||
[0]=>
|
||||
string(%d) "%s/sample_dir/dir/empty empty
|
||||
"
|
||||
[1]=>
|
||||
string(%d) "%s/sample_dir/empty empty
|
||||
"
|
||||
[2]=>
|
||||
string(%d) "%s/sample_dir/file file
|
||||
"
|
||||
[3]=>
|
||||
string(%d) "%s/sample_dir/fix_mtimes.inc fix_mtimes.inc
|
||||
"
|
||||
[4]=>
|
||||
string(%d) "%s/sample_dir/symlink symlink
|
||||
"
|
||||
}
|
||||
@@ -17,4 +17,4 @@ function getFiles(&$rdi,$depth=0) {
|
||||
asort($files);
|
||||
var_dump(array_values($files));
|
||||
}
|
||||
getFiles(new RecursiveDirectoryIterator('test/sample_dir'));
|
||||
getFiles(new RecursiveDirectoryIterator(__DIR__.'/../../sample_dir'));
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(28) " test/sample_dir/dir/empty
|
||||
"
|
||||
}
|
||||
array(5) {
|
||||
[0]=>
|
||||
string(21) " test/sample_dir/dir
|
||||
"
|
||||
[1]=>
|
||||
string(23) " test/sample_dir/empty
|
||||
"
|
||||
[2]=>
|
||||
string(22) " test/sample_dir/file
|
||||
"
|
||||
[3]=>
|
||||
string(32) " test/sample_dir/fix_mtimes.inc
|
||||
"
|
||||
[4]=>
|
||||
string(25) " test/sample_dir/symlink
|
||||
"
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(%d) " %s/sample_dir/dir/empty
|
||||
"
|
||||
}
|
||||
array(5) {
|
||||
[0]=>
|
||||
string(%d) " %s/sample_dir/dir
|
||||
"
|
||||
[1]=>
|
||||
string(%d) " %s/sample_dir/empty
|
||||
"
|
||||
[2]=>
|
||||
string(%d) " %s/sample_dir/file
|
||||
"
|
||||
[3]=>
|
||||
string(%d) " %s/sample_dir/fix_mtimes.inc
|
||||
"
|
||||
[4]=>
|
||||
string(%d) " %s/sample_dir/symlink
|
||||
"
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
$d=fopen('test/sample_dir/file', 'r');
|
||||
$d=fopen(__DIR__.'/../../sample_dir/file', 'r');
|
||||
var_dump(is_object($d));
|
||||
var_dump(is_resource($d));
|
||||
var_dump(gettype((string)$d));
|
||||
var_dump(gettype((string)$d));
|
||||
|
||||
@@ -1,3 +1,15 @@
|
||||
<?php
|
||||
|
||||
class MySoap extends SoapClient { public $pub = 1; public function __doRequest( $request, $location, $action, $version, $one_way=0) { $rp = parent::__doRequest($request, $location, $action, $version, $one_way); return $rp; }}function test($options) { return new MySoap('test/test.wsdl', $options);}var_dump(test(array('foo' => 'bar'))->pub);
|
||||
class MySoap extends SoapClient {
|
||||
public $pub = 1;
|
||||
public function __doRequest($request, $location, $action, $version, $one_way=0) {
|
||||
$rp = parent::__doRequest($request, $location, $action, $version, $one_way);
|
||||
return $rp;
|
||||
}
|
||||
}
|
||||
|
||||
function test($options) {
|
||||
return new MySoap(__DIR__.'/../../test.wsdl', $options);
|
||||
}
|
||||
|
||||
var_dump(test(array('foo' => 'bar'))->pub);
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
|
||||
include __DIR__.'/../../../test/sample_dir/fix_mtimes.inc';
|
||||
|
||||
$info = new SplFileInfo('test/sample_dir');
|
||||
$info = new SplFileInfo(__DIR__.'/../../sample_dir');
|
||||
if (!$info->isFile()) {
|
||||
echo $info->getRealPath();
|
||||
}
|
||||
$info = new SplFileInfo('test/sample_dir/file');
|
||||
$info = new SplFileInfo(__DIR__.'/../../sample_dir/file');
|
||||
var_dump($info->getbaseName());
|
||||
var_dump($info->getbaseName('.cpp'));
|
||||
var_dump($info->getCTime());
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
<?php
|
||||
|
||||
$fp = fopen('test/sample_dir/file', 'r');var_dump(pclose($fp));
|
||||
$fp = fopen(__DIR__.'/../../sample_dir/file', 'r');
|
||||
var_dump(pclose($fp));
|
||||
|
||||
@@ -352,7 +352,7 @@ stdout = subprocess.Popen(
|
||||
'test/run',
|
||||
'test/zend/all',
|
||||
'interp',
|
||||
'0',
|
||||
'',
|
||||
'_bin',
|
||||
],
|
||||
stdout=subprocess.PIPE,
|
||||
|
||||
@@ -7,11 +7,11 @@
|
||||
# % fbconfig hphp/util/parser/test && fbmake dbg && \
|
||||
# ./hphp/tools/run_verify_parse.sh
|
||||
#
|
||||
: ${FBMAKE_BIN_ROOT=$HPHP_HOME/_bin}
|
||||
HPHP_HOME=$(git rev-parse --show-toplevel)
|
||||
: ${FBMAKE_BIN_ROOT=_bin}
|
||||
cd $HPHP_HOME
|
||||
|
||||
cd $HPHP_HOME/hphp
|
||||
|
||||
VERIFY_SCRIPT=./test/verify
|
||||
VERIFY_SCRIPT=./hphp/test/verify
|
||||
PARSE_TEST=$FBMAKE_BIN_ROOT/hphp/util/parser/test/parse_tester
|
||||
|
||||
# some tests are expected not to parse
|
||||
@@ -19,18 +19,18 @@ PARSE_SKIP='dv_i0.php strict_bad_end.php strict_bad_start.php
|
||||
strict_numbers.php syntax-error.php xhp-malformed.php Xhp.php
|
||||
trailing_comma_bad1.php trailing_comma_bad2.php trailing_comma_bad3.php
|
||||
trailing_comma_bad4.php trailing_comma_bad5.php trailing_comma_bad6.php'
|
||||
PARSE_SKIP="$PARSE_SKIP $(cd test/quick && ls parse_fail_*.php)"
|
||||
PARSE_SKIP="$PARSE_SKIP $(cd hphp/test/quick && ls parse_fail_*.php)"
|
||||
|
||||
######################################################################
|
||||
|
||||
|
||||
skip_list=
|
||||
for x in $PARSE_SKIP ; do
|
||||
skip_list="$skip_list test/quick/$x"
|
||||
skip_list="$skip_list hphp/test/quick/$x"
|
||||
done
|
||||
|
||||
qtests=$(comm -23 \
|
||||
<(find test/quick -maxdepth 1 -name \*.php | sort) \
|
||||
<(find hphp/test/quick -maxdepth 1 -name \*.php | sort) \
|
||||
<(echo $skip_list|sed -e 's/ /\n/g'|sort))
|
||||
|
||||
cmd="$PARSE_TEST --verify %1\$s/%3\$s"
|
||||
|
||||
@@ -1,26 +1,23 @@
|
||||
#!/bin/env php
|
||||
<?php
|
||||
chdir(__DIR__.'/../../');
|
||||
|
||||
$HPHP_HOME = $_ENV['HPHP_HOME'];
|
||||
include_once $HPHP_HOME.'/hphp/test/fbmake_test_lib.php';
|
||||
include_once 'hphp/test/fbmake_test_lib.php';
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Args to this script are:
|
||||
// $argv[0] test-script test-path interp|jit|hhir maybe-dash-r
|
||||
// FBMAKE_BIN_ROOT
|
||||
if (count($argv) != 6) {
|
||||
echo "usage: $argv[0] test-script TEST_PATH interp|jit|hhir REPO_BOOLEAN FBMAKE_BIN_ROOT
|
||||
FBMAKE_BIN_ROOT\n";
|
||||
echo
|
||||
"This script is not intended for direct use. See hphp/hhvm/TARGETS.\n";
|
||||
exit(1);
|
||||
}
|
||||
|
||||
$repo = '';
|
||||
if ($argv[4]) {
|
||||
$repo = '-r';
|
||||
}
|
||||
|
||||
$cmd = "FBMAKE_BIN_ROOT=$HPHP_HOME/$argv[5] " .
|
||||
"$argv[1] $argv[2] -m $argv[3] $repo";
|
||||
$cmd = "FBMAKE_BIN_ROOT=$argv[5] $argv[1] $argv[2] -m $argv[3] $argv[4]";
|
||||
loop_tests($cmd, function ($line) {
|
||||
if (preg_match('/^(test[^\s]*).*/', $line, &$m)) {
|
||||
if (preg_match('/^hphp\/(test[^\s]*).*/', $line, &$m)) {
|
||||
start($m[1]);
|
||||
return;
|
||||
}
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário