build: examples run independently & sysaudio examples renamed as tests

This commit is contained in:
Ronald M Zielaznicki 2024-10-30 00:44:37 -04:00 committed by Stephen Gutekanst
parent 825a676d36
commit 910e8f6e82
9 changed files with 84 additions and 64 deletions

View file

@ -1,24 +0,0 @@
const std = @import("std");
const mach = @import("mach");
// The global list of Mach modules our application may use.
pub const modules = .{
mach.Core,
@import("App.zig"),
};
// TODO: move this to a mach "entrypoint" zig module which handles nuances like WASM requires.
pub fn main() !void {
const allocator = std.heap.c_allocator;
// Initialize module system
try mach.mods.init(allocator);
// Schedule .app.start to run.
mach.mods.schedule(.app, .start);
// Dispatch systems forever or until there are none left to dispatch. If your app uses mach.Core
// then this will block forever and never return.
const stack_space = try allocator.alloc(u8, 8 * 1024 * 1024);
try mach.mods.dispatch(stack_space, .{});
}