Skip to content

Commit

Permalink
"Updated files to support Common Test tools"
Browse files Browse the repository at this point in the history
  • Loading branch information
Joachim committed Feb 1, 2013
1 parent 0072493 commit e41a7dc
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 26 deletions.
7 changes: 5 additions & 2 deletions Makefile
Expand Up @@ -24,7 +24,10 @@ shell: all
run: all
${ERL} -boot start_sasl -s rpsls

test:
compile: clean
rebar compile

test2: compile
find . -type f -name "*.erl" -exec cp {} ebin \; #Copy the files to the known directory
rebar -v 3 ct skip_deps=true
rm ebin/*.erl #removing the files from this directory, restoring initial state
rm ebin/*.erl
11 changes: 4 additions & 7 deletions cover.spec
@@ -1,8 +1,5 @@
{incl_app, rpsls}.
{excl_mods, [
%%exclude the test files

{incl_app, rpsls, details}.
{excl_mods, rpsls, [
]}.
{level, details}.
{incl_dirs_r, ["src", "test"]}. %%test all files recursively in this directory, its a list for several direcs
{src_dirs, rpsls, ["src", "test"]}. %%sourcefile for application specified in the second arg
{incl_dirs_r, ["src", "test"]}.
{src_dirs, rpsls, ["src", "test"]}.
12 changes: 6 additions & 6 deletions rebar.config
@@ -1,7 +1,7 @@
{deps, [{lager, "\.*", {git, "https://github.com/basho/lager.git", "master"}}]}.
{require_otp_vsn, "R1[45]"}.
{erl_opts, [{parse_transform, lager_transform},
{src_dirs, ["src", "src/players", "test"]},
{src_dirs, ["src", "test", "src/players"]},
warn_unused_vars,
warn_export_all,
warn_shadow_vars,
Expand All @@ -17,10 +17,10 @@
warn_missing_spec,
warn_untyped_record, debug_info]}.
{xref_checks, [undefined_function_calls]}.
{erl_first_files,["src/rpsls_player.erl"]}.

%{erl_first_files,["src/rpsls_player.erl"]}.
{ct_extra_params, "-no_auto_compile -dir ebin"}.
{cover_enabled, true}.
{cover_print_enabled, true}.
{cover_export_enabled, true}.
{ct_extra_params,"-no_auto_compile -dir ebin -logdir logs/ct"}.

{eunit_opts, [verbose, {skip_deps, true}]}.
{eunit_exclude_deps, true}.
{cover_enabled, true}.
1 change: 0 additions & 1 deletion rpsls
Submodule rpsls deleted from c28c44
Binary file removed rpsls.tar.bz2
Binary file not shown.
11 changes: 3 additions & 8 deletions test/rpsls_alternating_player_SUITE.erl
@@ -1,13 +1,8 @@
-module (rpsls_alternating_player_SUITE).
-export([all/0, init_per_suite/1, end_per_suite/1, test1/1, test2/1, test3/1, test4/1, test5/1, test10/1]).
-export([all/0, test1/1, test2/1, test3/1, test4/1, test5/1, test10/1]).

all() -> [test1, test2, test3, test4, test5, test10].

init_per_suite(_Config) ->
[].

end_per_suite(_Config) ->
[].
all() ->
[test1, test2, test3, test4, test5, test10].

test1(_) -> {draw, _, [{rock,rock}]} = rpsls:play(rpsls_alternating_player,rpsls_alternating_player,1).
test2(_) -> {draw, _, [{paper,paper}, {rock,rock}]} = rpsls:play(rpsls_alternating_player,rpsls_alternating_player,2).
Expand Down
5 changes: 3 additions & 2 deletions test/rpsls_bart_player_SUITE.erl
@@ -1,8 +1,8 @@
-module (rpsls_bart_player_SUITE).
-export([all/0, test/1, test2/1, test3/1, test4/1]).

all() -> [test, test2, test3, test4].

all() ->
[test, test2, test3, test4].

test(_) -> {draw, _, [{rock,rock}]} = rpsls:play(rpsls_bart_player,rpsls_bart_player,1).

Expand All @@ -14,3 +14,4 @@ test4(_) -> {draw, _, [{rock,rock}, {rock,rock}, {rock,rock}, {rock,rock}]} = rp




0 comments on commit e41a7dc

Please sign in to comment.