Raghubansh, could you please make those tests smaller?
5-10 lines are enough.
Just an example:
ext/standard/tests/file/lstat_stat_variation2.phpt fails here.
Here is the .diff I get:
016+ stat1 is not lesser than stat2 at key value: 8
017+ stat1 is not lesser than stat2 at key value: atime
018+ bool(false)
016- bool(true)
Can you tell me what's wrong there offhand?
Which function is failing? And with which input data?
It seems to be easy to find the reason of the failure.. BUT
when I take look into the test, I don't feel like doing it anymore.
First of all, for some reasons there are 3 tests in one file:
1) Testing stat() for file after using touch() on the file
2) Testing stat() for directory after using touch() on the directory
3) Testing lstat() for link after using touch() on the link
Why do you put them all in one file?
They certainly deserve to be in separate files.
Second, compare_self_stat(), compare_stats() - what do these funcs do? I don't
know.
Good thing is that we don't have any cycles here, as it's impossible to debug
something failing on 81th iteration.
------------
So that's what we have at the moment:
to understand why this test fails I need to go over all funcs in file.inc and
understand what do they do.
Then I should return to the test, find which of the three "embedded tests" is
failing, move it into a separate file to get short reproduce code and then debug this
short script.
------------
This is how it should theoretically look like:
I need to look into the test, which ALREADY contains the short reproduce code
and understand the issue from the first glance.
One test, one point of failure, one reason, one possible bug.
That's of course an ideal case, but we should strain after it.
Please, we don't need tests just for tests.
I don't want to spend hours on debugging a test (like I did with the huge
link() test), it should HELP me to debug PHP instead.
Also, pretty please do not put tests for several functions in one test file.
Things like "testing func1(), func2(), func3(), func4() and func5()" are not acceptable,
these tests do not perform their primary function - they do not help the developers,
the result is quite the contrary.
On 21.07.2007 21:35, Raghubansh Kumar wrote:
kraghuba Sat Jul 21 17:35:37 2007 UTC
Added files: (Branch: PHP_5_2)
/php-src/ext/standard/tests/file lstat_stat_variation1.phpt
lstat_stat_variation2.phpt
lstat_stat_variation3.phpt
lstat_stat_variation4.phpt
lstat_stat_variation5.phpt
lstat_stat_variation6.phpt
Log:
New testcases for lstat() and stat() functions
--
Wbr,
Antony Dovgal
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php