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 @@
11const std = @import("std");
2const builtin = @import("builtin");
32const testing = std.testing;
43const process = std.process;
54const fs = std.fs;
......@@ -97,7 +96,7 @@ fn testZigInitExe(zig_exe: []const u8, dir_path: []const u8) !void {
9796}
9897
9998fn 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
102101 const example_zig_path = try fs.path.join(a, &[_][]const u8{ dir_path, "example.zig" });
103102 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 @@
1const builtin = @import("builtin");
21const std = @import("std");
32const os = std.os;
43const tests = @import("tests.zig");
......@@ -131,8 +130,8 @@ pub fn addCases(cases: *tests.CompareOutputContext) void {
131130 , "Hello, world!\n 12 12 a\n");
132131
133132 cases.addC("number literals",
134 \\const builtin = @import("builtin");
135 \\const is_windows = builtin.os == builtin.Os.windows;
133 \\const std = @import("std");
134 \\const is_windows = std.Target.current.os.tag == .windows;
136135 \\const c = @cImport({
137136 \\ if (is_windows) {
138137 \\ // See https://github.com/ziglang/zig/issues/515
......@@ -306,8 +305,8 @@ pub fn addCases(cases: *tests.CompareOutputContext) void {
306305 , "");
307306
308307 cases.addC("casting between float and integer types",
309 \\const builtin = @import("builtin");
310 \\const is_windows = builtin.os == builtin.Os.windows;
308 \\const std = @import("std");
309 \\const is_windows = std.Target.current.os.tag == .windows;
311310 \\const c = @cImport({
312311 \\ if (is_windows) {
313312 \\ // See https://github.com/ziglang/zig/issues/515