Namdak Tonpa 7 years ago
parent
commit
81cc339f99
5 changed files with 12 additions and 2 deletions
  1. 1 1
      include/mad.hrl
  2. BIN
      mad
  3. 2 1
      src/mad.erl
  4. 1 0
      src/profile/mad_local.erl
  5. 8 0
      src/test/mad_eunit.erl

+ 1 - 1
include/mad.hrl

@@ -1 +1 @@
--define(VERSION,"2b4779").
+-define(VERSION,"886a1d").

BIN
mad


+ 2 - 1
src/mad.erl

@@ -35,6 +35,7 @@ atomize("dep")    -> 'deps';
 atomize("deps")   -> 'deps';
 atomize("cle"++_) -> 'clean';
 atomize("com"++_) -> 'compile';
+atomize("eunit")  -> 'eunit';
 atomize("up")     -> 'up';
 atomize("rel"++_) -> 'release';
 atomize("bun"++_) -> 'release';
@@ -70,7 +71,7 @@ help()            -> info("MAD Container Tool version ~s~n",[?VERSION]),
                      info("~n"),
                      info("    invoke = mad params~n"),
                      info("    params = [] | command [ options  ] params ~n"),
-                     info("   command = app     | deps  | clean | compile | up~n"),
+                     info("   command = app     | deps  | clean | compile | up | eunit~n"),
                      info("           | release [ beam  | ling  | script  | runc | depot ]~n"),
                      info("           | deploy  | start | stop  | attach  | sh | static [ <watch|min> ] ~n"),
                      return(false).

+ 1 - 0
src/profile/mad_local.erl

@@ -14,3 +14,4 @@ deps(Params)      -> mad_git:deps(Params).
 up(Params)        -> mad_git:up(Params).
 fetch(Params)     -> mad_git:fetch(Params).
 static(Params)    -> mad_static:main([],Params).
+eunit(Params)     -> mad_eunit:main_test(Params).

+ 8 - 0
src/test/mad_eunit.erl

@@ -0,0 +1,8 @@
+-module(mad_eunit).
+-compile(export_all).
+
+main_test(_Params) ->
+    case application:get_application() of
+      {ok, App} -> eunit:test([{application, App}]);
+              _ -> eunit:test()
+    end.