Commits

arkdro committed 7b82a0d

add start test

Comments (0)

Files changed (1)

erlang/test/num_SUITE.erl

 % -----------------------------------------------------------------------------
 suite() ->
     [
-     {require, odeci_node},
+     {require, odeci_prog},
      {timetrap,{seconds,10}}
     ].
 
 % -----------------------------------------------------------------------------
 all() ->
     [
-        ping
+        start
     ].
 
+%%=============================================================================
+%% Auxillary functions
+%%=============================================================================
+start_prog(Config) ->
+    Prog = ct:get_config(odeci_prog),
+    Base = proplists:get_value(data_dir, Config),
+    Dir = filename:dirname(filename:dirname(filename:dirname(Base))),
+    Fullname = filename:join([Dir, "priv", Prog]),
+    application:load(odeci),
+    application:set_env(odeci, port_command, Fullname),
+    ok = application:start(odeci).
+
 % -----------------------------------------------------------------------------
 % Function: TestCase(Config0) ->
 %               ok | exit() | {skip,Reason} | {comment,Comment} |
     Node = ct:get_config(odeci_node),
     pong = net_adm:ping(Node),
     pong = rpc:call(Node, c_server, ping, []).
+
+start(Config) ->
+    start_prog(Config).
+