in reply to Redirecting the output of Test::More

Maybe I'm missing something here ... but why would you want to redirect the test output anywhere? If you're running your test under "make test" (or "Build test"), then it's all going exactly where you want. Are you trying to run the test standalone without the MakeMaker/Build framework? Where do you want to send the results? To a file, or to the screen? In the latter case, I'm not sure why STDERR is not sufficient. In the former case, I would recommend using your shell to do this - so that when you later run your tests under the standard frameworks, it will just work (because they will redirect to themselves).

Just my thoughts...

  • Comment on Re: Redirecting the output of Test::More

Replies are listed 'Best First'.
Re^2: Redirecting the output of Test::More
by thor (Priest) on Feb 18, 2005 at 19:27 UTC
    There are other uses for the Test::* modules than just build tests for modules. I am using this for testing a large system and want the results to go to a file. Redirecting STDERR is somewhat of a chore as I'm on a windows box (perhaps this is the opportunity that I need to learn how to do that on windows). It just would've been nice to be able to do this in some simple way...seems that there will have to be some hackery involved. *sigh*...why can't easy things be easy? ;)

    thor

    Feel the white light, the light within
    Be your own disciple, fan the sparks of will
    For all of us waiting, your kingdom will come

      I've been thinking about doing the same thing at work ... however, I was thinking of doing it still under the Module::Build framework so I could just Build test. And then I could "Build test > logfile.out 2>&1" to get the full output (assuming I was on unix - I can't recall how to redirect stderr and stdout to the same place on DOS/OS2/Windows).