23 lines
660 B
Zig
23 lines
660 B
Zig
const sys = @import("sys");
|
|
const core = sys.core;
|
|
const std = @import("std");
|
|
|
|
test "testing threadrunner" {
|
|
var spec = core.SpecVariantMap.init(std.testing.allocator);
|
|
try spec.put("name", .{ .string = "test" });
|
|
defer spec.deinit();
|
|
|
|
try core.start_module(&spec, .{}, std.testing.allocator);
|
|
defer core.shutdown_module(std.testing.allocator);
|
|
|
|
try sys.start_module(&spec, .{}, std.testing.allocator);
|
|
defer sys.shutdown_module(std.testing.allocator);
|
|
|
|
const command = sys.runSystemCommand(&.{ "timeout", "/t", "3" });
|
|
defer command.destroy();
|
|
|
|
while (command.isComplete()) {}
|
|
|
|
if (command.ensureCompleted()) {}
|
|
}
|