diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2018-07-14 16:12:41 -0400 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2018-07-14 16:31:17 -0400 |
| commit | 28c3d4809bc6d497ac81892bc7eb03b95d8c2b32 (patch) | |
| tree | 1461827a130befdb2eb0938eb490588b350d845a /src-self-hosted/test.zig | |
| parent | 69e50ad2f54bc446b2258f464f9b09e78e132d45 (diff) | |
| download | zig-28c3d4809bc6d497ac81892bc7eb03b95d8c2b32.tar.gz zig-28c3d4809bc6d497ac81892bc7eb03b95d8c2b32.zip | |
rename Module to Compilation
and CompilationUnit to ObjectFile
Diffstat (limited to 'src-self-hosted/test.zig')
| -rw-r--r-- | src-self-hosted/test.zig | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src-self-hosted/test.zig b/src-self-hosted/test.zig index e609eb2791..3edb267ca9 100644 --- a/src-self-hosted/test.zig +++ b/src-self-hosted/test.zig @@ -2,11 +2,11 @@ const std = @import("std"); const mem = std.mem; const builtin = @import("builtin"); const Target = @import("target.zig").Target; -const Module = @import("module.zig").Module; +const Compilation = @import("compilation.zig").Compilation; const introspect = @import("introspect.zig"); const assertOrPanic = std.debug.assertOrPanic; const errmsg = @import("errmsg.zig"); -const EventLoopLocal = @import("module.zig").EventLoopLocal; +const EventLoopLocal = @import("compilation.zig").EventLoopLocal; test "compile errors" { var ctx: TestContext = undefined; @@ -100,42 +100,42 @@ pub const TestContext = struct { // TODO async I/O try std.io.writeFile(allocator, file1_path, source); - var module = try Module.create( + var comp = try Compilation.create( &self.event_loop_local, "test", file1_path, Target.Native, - Module.Kind.Obj, + Compilation.Kind.Obj, builtin.Mode.Debug, self.zig_lib_dir, self.zig_cache_dir, ); - errdefer module.destroy(); + errdefer comp.destroy(); - try module.build(); + try comp.build(); - try self.group.call(getModuleEvent, module, source, path, line, column, msg); + try self.group.call(getModuleEvent, comp, source, path, line, column, msg); } async fn getModuleEvent( - module: *Module, + comp: *Compilation, source: []const u8, path: []const u8, line: usize, column: usize, text: []const u8, ) !void { - defer module.destroy(); - const build_event = await (async module.events.get() catch unreachable); + defer comp.destroy(); + const build_event = await (async comp.events.get() catch unreachable); switch (build_event) { - Module.Event.Ok => { + Compilation.Event.Ok => { @panic("build incorrectly succeeded"); }, - Module.Event.Error => |err| { + Compilation.Event.Error => |err| { @panic("build incorrectly failed"); }, - Module.Event.Fail => |msgs| { + Compilation.Event.Fail => |msgs| { assertOrPanic(msgs.len != 0); for (msgs) |msg| { if (mem.endsWith(u8, msg.path, path) and mem.eql(u8, msg.text, text)) { |
