2

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.

toraritte
  • 6,300
  • 3
  • 46
  • 67
  • 2
    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). Is this perhaps a misconception caused by the shell's autocomplete function which is based on what is already loaded? – aronisstav Nov 12 '18 at 10:06
  • Thanks a lot! I tried putting in the functions explicitly, but I guess I'm not a good typer... I also updated my answer, but technically it is your answer, so if you submit your own then I will accept it; wouldn't like to take credit for it. – toraritte Nov 12 '18 at 16:18

1 Answers1

1

@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}
toraritte
  • 6,300
  • 3
  • 46
  • 67
  • 2
    The fact that the modules are not "pre-loaded" does not make them "unavailable". You don't really need to load them explicitly; as long as they are in the load path, calling any function in there will automatically load them (assuming you are not starting your node/shell in embedded mode). All these tools have some suitable Erlang "entry point", which can be used without an explicit `l(...)`. – aronisstav Nov 12 '18 at 10:02