Browse files

Starting Erlang Web in the interactive mode as a port works for EWTS

  • Loading branch information...
1 parent 8280984 commit d4658da06ca70e12bf13510c1414e53d7755b2e9 Michal Ptaszek committed Oct 13, 2009
Showing with 9 additions and 7 deletions.
  1. +9 −7 bin/test.erl
View
16 bin/test.erl 100644 → 100755
@@ -24,29 +24,31 @@
%%%-------------------------------------------------------------------
main([]) ->
- run_tests("ewts_reports");
+ run_tests("doc/ewts_report");
main(_) ->
print_usage().
-run_tests() ->
- start_interactive_mode_node().
+run_tests(Dir) ->
+ start_interactive_mode_node(Dir).
start_interactive_mode_node(ReportDir) ->
- Port = open_port({spawn, "bin/start_interactive -run ewts start_tests" ++ ReportDir},
+ Port = open_port({spawn, "bin/start_interactive inets single_node -run ewts start_tests " ++ ReportDir},
[use_stdio, stderr_to_stdout, stream, {line, 1024}]),
print_output(Port).
print_output(Port) ->
receive
- {Port, {data, {eol, "EWTS: " ++ Line}}} ->
- io:format(Line);
+ {Port, {data, {eol, "1> EWTS: " ++ Line}}} ->
+ io:format("~s~n", [Line]),
+ print_output(Port);
{Port, {data, _Data}} ->
print_output(Port)
after 1000 ->
+ port_close(Port),
ok
end.
print_usage() ->
io:format("Usage:~n"
- "bin/test.erl [run] - run the tests~n"
+ "bin/test.erl [run [ReportDir]] - run the tests~n"
"bin/test.erl compile - compile the tests - do not run them~n").

0 comments on commit d4658da

Please sign in to comment.