[erlang-questions] Problem With Common Test

Dave Smith <>
Tue Nov 17 03:32:41 CET 2009


On Mon, Nov 16, 2009 at 6:34 PM, Jayson Vantuyl <> wrote:
> I'm trying to get common_test working.  I have a few problems.
>
> First, the install procedure is byzantine.  I'm not asking for an immediate fix, but really, there has to be a better way.

Agreed. As such, I don't usually follow the install procedure but
puzzled out the necessary mojo to launch a CT test suite from the
command line. Something along the lines of:

erl -pa MyEbinPath -I MyInclude -noshell -s ct_run script_start -s
erlang halt -logdir ALogDir -env TEST_DIR <where tests live>

> Next, if I use the example (which includes ct.hrl), I get the following trying to do an erl -make.
>
> Recompile: src/isopod_SUITE
> /opt/local/lib/erlang/lib/common_test-1.4.1/include/ct.hrl:20: can't find include file "test_server.hrl"
>
> So, it appears that it should be using include_lib, instead of include.  If I write the test without the include, it works, but I can't use the ?line macros.

To accomodate this...quirk..I usually programatically find the
common_test path and add the include dir to the erl command line.

> Fourth, when will I be able to usably get coverage data?  The requirement that the .beam files be in the same directory as the .erl files is pretty much a nonstarter.  The feature might as well not exist, since it's completely incompatible with any of the packaging tools.

Yes, you can get coverage data by defining a cover.spec file (that's
the name I use) with the following contents:

{levels, details}.
{incl_dirs_r, ["ebin"]}.

Where the ebin directory is relative to where you are running erlang
from the command line. You'll also need to add:

-cover cover.spec

to your erlang command line.

HTH. common_test is really quite nice once you get it hooked up and
running. Not sure why it's so byzantine. Maybe I'm just doing it
Wrong. :)

D.


More information about the erlang-questions mailing list