Skip to content
This repository was archived by the owner on Apr 21, 2025. It is now read-only.

Commit 7b42273

Browse files
committed
use addCSourceFile
1 parent 551b5cb commit 7b42273

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

build.zig

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,11 +194,14 @@ fn addTestSuite(
194194

195195
const test_payload = b.addExecutable(.{
196196
.name = std.fs.path.stem(entry.basename),
197-
.root_source_file = b.path(b.fmt("testsuite/{s}", .{entry.path})),
198197
.target = custom_target,
199198
.optimize = config.optimize,
200199
.strip = false,
201200
});
201+
test_payload.addCSourceFile(.{
202+
.file = b.path(b.fmt("testsuite/{s}", .{entry.path})),
203+
.flags = &.{},
204+
});
202205
test_payload.bundle_compiler_rt = false;
203206
test_payload.addIncludePath(b.path("testsuite"));
204207
test_payload.setLinkerScriptPath(b.path("linker.ld"));

src/testrunner.zig

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ fn validateSystemAndExit(exit_mode: ExitMode) noreturn {
103103
std.debug.print("test {s} failed.\n", .{ts.options.name});
104104
}
105105

106-
std.os.exit(if (ok) 0x00 else 0x01);
106+
std.process.exit(if (ok) 0x00 else 0x01);
107107
}
108108

109109
pub fn main() !u8 {
@@ -352,16 +352,16 @@ const IO = struct {
352352
fn lobyte(val: *u16) *u8 {
353353
const bits: *[2]u8 = @ptrCast(val);
354354
return switch (comptime builtin.cpu.arch.endian()) {
355-
.Big => return &bits[1],
356-
.Little => return &bits[0],
355+
.big => return &bits[1],
356+
.little => return &bits[0],
357357
};
358358
}
359359

360360
fn hibyte(val: *u16) *u8 {
361361
const bits: *[2]u8 = @ptrCast(val);
362362
return switch (comptime builtin.cpu.arch.endian()) {
363-
.Big => return &bits[0],
364-
.Little => return &bits[1],
363+
.big => return &bits[0],
364+
.little => return &bits[1],
365365
};
366366
}
367367

0 commit comments

Comments
 (0)