hi,
I've noticed that it is very difficult to tell if your --CLEAN--
sections are actually working, so I wonder if it might be possible to
brainstorm ways of fixing this.
A couple of options come to mind that could be considered
- append this code to the end of the .clean.php file: ?><?php echo
"--CLEAN-- works"; ?> and capture the output, then check to make sure
that we see "--CLEAN-- works" in the output. This would detect fatal
errors (which is the most common problem I find, especially when a
--CLEAN-- section includes a helper file). - add a --REMOVEFILES--/--REMOVEDIRS-- section where one can specify
relative paths to files or whole directories that should be nixed, and
have run-tests do the removal
The most common usage for --CLEAN-- is to remove files, so I like the
second option personally.
Thanks,
Greg
Greg Beaver wrote:
hi,
I've noticed that it is very difficult to tell if your --CLEAN--
sections are actually working, so I wonder if it might be possible to
brainstorm ways of fixing this.
Yes, I found the same thing and fixed 40 tests under ext/standard/tests
last week - in PHP53. Tedious work.
A couple of options come to mind that could be considered
- append this code to the end of the .clean.php file: ?><?php echo
"--CLEAN-- works"; ?> and capture the output, then check to make sure
that we see "--CLEAN-- works" in the output. This would detect fatal
errors (which is the most common problem I find, especially when a
--CLEAN-- section includes a helper file).- add a --REMOVEFILES--/--REMOVEDIRS-- section where one can specify
relative paths to files or whole directories that should be nixed, and
have run-tests do the removal
In the new run-tests code (http://cvs.php.net/viewvc.cgi/phpruntests/)
we just check and warn if there is any output from executing the CLEAN
section. This works in the sense that it's how I found all the messed up
tests.
If you want to talk about other requirements for that code I think
php-qa is the right place to do it. By the way, - CLEAN-- sections
aren't the aren't the only problems. I've found a few sections called
--SKIP--, which of course do nothing :-).
I started a requirements page for the new code, here
wiki.php.net/qa/runtests, but I think it's better to discuss on the list
before adding there.
Zoe
- add a --REMOVEFILES--/--REMOVEDIRS-- section where one can specify
relative paths to files or whole directories that should be nixed, and
have run-tests do the removal
Then the filename might still be wrong, and I think a more flexible
option might be nice for database test for instance where one wants to
delete temporary tables/procedures/... ... while doing that in a clean
section might be a pain as it is a third php process and third database
connection per test (skipif, file, clean) Not that I have a good
proposal either ;-)
johannes