authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-02-27 13:32:35-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-02-28 14:51:55-05:00
log3c3316d4ba3ede6172fc0a92b6c4c9b8e601adde
tree0f0242c8ebb8f815913e69255e0cb4715d683526
parent2536e4c70c6805b096992d4e54dfd2ab9f7fcae3
signaturelock-open Commit is signed but in an unrecognized format.

update tests to new Target API


2 files changed, 5 insertions(+), 7 deletions(-)

test/cli.zig+1-2
...@@ -1,5 +1,4 @@...@@ -1,5 +1,4 @@
1const std = @import("std");1const std = @import("std");
2const builtin = @import("builtin");
3const testing = std.testing;2const testing = std.testing;
4const process = std.process;3const process = std.process;
5const fs = std.fs;4const fs = std.fs;
...@@ -97,7 +96,7 @@ fn testZigInitExe(zig_exe: []const u8, dir_path: []const u8) !void {...@@ -97,7 +96,7 @@ fn testZigInitExe(zig_exe: []const u8, dir_path: []const u8) !void {
97}96}
9897
99fn testGodboltApi(zig_exe: []const u8, dir_path: []const u8) anyerror!void {98fn testGodboltApi(zig_exe: []const u8, dir_path: []const u8) anyerror!void {
100 if (builtin.os != .linux or builtin.arch != .x86_64) return;99 if (std.Target.current.os.tag != .linux or std.Target.current.cpu.arch != .x86_64) return;
101100
102 const example_zig_path = try fs.path.join(a, &[_][]const u8{ dir_path, "example.zig" });101 const example_zig_path = try fs.path.join(a, &[_][]const u8{ dir_path, "example.zig" });
103 const example_s_path = try fs.path.join(a, &[_][]const u8{ dir_path, "example.s" });102 const example_s_path = try fs.path.join(a, &[_][]const u8{ dir_path, "example.s" });
test/compare_output.zig+4-5
...@@ -1,4 +1,3 @@...@@ -1,4 +1,3 @@
1const builtin = @import("builtin");
2const std = @import("std");1const std = @import("std");
3const os = std.os;2const os = std.os;
4const tests = @import("tests.zig");3const tests = @import("tests.zig");
...@@ -131,8 +130,8 @@ pub fn addCases(cases: *tests.CompareOutputContext) void {...@@ -131,8 +130,8 @@ pub fn addCases(cases: *tests.CompareOutputContext) void {
131 , "Hello, world!\n 12 12 a\n");130 , "Hello, world!\n 12 12 a\n");
132131
133 cases.addC("number literals",132 cases.addC("number literals",
134 \\const builtin = @import("builtin");133 \\const std = @import("std");
135 \\const is_windows = builtin.os == builtin.Os.windows;134 \\const is_windows = std.Target.current.os.tag == .windows;
136 \\const c = @cImport({135 \\const c = @cImport({
137 \\ if (is_windows) {136 \\ if (is_windows) {
138 \\ // See https://github.com/ziglang/zig/issues/515137 \\ // See https://github.com/ziglang/zig/issues/515
...@@ -306,8 +305,8 @@ pub fn addCases(cases: *tests.CompareOutputContext) void {...@@ -306,8 +305,8 @@ pub fn addCases(cases: *tests.CompareOutputContext) void {
306 , "");305 , "");
307306
308 cases.addC("casting between float and integer types",307 cases.addC("casting between float and integer types",
309 \\const builtin = @import("builtin");308 \\const std = @import("std");
310 \\const is_windows = builtin.os == builtin.Os.windows;309 \\const is_windows = std.Target.current.os.tag == .windows;
311 \\const c = @cImport({310 \\const c = @cImport({
312 \\ if (is_windows) {311 \\ if (is_windows) {
313 \\ // See https://github.com/ziglang/zig/issues/515312 \\ // See https://github.com/ziglang/zig/issues/515