Why are common Erlang application (Common Test, Dialyzer, leex, yecc etc.) not available in the `erl` shell?

105 views Asked by At

Getting back to Erlang and I noticed that I am unable to run any of the supporting frameworks that have their own user guides, such as EUnit, Common Test, leex, yecc, Dyalizer, Typer etc.

According to the Common Test User's Guide, "the Common Test application is installed with the Erlang/OTP system" and that "no extra installation step is required". I assume that this is true to the others as well and I'm sure that I'm missing something basic.

1

There are 1 answers

1
toraritte On

@aronisstav hit the nail on the head with his comment about "a misconception caused by the shell's autocomplete function which is based on what is already loaded". To quote him again, the correct answer is:

All these tools have some suitable Erlang "entry point" function and calling this function should work (assuming you are not starting your node/shell in embedded mode).

Gave these below a try and they worked (I guess I was just an idiot):

6> leex:file("./program.erl").
./program.erl.xrl: no such file or directory
error
7> dialyzer:gui().

To have the shell autocomplete working, simply load the modules by using code:load_file/1 or l(Module) in the erl shell:

$ erl

1> code:load_file(ct).
{module,ct}

2> l(dialyzer).
{module,dialyzer}