My goal is quite simple; while I am learning Erlang, I would like to use rebar to create a basic module with an eunit test:
I have tried the following:
mkdir erlangscratch
cd erlangscratch
rebar create template=simplemod modid=erlangscratch
Edit the 'test/erlangscratch_tests.erl' to look like this:
-module(erlangscratch_tests).
-include_lib("eunit/include/eunit.hrl").
% This should fail
basic_test_() ->
?assert(1 =:= 2).
Execute the tests:
snowch@tp:~/erlangscratch$ rebar co eu
==> erlangscratch (compile)
==> erlangscratch (eunit)
The tests weren't executed, but it also seems that the code isn't compiling.
Here are the contents of my folder:
snowch@tp:~/erlangscratch$ tree .
.
├── src
│ └── erlangscratch.erl
└── test
└── erlangscratch_tests.erl
2 directories, 2 files
Question: What step(s) have I missed out?
UPDATE:
As per the accepted answer, basic_test_
function needed to be renamed and the 'src/erlangscratch.app.src' was missing so I created it with the following contents:
{application, erlangscratch,
[
{description, "An Erlang erlangscratch library"},
{vsn, "1"},
{modules, [
erlangscratch
]},
{registered, []},
{applications, [
kernel,
stdlib
]},
{env, []}
]}.