1 %%%-------------------------------------------------------------------
2 %%% @copyright (C) 2011, Erlware, LLC.
4 %%% Test the ability to correctly correctly handle parse_transform
7 %%%-------------------------------------------------------------------
10 -include_lib("eunit/include/eunit.hrl").
12 -export([given
/3, 'when'/3, then
/3]).
14 given([a
,generated
,project
], _State
, _
) ->
15 sint_test_project_gen:a_generated_project();
16 given([that
,project
,an
,includes
,a
,header
,in
,the
,include
,directory
],
17 State
={ProjectDir
, _
}, _
) ->
18 io:format("~p~n", [ProjectDir
]),
19 File
= filename:join([ProjectDir
, "include",
21 ok
= file:write_file(File
, header_contents()),
23 given([that
,project
,contains
,an
,erl
,file
,that
,includes
,that
,header
],
24 State
={ProjectDir
, _
}, _
) ->
25 AFile
= filename:join([ProjectDir
, "src", "sint_gh78_includer.erl"]),
26 ok
= file:write_file(AFile
, dependent_contents()),
29 'when'([a
,build
,step
,is
,run
,on
,this
,project
],
30 {ProjectDir
, ProjectName
}, _
) ->
31 Ret
= sinan:run_sinan(["-s", ProjectDir
, "build"]),
32 ?
assertMatch({_
, _
}, Ret
),
34 {ok
, {ProjectDir
, ProjectName
, TrueRet
}}.
36 then([build
,the
,app
,normally
],
37 State
= {_
, _
, BuildState
}, _
) ->
38 ?
assertMatch([], sin_state:get_run_errors(BuildState
)),
45 dependent_contents() ->
46 "-module(sint_gh78_includer).
47 -include(\"test.hrl\").