[erlang-questions] EUnit

Andrew Stone stondage123@REDACTED
Mon Mar 10 23:05:02 CET 2008


Thanks Richard. But I'm still having a little trouble. What I meant was how do I create a fixture etc...?

Do I just add the appropriate tuples to a test file that includes eunit.hrl?

Any help would be appreciated.

Thanks,
Andrew

----- Original Message ----
From: Richard Carlsson <richardc@REDACTED>
To: Andrew Stone <stondage123@REDACTED>
Cc: erlang-questions@REDACTED
Sent: Monday, March 10, 2008 5:42:53 PM
Subject: Re: [erlang-questions] EUnit

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