I have been looking at common test. Is this the right direction?
It depends on two things I believe :
-
Preference.
-
What you’re testing and what your testing needs are.
I think to simplify it all. eunit as it states in the document is a “lightweight unit testing framework”. Unit being the keyword there. It might make sense to you use eunit for testing your pure functions, but not for testing processes, etc.
Common test can generally be seen as a better tool for “blackbox”, integration, and general system testing. It is also capable of doing a lot more than that, check out the docs around Large Scale Testing.
Some of us just ct for both our unit and blackbox tests and are quite happy with that approach as you only have to concern yourself with one testing framework.
In addition to CT and eunit, there are number of other testing tools and frameworks you will find around that are not only worth mentioning but using (depending on your needs) :
- proper
- quickcheck (commercial, but offers a free mini version too)
- concuerror
- cutter
Edit: It’s worth noting that rebar3 has support for eunit and ct out of the box. Rebar3 plugins for both proper and quickcheck exist as well.
Edit:
Some resources besides the erlang docs themselves ;
Don’t forget you can also get 35% off Fred’s book using our Devtalk discount code if you want the most recent up to date version
Don’t forget you can also get 35% off Fred’s book using our Devtalk discount code if you want the most recent up to date version
Only really applies to @sachin.maiya but there should be a copy around the office. It used to live on my desk but I can point you at the relevant suspects.
We’ve used Common Test on a project before. The barrier to entry is a little higher than with EUnit, but not much. And the two can be used on the same codebase (although we decided at the time to exclusively use CT for consistency). I’d love for us to build experience with PropEr.