aboutsummaryrefslogtreecommitdiff
path: root/src-self-hosted/test.zig
diff options
context:
space:
mode:
authorVexu <15308111+Vexu@users.noreply.github.com>2019-11-26 10:27:51 +0200
committerVexu <15308111+Vexu@users.noreply.github.com>2019-11-26 11:52:12 +0200
commit36849d8a7b5b0ed62d966ea9c402f192ade0cadf (patch)
treeb03def98fe255f4572add7e7cae155e07964e93c /src-self-hosted/test.zig
parent76f21852f6553fc22612bb82df19184fdb28719e (diff)
downloadzig-36849d8a7b5b0ed62d966ea9c402f192ade0cadf.tar.gz
zig-36849d8a7b5b0ed62d966ea9c402f192ade0cadf.zip
fixes and cleanup in self hosted
Diffstat (limited to 'src-self-hosted/test.zig')
-rw-r--r--src-self-hosted/test.zig11
1 files changed, 4 insertions, 7 deletions
diff --git a/src-self-hosted/test.zig b/src-self-hosted/test.zig
index 85b9d6b912..4c1ed6ad45 100644
--- a/src-self-hosted/test.zig
+++ b/src-self-hosted/test.zig
@@ -116,7 +116,7 @@ pub const TestContext = struct {
const file_index = try std.fmt.bufPrint(file_index_buf[0..], "{}", self.file_index.incr());
const file1_path = try std.fs.path.join(allocator, [_][]const u8{ tmp_dir_name, file_index, file1 });
- const output_file = try std.fmt.allocPrint(allocator, "{}-out{}", file1_path, (Target{.Native = {}}).exeFileExt());
+ const output_file = try std.fmt.allocPrint(allocator, "{}-out{}", file1_path, (Target{ .Native = {} }).exeFileExt());
if (std.fs.path.dirname(file1_path)) |dirname| {
try std.fs.makePath(allocator, dirname);
}
@@ -148,15 +148,12 @@ pub const TestContext = struct {
exe_file: []const u8,
expected_output: []const u8,
) anyerror!void {
- // TODO this should not be necessary
- const exe_file_2 = try std.mem.dupe(allocator, u8, exe_file);
-
defer comp.destroy();
const build_event = comp.events.get();
switch (build_event) {
.Ok => {
- const argv = [_][]const u8{exe_file_2};
+ const argv = [_][]const u8{exe_file};
// TODO use event loop
const child = try std.ChildProcess.exec(allocator, argv, null, null, 1024 * 1024);
switch (child.term) {
@@ -173,8 +170,8 @@ pub const TestContext = struct {
return error.OutputMismatch;
}
},
- Compilation.Event.Error => |err| return err,
- Compilation.Event.Fail => |msgs| {
+ .Error => |err| return err,
+ .Fail => |msgs| {
const stderr = std.io.getStdErr();
try stderr.write("build incorrectly failed:\n");
for (msgs) |msg| {