Skip to content

Commit

Permalink
use addCSourceFile
Browse files Browse the repository at this point in the history
  • Loading branch information
mattnite committed Dec 28, 2024
1 parent 551b5cb commit 7b42273
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
5 changes: 4 additions & 1 deletion build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,14 @@ fn addTestSuite(

const test_payload = b.addExecutable(.{
.name = std.fs.path.stem(entry.basename),
.root_source_file = b.path(b.fmt("testsuite/{s}", .{entry.path})),
.target = custom_target,
.optimize = config.optimize,
.strip = false,
});
test_payload.addCSourceFile(.{
.file = b.path(b.fmt("testsuite/{s}", .{entry.path})),
.flags = &.{},
});
test_payload.bundle_compiler_rt = false;
test_payload.addIncludePath(b.path("testsuite"));
test_payload.setLinkerScriptPath(b.path("linker.ld"));
Expand Down
10 changes: 5 additions & 5 deletions src/testrunner.zig
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ fn validateSystemAndExit(exit_mode: ExitMode) noreturn {
std.debug.print("test {s} failed.\n", .{ts.options.name});
}

std.os.exit(if (ok) 0x00 else 0x01);
std.process.exit(if (ok) 0x00 else 0x01);
}

pub fn main() !u8 {
Expand Down Expand Up @@ -352,16 +352,16 @@ const IO = struct {
fn lobyte(val: *u16) *u8 {
const bits: *[2]u8 = @ptrCast(val);
return switch (comptime builtin.cpu.arch.endian()) {
.Big => return &bits[1],
.Little => return &bits[0],
.big => return &bits[1],
.little => return &bits[0],
};
}

fn hibyte(val: *u16) *u8 {
const bits: *[2]u8 = @ptrCast(val);
return switch (comptime builtin.cpu.arch.endian()) {
.Big => return &bits[0],
.Little => return &bits[1],
.big => return &bits[0],
.little => return &bits[1],
};
}

Expand Down

0 comments on commit 7b42273

Please sign in to comment.