[erlang-questions] EUnit
Richard Carlsson
richardc@REDACTED
Mon Mar 10 22:42:53 CET 2008
Andrew Stone wrote:
> All,
> I've been experimenting with EUnit for a bit and have a quick question.
> I wrote some test cases and they work fine when run with Module:test().
>
> How do I run all my unit tests in a given directory. Do I have to wrap them by hand?
> The edoc seems a little light here.
I'd suggest that you treat that just like any fixture setup, i.e.,
use a {setup, ...}, with a setup part that fetches the current directory
with file:get_cwd(), sets the new directory with file:set_cwd(), and
returns the old value; and a cleanup part that does set_cwd to get back
to the original directory.
/Richard
More information about the erlang-questions
mailing list