I installed erlang myself from source, so I set my ERL_TOP to where I built it from:
philip@desktop:~/s_server/src$ export ERL_TOP=~/Packages/otp
Now to built a PLT (Persistent Lookup Table). I only include erlang applications which my application depends on:
philip@desktop:~/s_server/src$ dialyzer --build_plt -r . $ERL_TOP/lib/stdlib/ebin $ERL_TOP/lib/kernel/ebin
This took about 12 min for me using a quite old machine (P4 2.6 GHz).
Now I create my own PLT which is a combination of the previous PLT plus the PLT generated from my own code:
philip@desktop:~/s_server/src$ dialyzer --add_to_plt -r . --output_plt s_server.plt
Finally I can analyse my own code which is in my current directory:
philip@desktop:~/s_server/src$ dialyzer --plt s_server.plt -r .
Checking whether the PLT s_server.plt is up-to-date... yes
Proceeding with analysis...
s_server_tests.erl:14: The variable __V can never match since previous clauses completely covered the type 'true'
s_server_tests.erl:16: The variable __V can never match since previous clauses completely covered the type 'true'
s_server_tests.erl:48: The variable _ can never match since previous clauses completely covered the type 'false'
Unknown functions:
eunit:test/1
done in 0m1.17s
done (warnings were emitted)
Checking whether the PLT s_server.plt is up-to-date... yes
Proceeding with analysis...
s_server_tests.erl:14: The variable __V can never match since previous clauses completely covered the type 'true'
s_server_tests.erl:16: The variable __V can never match since previous clauses completely covered the type 'true'
s_server_tests.erl:48: The variable _ can never match since previous clauses completely covered the type 'false'
Unknown functions:
eunit:test/1
done in 0m1.17s
done (warnings were emitted)
The warnings which I received were in the eunit macros, and not in the actual code which I wanted to analyse. It would be nice if there was a way to suppress these.