platform, sys, assets, audio compiling

This commit is contained in:
peterino2 2025-10-15 01:20:01 -07:00
parent 96cf0a50ea
commit cd27fcdb76
9 changed files with 33 additions and 25 deletions

View File

@ -26,9 +26,11 @@ pub fn build(b: *std.Build) void {
const test_step = b.step("test", "run unit tests for assets");
const tests = b.addTest(.{
.target = target,
.optimize = optimize,
.root_source_file = b.path("tests/test.zig"),
.root_module = b.createModule(.{
.target = target,
.optimize = optimize,
.root_source_file = b.path("tests/test.zig"),
}),
});
tests.root_module.addImport("assets", mod);

View File

@ -25,9 +25,11 @@ pub fn build(b: *std.Build) void {
const test_step = b.step("test", "run unit tests for audio");
const tests = b.addTest(.{
.target = target,
.optimize = optimize,
.root_source_file = b.path("tests/tests.zig"),
.root_module = b.createModule(.{
.target = target,
.optimize = optimize,
.root_source_file = b.path("tests/tests.zig"),
}),
});
tests.root_module.addImport("audio", mod);

View File

@ -19,9 +19,11 @@ pub fn build(b: *std.Build) void {
});
const tests = b.addTest(.{
.target = target,
.optimize = optimize,
.root_source_file = b.path("tests/tests.zig"),
.root_module = b.createModule(.{
.target = target,
.optimize = optimize,
.root_source_file = b.path("tests/tests.zig"),
}),
});
for (dependencyList) |depName| {

View File

@ -4,8 +4,11 @@ const platform = @import("platform");
const std = @import("std");
test "test platform integration" {
try core.start_module(.{}, .{}, std.testing.allocator);
var specMap = core.SpecVariantMap.init(std.testing.allocator);
defer specMap.deinit();
try specMap.put("name", .{ .string = "testName" });
try core.start_module(&specMap, .{}, std.testing.allocator);
defer core.shutdown_module(std.testing.allocator);
try platform.start_module(.{}, .{}, std.testing.allocator);
try platform.start_module(&specMap, .{}, std.testing.allocator);
defer platform.shutdown_module(std.testing.allocator);
}

View File

@ -53,13 +53,14 @@ pub fn build(b: *std.Build) void {
// ========== tests ==========
const tests = b.addTest(.{
.target = target,
.optimize = optimize,
.root_source_file = b.path("tests/tests.zig"),
.root_module = b.createModule(.{
.target = target,
.optimize = optimize,
.root_source_file = b.path("tests/tests.zig"),
}),
});
const test_step = b.step("test", "run unit tests for rend");
tests.root_module.addImport("platform", mod);
const runArtifact = b.addRunArtifact(tests);
test_step.dependOn(&runArtifact.step);
b.installArtifact(tests);

View File

@ -24,9 +24,11 @@ pub fn build(b: *std.Build) void {
// ========== tests ==========
const tests = b.addTest(.{
.target = target,
.optimize = optimize,
.root_source_file = b.path("tests/tests.zig"),
.root_module = b.createModule(.{
.target = target,
.optimize = optimize,
.root_source_file = b.path("tests/tests.zig"),
}),
});
const test_step = b.step("test", "run unit tests for ui");

View File

@ -3,11 +3,6 @@
.version = "0.0.0",
.dependencies = .{
.core = .{ .path = "../core" },
.platform = .{ .path = "../platform" },
.papyrus = .{ .path = "../papyrus" },
.rend = .{ .path = "../rend" },
.sdl3 = .{ .path = "../../lib/sdl3" },
.shaderTypes = .{ .path = "../../lib/sdl3/shaderTypes" },
},
.paths = .{
"",

View File

@ -42,7 +42,7 @@ pub const SubprocessTask = struct {
self.stderr = .{};
self.stdout = .{};
core.engine_log("running task", .{});
core.engine_log("cwd = {s}", .{self.workingDir.?});
core.engine_log("cwd = {?s}", .{self.workingDir});
self.child = std.process.Child.init(self.argsOwned.items, self.allocator);
self.child.?.stdout_behavior = .Inherit;
self.child.?.stderr_behavior = .Inherit;

View File

@ -16,11 +16,12 @@ test "testing threadrunner" {
const task = try sys.SubprocessTask.create(std.testing.allocator, &.{ "echo", "this is an echo: hello world\n" });
defer task.destroy();
std.debug.print("beginning destroy\n", .{});
std.debug.print("task1 finished\n", .{});
try task.run();
task.wait();
const task2 = try sys.runCommand(std.testing.allocator, &.{ "echo", "sup homies" }, null);
defer task2.destroy();
std.debug.print("task2 finished\n", .{});
task2.wait();
}