platform, sys, assets, audio compiling
This commit is contained in:
parent
96cf0a50ea
commit
cd27fcdb76
|
|
@ -26,9 +26,11 @@ pub fn build(b: *std.Build) void {
|
||||||
|
|
||||||
const test_step = b.step("test", "run unit tests for assets");
|
const test_step = b.step("test", "run unit tests for assets");
|
||||||
const tests = b.addTest(.{
|
const tests = b.addTest(.{
|
||||||
.target = target,
|
.root_module = b.createModule(.{
|
||||||
.optimize = optimize,
|
.target = target,
|
||||||
.root_source_file = b.path("tests/test.zig"),
|
.optimize = optimize,
|
||||||
|
.root_source_file = b.path("tests/test.zig"),
|
||||||
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
tests.root_module.addImport("assets", mod);
|
tests.root_module.addImport("assets", mod);
|
||||||
|
|
|
||||||
|
|
@ -25,9 +25,11 @@ pub fn build(b: *std.Build) void {
|
||||||
|
|
||||||
const test_step = b.step("test", "run unit tests for audio");
|
const test_step = b.step("test", "run unit tests for audio");
|
||||||
const tests = b.addTest(.{
|
const tests = b.addTest(.{
|
||||||
.target = target,
|
.root_module = b.createModule(.{
|
||||||
.optimize = optimize,
|
.target = target,
|
||||||
.root_source_file = b.path("tests/tests.zig"),
|
.optimize = optimize,
|
||||||
|
.root_source_file = b.path("tests/tests.zig"),
|
||||||
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
tests.root_module.addImport("audio", mod);
|
tests.root_module.addImport("audio", mod);
|
||||||
|
|
|
||||||
|
|
@ -19,9 +19,11 @@ pub fn build(b: *std.Build) void {
|
||||||
});
|
});
|
||||||
|
|
||||||
const tests = b.addTest(.{
|
const tests = b.addTest(.{
|
||||||
.target = target,
|
.root_module = b.createModule(.{
|
||||||
.optimize = optimize,
|
.target = target,
|
||||||
.root_source_file = b.path("tests/tests.zig"),
|
.optimize = optimize,
|
||||||
|
.root_source_file = b.path("tests/tests.zig"),
|
||||||
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
for (dependencyList) |depName| {
|
for (dependencyList) |depName| {
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,11 @@ const platform = @import("platform");
|
||||||
const std = @import("std");
|
const std = @import("std");
|
||||||
|
|
||||||
test "test platform integration" {
|
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);
|
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);
|
defer platform.shutdown_module(std.testing.allocator);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -53,13 +53,14 @@ pub fn build(b: *std.Build) void {
|
||||||
|
|
||||||
// ========== tests ==========
|
// ========== tests ==========
|
||||||
const tests = b.addTest(.{
|
const tests = b.addTest(.{
|
||||||
.target = target,
|
.root_module = b.createModule(.{
|
||||||
.optimize = optimize,
|
.target = target,
|
||||||
.root_source_file = b.path("tests/tests.zig"),
|
.optimize = optimize,
|
||||||
|
.root_source_file = b.path("tests/tests.zig"),
|
||||||
|
}),
|
||||||
});
|
});
|
||||||
const test_step = b.step("test", "run unit tests for rend");
|
const test_step = b.step("test", "run unit tests for rend");
|
||||||
|
|
||||||
tests.root_module.addImport("platform", mod);
|
|
||||||
const runArtifact = b.addRunArtifact(tests);
|
const runArtifact = b.addRunArtifact(tests);
|
||||||
test_step.dependOn(&runArtifact.step);
|
test_step.dependOn(&runArtifact.step);
|
||||||
b.installArtifact(tests);
|
b.installArtifact(tests);
|
||||||
|
|
|
||||||
|
|
@ -24,9 +24,11 @@ pub fn build(b: *std.Build) void {
|
||||||
|
|
||||||
// ========== tests ==========
|
// ========== tests ==========
|
||||||
const tests = b.addTest(.{
|
const tests = b.addTest(.{
|
||||||
.target = target,
|
.root_module = b.createModule(.{
|
||||||
.optimize = optimize,
|
.target = target,
|
||||||
.root_source_file = b.path("tests/tests.zig"),
|
.optimize = optimize,
|
||||||
|
.root_source_file = b.path("tests/tests.zig"),
|
||||||
|
}),
|
||||||
});
|
});
|
||||||
const test_step = b.step("test", "run unit tests for ui");
|
const test_step = b.step("test", "run unit tests for ui");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,11 +3,6 @@
|
||||||
.version = "0.0.0",
|
.version = "0.0.0",
|
||||||
.dependencies = .{
|
.dependencies = .{
|
||||||
.core = .{ .path = "../core" },
|
.core = .{ .path = "../core" },
|
||||||
.platform = .{ .path = "../platform" },
|
|
||||||
.papyrus = .{ .path = "../papyrus" },
|
|
||||||
.rend = .{ .path = "../rend" },
|
|
||||||
.sdl3 = .{ .path = "../../lib/sdl3" },
|
|
||||||
.shaderTypes = .{ .path = "../../lib/sdl3/shaderTypes" },
|
|
||||||
},
|
},
|
||||||
.paths = .{
|
.paths = .{
|
||||||
"",
|
"",
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ pub const SubprocessTask = struct {
|
||||||
self.stderr = .{};
|
self.stderr = .{};
|
||||||
self.stdout = .{};
|
self.stdout = .{};
|
||||||
core.engine_log("running task", .{});
|
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 = std.process.Child.init(self.argsOwned.items, self.allocator);
|
||||||
self.child.?.stdout_behavior = .Inherit;
|
self.child.?.stdout_behavior = .Inherit;
|
||||||
self.child.?.stderr_behavior = .Inherit;
|
self.child.?.stderr_behavior = .Inherit;
|
||||||
|
|
|
||||||
|
|
@ -16,11 +16,12 @@ test "testing threadrunner" {
|
||||||
const task = try sys.SubprocessTask.create(std.testing.allocator, &.{ "echo", "this is an echo: hello world\n" });
|
const task = try sys.SubprocessTask.create(std.testing.allocator, &.{ "echo", "this is an echo: hello world\n" });
|
||||||
defer task.destroy();
|
defer task.destroy();
|
||||||
|
|
||||||
std.debug.print("beginning destroy\n", .{});
|
std.debug.print("task1 finished\n", .{});
|
||||||
try task.run();
|
try task.run();
|
||||||
task.wait();
|
task.wait();
|
||||||
|
|
||||||
const task2 = try sys.runCommand(std.testing.allocator, &.{ "echo", "sup homies" }, null);
|
const task2 = try sys.runCommand(std.testing.allocator, &.{ "echo", "sup homies" }, null);
|
||||||
defer task2.destroy();
|
defer task2.destroy();
|
||||||
|
std.debug.print("task2 finished\n", .{});
|
||||||
task2.wait();
|
task2.wait();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue