From: Jamie C. <jca...@we...> - 2003-09-01 23:00:11
|
Wil Cooley <wc...@na...> wrote .. > > I'm trying to set up a testing environment so I can build unit tests > that don't require going through HTTP. Has anyone done this already and > if so, would you share it? I'm having a heck of a time doing it myself. > > I know I can write tests that use WWW::Mechanize or a similar mechanism, > and probably will for acceptance tests, but I want to write simpler > tests to do things like instantiate objects. My test script keeps dying > with "Failed to determine Webmin root from SERVER_ROOT or > SCRIPT_FILENAME"; I've written code to fill %ENV with all the same data > as a CGI script and dumped %ENV and know it's all there, but to no > avail. I've tracked the problem so far down to that init_config is > unable to produce a @lang_order_list with data and will continue beating > on it. Make sure that when you run your CGI scripts from the command line, you use a full path like /usr/libexec/webmin/yourmodule/something.cgi instead of just ./something.cgi . Webmin's init_config function uses the path to work out the root directory and module name, and produces that cryptic message if it cannot .. - Jamie |