On 2005-12-07, Mark Stosberg <[EMAIL PROTECTED]> wrote: >> >> Limitations and Caveats with the system: >> >> * Scripts that muck about with STDIN, STDOUT or STDERR will probably >> have problems. >> >> * The usual persistent environment caveats apply: be careful with >> redefined subs, global vars; 'require'd code only gets loaded on the >> first request, etc. >> >> * Test scripts have to end in a true value.
I thought of an alternative which might have a number of the benefits of this solution with less of the drawbacks. The idea is to create one big file test file that is run in the normal way. Everything would only need to be loaded once instead of N times. There wouldn't be the usual persistence issues, either. Each file could pull in with scope brackets around it, sort of like: { # Insert contents of test file here... } taking care of /some/ scope issues. Some issues would still remain: - Global variables need to be handled with care - "plan" lines would need to be handled specially. I recall there is already a module to apply plans at a "scope" level, so this may not be too hard. - BEGIN and END blocks may need some care. For example, an END block may be used to remove test data before the next text runs. It's certainly less conventional, and there may well be serious flaws with this idea that I don't see yet. I thought I'd throw it out there. Mark -- http://mark.stosberg.com/