Changeset 3
- Timestamp:
- 05/01/07 08:43:31 (5 years ago)
- Location:
- trunk/src
- Files:
-
- 1 added
- 1 edited
-
plain_file_logger.erl (added)
-
testing_server.erl (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/testing_server.erl
r2 r3 31 31 32 32 -export([start/3,stop/0,loop/5]). 33 -export([start/2, stop/1]). 33 34 34 start (Dir,Notification,Options) ->35 start (Dir, Notification, Options) when is_function (Notification) -> 35 36 Pid = spawn (?MODULE, loop, [Dir, Notification, Options, no_monitor, init]), 36 37 register(testing_server,Pid), … … 42 43 Pid. 43 44 45 start (Dir, File) -> 46 Logger = spawn (plain_file_logger, start, [File, write]), 47 Notify = fun(E) -> Logger ! E end, 48 Server = start (Dir, Notify, [{report_function, Notify}]), 49 {Server, Logger}. 50 44 51 stop()-> 45 52 testing_server ! stop. 53 54 stop ({Server, Logger}) -> 55 Server ! stop, 56 Logger ! stop, 57 bye. 46 58 47 59 loop (Dir, Notification, Options, no_monitor, State) -> … … 59 71 stop -> 60 72 file_monitor:stop(Monitor); 61 {Monitor, _, _} -> 62 New_state = xpdojo:test_files (Dir, Options), 63 notify (Notification, New_state, State), 73 {Monitor, _, File} -> 74 case filename:extension (File) of 75 ".erl" -> 76 New_state = xpdojo:test_files (Dir, Options), 77 Notification (New_state); 78 _ -> 79 New_state = State 80 end, 64 81 loop (Dir, Notification, Options, Monitor, New_state); 65 82 _ -> 66 83 loop (Dir, Notification, Options, Monitor, State) 67 84 end. 68 69 notify (_, unchanged, _) ->70 ok;71 notify (_, State, State) ->72 ok;73 notify (Notify, New_state, _) ->74 Notify (New_state).75 85 76 86 purge_monitor_message(Monitor) ->
Note: See TracChangeset
for help on using the changeset viewer.
