It doesn't seem like it would be that hard to create a test harness to set the appropriate environment for such a run on a per-page basis. A simple but reliable way to do it would be to add a blah.adp.env file for each blah.adp that you parse to set whatever you need. Sticking to my 'simple man' unix command line / makefile mentality you could have multiple per ADP if you need to test various branches. Could get redundant, but if you have more than a few branches you should probably refactor anyway.
I guess I can think of two situations where an easy answer doesn't come to mind - how do you fake the HTTP headers since at least every OpenACS page needs cookies set - second, how would you test the ones that are written as tcl pages that explicitly ns_adp_parse afterwards (which I do a lot of) ... If that is handled, then I think the coverage would be mostly complete - database, etc should still be fine. On Tue, 2 Sep 2003, Dossy wrote: > On 2003.09.01, Alfred Werner <[EMAIL PROTECTED]> wrote: > > Wouldn't just running ns_adp_parse on all the ADP files do the trick (with > > a catch around it?) If you catch - investigate further.. > > Sure, this'd work simple stuff. What about stuff that interacts with > the database and wants parameters, and throws errors in the event that > the required parameters aren't passed? > > In other words, you can't just blindly ns_adp_parse ADP files and have > it work all the time. > > In the real world, useful code coverage means actually hand-writing > tests that exercise all code paths of interest. > > -- Dossy > > -- > Dossy Shiobara mail: [EMAIL PROTECTED] > Panoptic Computer Network web: http://www.panoptic.com/ > "He realized the fastest way to change is to laugh at your own > folly -- then you can let go and quickly move on." (p. 70) > > > -- > AOLserver - http://www.aolserver.com/ > > To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]> with > the > body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: field > of your email blank. > -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]> with the body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: field of your email blank.
