Testing Elixir applications with concuerror

Another year has passed, so it’s more than time for another post, though a really quick one.

You probably heard it: Elixir is great. And maybe you heard of concuerror. That actually is great, too. So you might have asked yourself: How do I integrate them both? Glad you asked, here you go:

  1. Install concuerror
  2. Remember the path you installed it to
  3. Run the following, replacing ../Concuerror with the path you actually installed it too, Elixir.Ps.Tracker with the module you defined your test function in, test with your test functions name and ps in _build/dev/lib/ps/ebin with your projects name. Your test function should start the run of the interaction you want concuerror to analyze.
mix compile
../Concuerror/concuerror -m Elixir.Ps.Tracker -t test --pa _build/dev/lib/ps/ebin --pa /usr/local/Cellar/elixir/1.2.4/lib/elixir/ebin --graph graph.dot --non_racing_system user

Note that you have to manually compile your Elixir code as concuerror works on compiled ebins. Also note that you have to pass in the path to Elixirs ebin directory, I added the one from Elixir 1.2.4 installed via homebrew on OS X here. Oh, and by the way, --non_racing_system user prevents warnings due to the possiblity of garbling ouput when multiple processes print to the shell. Use Logger for logging.