Changeset 63
- Timestamp:
- 07/13/09 11:17:12 (3 years ago)
- Location:
- trunk/src
- Files:
-
- 3 edited
-
compiler.erl (modified) (2 diffs)
-
compiler_test.erl (modified) (3 diffs)
-
shells.erl (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/compiler.erl
r62 r63 12 12 receive_files (Notify, Watcher, Modules, New) -> 13 13 receive 14 {Watcher, {{file, ".erl"}, File, found}}->15 receive_files (Notify, Watcher, Modules, dict: store (File, found, New));14 {Watcher, {{file, ".erl"}, File, Event}} when Event == found; Event == changed -> 15 receive_files (Notify, Watcher, Modules, dict: store (File, Event, New)); 16 16 {Watcher, _} -> 17 17 receive_files (Notify, Watcher, Modules, New) … … 30 30 loop (Notify, Watcher, Processed). 31 31 32 process (File, found, {Modules, Notify, Binaries}) -> 32 process (File, Event, {Modules, Notify, Binaries}) when Event == found; 33 Event == changed -> 33 34 Result = modules: compile (File), 34 35 notify_result (Result, Notify), -
trunk/src/compiler_test.erl
r62 r63 7 7 -export ([compiles_and_reports_progress_warnings_and_errors/0]). 8 8 -export ([provides_binaries_when_all_compiled/0]). 9 -export ([recompiles_minimally_after_change/0]). 9 10 -include_lib("stdlib/include/ms_transform.hrl"). 10 11 … … 17 18 provides_binaries_when_all_compiled () -> 18 19 F = fun provides_binaries_when_all_compiled/2, 20 ok = fixtures: use_tree (good_erl_tree (), F). 21 22 recompiles_minimally_after_change () -> 23 F = fun recompiles_minimally_after_change/2, 19 24 ok = fixtures: use_tree (good_erl_tree (), F). 20 25 … … 30 35 ok. 31 36 32 %% stops 37 recompiles_minimally_after_change (Root, _) -> 38 Compiler = spawn_link (compiler, init, [notify_me (), Root]), 39 receive_all (), 40 File = filename: join (Root, "hello.erl"), 41 Bin = list_to_binary ("-module(hello). -export([run/0]). run()->hello_howdy."), 42 ok = file: write_file (File, Bin), 43 [{2, 1, 1}, {2, 2, 2}, {binaries, [B]}] = receive_all (), 44 Compiler ! stop, 45 {ok, {hello, _}} = beam_lib: chunks (B, [exports]), 46 ok. 33 47 34 %% empty tree 35 48 %% More tests: 49 %% - stops 50 %% - empty tree 51 %% - add a file 52 %% - remove a file 36 53 37 54 check ([{Total, 0, 0} | _] = Xs, unknown) -> -
trunk/src/shells.erl
r45 r63 11 11 receive {Self, done} -> ok; 12 12 M -> io:fwrite ("tests_crash: ~p~n", [M]) 13 after 20000 -> throw ("tests timed out~n")13 after 30000 -> throw ("tests timed out~n") 14 14 end 15 15
Note: See TracChangeset
for help on using the changeset viewer.
