The default Nitrogen project lives in the nitrogen/site directory.
You'll find the following directories in there:
- ebin
- include
- src
- static
- templates
I've added the directory test to this to host my unit tests
Your Emakefile is also in the nitrogen/site directory.
The default version looks like this:
{
[
"./src/*",
"./src/*/*",
"./src/*/*/*",
"./src/*/*/*/*"
],
[
{ i, "./include" },
{ outdir, "./ebin" },
debug_info
]
}.
[
"./src/*",
"./src/*/*",
"./src/*/*/*",
"./src/*/*/*/*"
],
[
{ i, "./include" },
{ outdir, "./ebin" },
debug_info
]
}.
You should change this into:
{
[
"./src/*",
"./src/*/*",
"./src/*/*/*",
"./src/*/*/*/*",
"./test/*",
"./test/*/*",
"./test/*/*/*",
"./test/*/*/*/*"
],
[
{ i, "./include" },
{ outdir, "./ebin" },
debug_info
]
}.
After this, everytime you run ./dev compile (shell) or sync:go() (Erlang console) the unit tests are compiled as well. You can run your tests the in the Erlang console with eunit:test(module_name)
No comments:
Post a Comment