update tests to new Target API

This commit is contained in:
Andrew Kelley 2020-02-27 13:32:35 -05:00
parent 2536e4c70c
commit 3c3316d4ba
No known key found for this signature in database
GPG Key ID: 7C5F548F728501A9
2 changed files with 5 additions and 7 deletions

View File

@ -1,5 +1,4 @@
const std = @import("std");
const builtin = @import("builtin");
const testing = std.testing;
const process = std.process;
const fs = std.fs;
@ -97,7 +96,7 @@ fn testZigInitExe(zig_exe: []const u8, dir_path: []const u8) !void {
}
fn testGodboltApi(zig_exe: []const u8, dir_path: []const u8) anyerror!void {
if (builtin.os != .linux or builtin.arch != .x86_64) return;
if (std.Target.current.os.tag != .linux or std.Target.current.cpu.arch != .x86_64) return;
const example_zig_path = try fs.path.join(a, &[_][]const u8{ dir_path, "example.zig" });
const example_s_path = try fs.path.join(a, &[_][]const u8{ dir_path, "example.s" });

View File

@ -1,4 +1,3 @@
const builtin = @import("builtin");
const std = @import("std");
const os = std.os;
const tests = @import("tests.zig");
@ -131,8 +130,8 @@ pub fn addCases(cases: *tests.CompareOutputContext) void {
, "Hello, world!\n 12 12 a\n");
cases.addC("number literals",
\\const builtin = @import("builtin");
\\const is_windows = builtin.os == builtin.Os.windows;
\\const std = @import("std");
\\const is_windows = std.Target.current.os.tag == .windows;
\\const c = @cImport({
\\ if (is_windows) {
\\ // See https://github.com/ziglang/zig/issues/515
@ -306,8 +305,8 @@ pub fn addCases(cases: *tests.CompareOutputContext) void {
, "");
cases.addC("casting between float and integer types",
\\const builtin = @import("builtin");
\\const is_windows = builtin.os == builtin.Os.windows;
\\const std = @import("std");
\\const is_windows = std.Target.current.os.tag == .windows;
\\const c = @cImport({
\\ if (is_windows) {
\\ // See https://github.com/ziglang/zig/issues/515