mirror of
https://github.com/ziglang/zig.git
synced 2026-02-15 13:58:27 +00:00
update tests to new Target API
This commit is contained in:
parent
2536e4c70c
commit
3c3316d4ba
@ -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" });
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user