%% When compiling erlang modules for testing, some of the common options are
debug_info
and
export_all
e.g. from the shell:
compile:file(my_module, [debug_info, export_all]).
%% or you can use
c(my_module, [debug_info, export_all]).
%% If my_module is not in the current path, you can specify the full path as a string:
c("apps/my_app/src/my_module.erl", [export_all, {outdir, "apps/my_module/ebin"}, {d, 'TEST'}]).
%% OR
c("src/bid_processor", [export_all, {outdir, "ebin"}, {d, 'TEST'}]).
%% If you suspect that your module under test does not behave according to the most recent code changes you can check that the shell has not loaded some stray beam file from another directory:
code:which(my_module).
%% This will return the full path to the module
%% And if you really want to you can unload the module with
code:purge(my_module).
code:delete(my_module).
%% When running eunit test cases it often happens that the diff of 2 terms is truncated. e.g. when you compare 2 large tuples. You can output the test log to a file and in the file the terms are not truncated.
You can use
code:get_path().
to get a list of paths used in the erlang shell, most likely you will have to wrap that method in the shell command rp, otherwise the shell will truncate the output e.g.
rp(code:get_path()).
It is very useful if you have a directory called e.g. apps and which contains a collection of erlang applications to set the ERL_LIBS environment variable e.g.
export ERL_LIBS=/home/philip/erlang/apps
When you start up the erlang shell, and do code:get_path(), you will see that for each application, erlang has automatically set a path to the ebin directory.
1 comment:
Your Affiliate Money Printing Machine is waiting -
Plus, making money with it is as simple as 1 . 2 . 3!
This is how it all works...
STEP 1. Tell the system which affiliate products you want to push
STEP 2. Add push button traffic (this LITERALLY takes 2 minutes)
STEP 3. See how the system grow your list and sell your affiliate products all by itself!
Do you want to start making profits???
You can test-drive the system for yourself risk free...
Post a Comment