Skip to content

Roll up of changes from 3 github repos #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ ebin
erl_crash.dump
**.cov.html
*~
cucumberl
cucumberl
.eunit
*.swp
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
all: build

build:
rebar compile escriptize
./rebar compile escriptize

clean:
rebar clean
./rebar clean

test:
rebar eunit
./rebar eunit
Binary file modified rebar
Binary file not shown.
2 changes: 1 addition & 1 deletion rebar.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

%% process the examples directory
{sub_dirs, ["examples/sample"]}.
{sub_dirs, ["examples/simple_sample", "examples/complex_sample"]}.

%% clean up
{clean_files, ["ebin", "examples/ebin", "erl_crash.dump*", "tmp/*.cov.html"]}.
Expand Down
208 changes: 0 additions & 208 deletions src/cucumber_parser.erl

This file was deleted.

17 changes: 13 additions & 4 deletions src/cucumberl.erl
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ run(FilePath)

run(FilePath, FeatureModule)
when is_list(FilePath), is_atom(FeatureModule) ->
{_, Tree} = cucumber_parser:parse(FilePath),
{_, Tree} = cucumberl_parser:parse(FilePath),
run_tree(Tree, FeatureModule).

run_tree(Tree, FeatureModule) ->
Expand Down Expand Up @@ -76,6 +76,7 @@ run_tree(Tree, FeatureModule) ->
failed
end.


process_line({Type, LineNum, Tokens, Line},
{SkipScenario, State,
#cucumberl_stats{scenarios = NScenarios,
Expand All @@ -95,10 +96,10 @@ process_line({Type, LineNum, Tokens, Line},
{_, feature} ->
{false, {ok, State}, Stats};
{_, scenario} ->
{false, {ok, State},
{false, {ok, call_scenario_setup(FeatureModule)},
Stats#cucumberl_stats{scenarios = NScenarios + 1}};
{_, scenario_outline} ->
{false, {ok, State},
{false, {ok, call_scenario_setup(FeatureModule)},
Stats#cucumberl_stats{scenarios = NScenarios + 1}};
{false, {action, G}} ->
R = try
Expand Down Expand Up @@ -187,9 +188,17 @@ call_setup(FeatureModule) ->
end.

call_teardown(FeatureModule, State) ->
case erlang:function_exported(FeatureModule, teardown, 0) of
case erlang:function_exported(FeatureModule, teardown, 1) of
true ->
FeatureModule:teardown(State);
false ->
undefined
end.

call_scenario_setup(FeatureModule) ->
case erlang:function_exported(FeatureModule, scenario_setup, 0) of
true ->
FeatureModule:scenario_setup();
false ->
undefined
end.