PDA

View Full Version : Contributing to Caucho


domdorn
03-12-2010, 03:53 PM
Hello guys,

Emil wrote on twitter, that you guys have over several thousand test cases for resin (inkl. quercus) (http://twitter.com/emil_caucho/status/10301297181).

Some other people and myself want to contribute to quercus, help fixing bugs or at least provide directly usable test-cases so that you could fix the bugs faster, if you're not allowed to include our code in your codebase.

For this purpose, please share some of your quercus tests with us, so we can provide test cases that suit your needs and help make quercus the best php on java ever!

thanks,
dominik

emil
03-12-2010, 07:05 PM
Hi dominik,

We've been talking about releasing a few tests as a template, as you suggested. It was purely an internal idea until now and we weren't sure of the demand. It'll have to go through a corporate/legal review before we can say anything for sure, but it's good to have someone with active interest to spur it on. I'll keep you posted.

Thanks,
Emil

pbelb
03-12-2010, 11:16 PM
seconded!!

I'm another that would appreciate there being a way to help.

domdorn
03-31-2010, 04:24 AM
BUMP!

Still no Example Tests in SVN Trunk Revision 6944.

I've got some nasty bugs lying around, I would like to provide test cases for.

emil
04-01-2010, 06:51 PM
Hi domdorn,

I filed a bug for it here:

http://bugs.caucho.com/view.php?id=3978

That should increase the visibility and priority a bit.

Thanks,
Emil

sblommers
04-07-2010, 09:37 PM
I am currently exploiting every possibility of Quercus you can think of and also have a bunch of unit tests to expose some weaknesses in the current version.

How do I contribute? The test-cases are rather complicated (I'm using my own custom Quercus modules and using Google Guice dependency injection to expose Quercus).

I would therefore like to see the test-cases in SVN as well.

Sorry for my bad english, .. it's a bit late ..

Best,
Sebastiaan

nam
04-09-2010, 01:07 AM
Can you send me those test cases? With test cases, we can usually fix exposed bugs immediately. Thanks.

domdorn
04-09-2010, 10:50 AM
@Nam: Thats the whole point of this thread. Put some of _YOUR_ testcases into svn, so we can take a look and get an idea of how _YOU_ want them to be and then we can add them to the issue tracker, so _YOU_ can work with them and integrate them into the repo.

It does not make any sense when everyone tries to come up with his unique test-setup and you then have to spend more time getting the tests integrated then it takes to fix the bug.

Please add some tests now, this thread is open for over 4 months and not a single testcase is in the public-repository.

I know, you have testcases in your private repos (emil told me), so simply copy some of them to the public repo and let us start helping you!

nam
04-09-2010, 06:45 PM
We are planning to open up our test harness. But in the meantime, here's the test format:

<title>my test name</title>
<php out='stdout'>
<?php

var_dump(some_output);

?>
</php>

<compare file='stdout'>
expected output goes here
</compare>

nam
04-09-2010, 07:56 PM
example test:

<title>array: array(123)</title>
<php out='stdout'>
<?php

var_dump(array(123));

?>
</php>

<compare file='stdout'>
array(1) {
[0] =>
int(123)
}
</compare>

domdorn
04-16-2010, 01:34 PM
while I understand thats its more easy to parse tests with your layout, why don't stick to the one already used in the php.net tests and reuse them?

e.g.
http://github.com/php/php-src/blob/master/tests/basic/001.phpt

hm2k
04-16-2010, 03:58 PM
Probably makes the most sense to use PHP's very own testing files to ensure Quercus perhaps as expected.

I do a similar thing over at PEAR's PHP_Compat.

nam
04-16-2010, 07:05 PM
The main reason we have our own format is because our test harness preceded the PHP test harness.

hm2k
04-17-2010, 11:06 AM
I'm not sure what you mean...

The tests have existed in PHP for about 10 years.

nam
04-20-2010, 09:15 PM
We built our test harness specifically for Resin, and Resin has been around for about 12 years now. I'm not sure our test harness has been around for as long as Resin has been, but it should be pretty close. We then added Quercus support to it.

It really doesn't matter what format the test case is in. Just as long as it locates a Quercus bug, then we are more than happy to fix it.

hm2k
04-21-2010, 04:50 PM
I suppose you could run the .phpt files on Quercus, which would pick up quite a few issues to be getting on with I'm sure.

sblommers
06-01-2010, 04:03 PM
Hi all, I think that the test below will bring up some differences between PHP and Quercus. I think that type checking needs some review and will definately solve a lot of issues that we are having already.

Run this on both Quercus and PHP to see the diffs. (Especially array() )
https://streamconsulting.nl/drop/php-type-comparison.php

Here is the code if you are not able to download it.

<?php

$tests = array();

/* Testing equalty */
$tests['=='] = create_function('$a, $b', 'return $a==$b;');
$tests['!='] = create_function('$a, $b', 'return $a!=$b;');
$tests['<>'] = create_function('$a, $b', 'return $a<>$b;');
$tests['<'] = create_function('$a, $b', 'return $a<$b;');
$tests['>'] = create_function('$a, $b', 'return $a>$b;');
$tests['<='] = create_function('$a, $b', 'return $a<=$b;');
$tests['>='] = create_function('$a, $b', 'return $a>=$b;');
/* Testing identity */
$tests['==='] = create_function('$a, $b', 'return $a===$b;');
$tests['!=='] = create_function('$a, $b', 'return $a!==$b;');

$comparison = array();
$comparison['TRUE'] = true;
$comparison['FALSE'] = false;
$comparison['1'] = 1;
$comparison['0'] = 0;
$comparison['-1'] = -1;
$comparison['3,14'] = pi();
$comparison['"1"'] = '1';
$comparison['"0"'] = '0';
$comparison['"-1"'] = '-1';
$comparison['NULL'] = null;
$comparison['array()'] = array();
$comparison['"php"'] = 'php';

print '<h1>PHP version '.PHP_VERSION.' type comparison tables</h1>';

foreach ($tests as $test=>$function) {
print "<h2>Comparisons with $test</h2>";
print "<table border='1'>";
print "<tr>";
print "<th>&nbsp;</th>";
foreach (array_keys($comparison) as $name) {
print "<th>$name</th>";
}
print "</tr>";
foreach ($comparison as $arg_1_name => $arg_1_value) {
print '<tr>';
print "<th>$arg_1_name</th>";
foreach ($comparison as $arg_2_value) {
print '<td>';
print $function($arg_1_value, $arg_2_value)==true ?
'<span style="color:#00F;">TRUE</span>' : '<span style="color:#F00;">FALSE</span>';
print '</td>';
}
print "</tr>";
}
print "</table>";
}
?>

Best regards,
Sebastiaan