PageRenderTime 3ms CodeModel.GetById 0ms RepoModel.GetById 0ms app.codeStats 0ms

/src/ewgi_test.erl

http://github.com/skarab/ewgi
Erlang | 32 lines | 28 code | 4 blank | 0 comment | 1 complexity | f41712ac3a026ca407f5502a57a54d23 MD5 | raw file
Possible License(s): MPL-2.0-no-copyleft-exception
  1. -module(ewgi_test).
  2. -export([test/0]).
  3. test() ->
  4. lists:map(fun test_file/1,
  5. [filename:rootname(filename:basename(F))
  6. || F <- filelib:wildcard("ebin/*.beam")]).
  7. test_file("ewgi_test") ->
  8. skip;
  9. test_file(F) ->
  10. case code:ensure_loaded(list_to_atom(F)) of
  11. {module, M} ->
  12. test_mod(M);
  13. _ ->
  14. skip
  15. end.
  16. test_mod(M) ->
  17. case M:module_info() of
  18. L when is_list(L) ->
  19. Exports = proplists:get_value(exports, L, []),
  20. case lists:member({test,0}, Exports) of
  21. true ->
  22. M:test();
  23. _ ->
  24. ok
  25. end;
  26. _ ->
  27. ok
  28. end.