1 %%%-------------------------------------------------------------------
2 %%% @copyright (C) 2011, Erlware, LLC.
4 %%% Add the ability to run sinan multiple times concurrently
6 %%% Created : 5 Sep 2011 by Eric Merritt <ericbmerritt@gmail.com>
7 %%%-------------------------------------------------------------------
8 -module(sint_multirun_support
).
10 -export([given
/3, 'when'/3, then
/3]).
12 -include_lib("eunit/include/eunit.hrl").
14 %% Step definitions for the sample calculator Addition feature.
16 given([two
, generated
, projects
], _
, _
) ->
17 BaseDir
= ec_file:mkdtemp(),
19 lists:map(fun(Number
) ->
20 ProjectName
= "foobachoo" ++
21 erlang:integer_to_list(Number
),
23 sint_test_project_gen:single_app_project(BaseDir
,
25 {ProjectName
, ProjectDir
}
31 'when'([a
, build
, step
, is
, run
, on
, each
, project
, concurrently
],
33 Results
= ec_plists:map(fun({_
, ProjectDir
}) ->
34 sinan:run_sinan(["-s", ProjectDir
,
37 {ok
, lists:zip(ProjectDescs
, Results
)}.
39 then([sinan
, should
, build
, both
, projects
, without
, a
, problem
],
42 lists:all(fun({{ProjectName
, ProjectDir
}, {ok
, _
}}) ->
43 ok
== sint_test_project_gen:validate_single_app_project(ProjectDir
, ProjectName
);