Re: test data files

[email protected] ("David Golden")
Newsgroups perl.module.build
Message-ID <[email protected]>
On Tue, Mar 25, 2008 at 12:22 PM, David Carmean <[email protected]> wrote:
>  My present project is just a script, no libraries/modules, which needs
>  to munge a set of files.  I need to copy some initial files into a working
>  directory, have the script modify them and create some new files, and then
>  check the contents.

In CPAN::Reporter, I keep test data in directories under the "t"
directory.  (In my case, "t/dist/") During tests, I create a temporary
directory with File::Temp, then use File::Copy::Recursive's dircopy()
to copy test data into the temporary directory.  I also change to the
temporary directory using File::pushd so I can pop back to the
original directory when I'm done testing.

Hope that helps.

Regards,
David
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.