Permalink
Browse files

bin/test.erl improvements, myapp removed (moved to ecomponents)

  • Loading branch information...
Michal Ptaszek
Michal Ptaszek committed Oct 19, 2009
1 parent c0cab6e commit 42b573614a09c5cdf40e4e5671271364c09001d2
View
@@ -49,10 +49,3 @@
debug_info,
strict_record_tests,
netload]}.
{'lib/myapp-0.1/src/*', [
{outdir, "lib/myapp-0.1/ebin"},
{i, "lib/myapp-0.1/include"},
debug_info,
strict_record_tests,
netload]}.
View
@@ -25,6 +25,8 @@
main([]) ->
run_tests("doc/ewts_report");
main(["compile"]) ->
compile();
main(_) ->
print_usage().
@@ -40,8 +42,17 @@ start_interactive_mode_node(ReportDir) ->
[use_stdio, stderr_to_stdout, stream, {line, 1024}]),
print_output(Port).
compile() ->
lists:foreach(fun(App) ->
FilesTest = filelib:wildcard(filename:join(["lib", App, "test", "*erl"])),
make:files(FilesTest, [{outdir, filename:join(["lib", App, "test"])},
{i, filename:join(["lib", App, "include"])}])
end, get_apps()).
print_output(Port) ->
receive
{Port, {data, {eol, "1> EWTSEND"}}} ->
port_close(Port);
{Port, {data, {eol, "1> " ++ Line}}} ->
io:format("~s~n", [Line]),
print_output(Port);
@@ -50,11 +61,50 @@ print_output(Port) ->
print_output(Port);
{Port, {data, _Data}} ->
print_output(Port)
after 100000 ->
after 10000 ->
port_close(Port),
ok
end.
get_apps() ->
filter(
element(2, file:list_dir("lib")), []).
filter(["yaws" ++ _ | Rest], Acc) ->
filter(Rest, Acc);
filter(["eptic" ++ _ | Rest], Acc) ->
filter(Rest, Acc);
filter(["wpart-" ++ _ | Rest], Acc) ->
filter(Rest, Acc);
filter(["wparts-" ++ _ | Rest], Acc) ->
filter(Rest, Acc);
filter(["ewts-" ++ _ | Rest], Acc) ->
filter(Rest, Acc);
filter(["ewgi-" ++ _ | Rest], Acc) ->
filter(Rest, Acc);
filter(["kernel-" ++ _ | Rest], Acc) ->
filter(Rest, Acc);
filter(["stdlib-" ++ _ | Rest], Acc) ->
filter(Rest, Acc);
filter(["mnesia-" ++ _ | Rest], Acc) ->
filter(Rest, Acc);
filter(["inets-" ++ _ | Rest], Acc) ->
filter(Rest, Acc);
filter(["mochiweb-" ++ _ | Rest], Acc) ->
filter(Rest, Acc);
filter(["erlydtl-" ++ _ | Rest], Acc) ->
filter(Rest, Acc);
filter(["crypto-" ++ _ | Rest], Acc) ->
filter(Rest, Acc);
filter(["ssl-" ++ _ | Rest], Acc) ->
filter(Rest, Acc);
filter(["sasl-" ++ _ | Rest], Acc) ->
filter(Rest, Acc);
filter([App | Rest], Acc) ->
filter(Rest, [App | Acc]);
filter([], Acc) ->
Acc.
print_usage() ->
io:format("Usage:~n"
"bin/test.erl [run [ReportDir]] - run the tests~n"
@@ -3,16 +3,16 @@
-record(request, {
url :: string(),
cookies = [] :: string_proplist(),
post_args = [] :: list({string(), string()}),
get_args = [] :: list({string(), string()}),
post_args = [] :: string_proplist(),
get_args = [] :: string_proplist(),
protocol = http :: http | https
%% TODO - add multipart?
}).
-record(response, {
headers :: list({string(), string()}),
headers :: string_proplist(),
code = 200 :: integer(),
cookies :: list({string(), string()}),
cookies :: string_proplist(),
body = "" :: string(),
req_dict :: list()
}).
@@ -77,6 +77,7 @@ start_tests(Outdir) ->
true ->
io:format("EWTS: Wow! Hold your horses mighty cowboy - eunit has failed, hasn't it?~n")
end,
io:format("EWTSEND~n"),
init:stop().
-spec(fget/2 :: (string(), term()) -> undefined | term()).
No changes.

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.
Oops, something went wrong.

0 comments on commit 42b5736

Please sign in to comment.