WIP: add remote_endpoint_test
This commit is contained in:
parent
b580d9da36
commit
0e804fc61f
6 changed files with 462 additions and 7 deletions
51
build.zig
51
build.zig
|
|
@ -86,6 +86,16 @@ pub fn build(b: *std.Build) void {
|
|||
});
|
||||
const cbor_mod = cbor_dep.module("cbor");
|
||||
|
||||
// thespian_mod must come before anything that depends on it.
|
||||
const thespian_mod = b.addModule("thespian", .{
|
||||
.root_source_file = b.path("src/thespian.zig"),
|
||||
.imports = &.{
|
||||
.{ .name = "cbor", .module = cbor_mod },
|
||||
},
|
||||
});
|
||||
thespian_mod.addIncludePath(b.path("include"));
|
||||
thespian_mod.linkLibrary(lib);
|
||||
|
||||
const framing_mod = b.createModule(.{
|
||||
.root_source_file = b.path("src/remote/framing.zig"),
|
||||
});
|
||||
|
|
@ -97,6 +107,18 @@ pub fn build(b: *std.Build) void {
|
|||
},
|
||||
});
|
||||
|
||||
const endpoint_mod = b.createModule(.{
|
||||
.root_source_file = b.path("src/remote/endpoint.zig"),
|
||||
.imports = &.{
|
||||
.{ .name = "thespian", .module = thespian_mod },
|
||||
.{ .name = "cbor", .module = cbor_mod },
|
||||
.{ .name = "framing", .module = framing_mod },
|
||||
.{ .name = "protocol", .module = protocol_mod },
|
||||
},
|
||||
});
|
||||
|
||||
// --- Child binaries (no Thespian context) ---
|
||||
|
||||
const remote_child = b.addExecutable(.{
|
||||
.name = "remote_child_send",
|
||||
.root_module = b.createModule(.{
|
||||
|
|
@ -123,14 +145,27 @@ pub fn build(b: *std.Build) void {
|
|||
}),
|
||||
});
|
||||
|
||||
const thespian_mod = b.addModule("thespian", .{
|
||||
.root_source_file = b.path("src/thespian.zig"),
|
||||
.imports = &.{
|
||||
.{ .name = "cbor", .module = cbor_mod },
|
||||
},
|
||||
// --- Child endpoint binary (full Thespian context) ---
|
||||
|
||||
const remote_child_endpoint = b.addExecutable(.{
|
||||
.name = "remote_child_endpoint",
|
||||
.root_module = b.createModule(.{
|
||||
.root_source_file = b.path("test/remote_child_endpoint.zig"),
|
||||
.target = target,
|
||||
.optimize = optimize,
|
||||
.imports = &.{
|
||||
.{ .name = "thespian", .module = thespian_mod },
|
||||
.{ .name = "cbor", .module = cbor_mod },
|
||||
.{ .name = "framing", .module = framing_mod },
|
||||
.{ .name = "protocol", .module = protocol_mod },
|
||||
},
|
||||
}),
|
||||
});
|
||||
thespian_mod.addIncludePath(b.path("include"));
|
||||
thespian_mod.linkLibrary(lib);
|
||||
remote_child_endpoint.linkLibrary(lib);
|
||||
remote_child_endpoint.linkLibrary(asio_dep.artifact("asio"));
|
||||
remote_child_endpoint.linkLibCpp();
|
||||
|
||||
// --- Test suite ---
|
||||
|
||||
const tests = b.addTest(.{
|
||||
.root_module = b.createModule(.{
|
||||
|
|
@ -142,12 +177,14 @@ pub fn build(b: *std.Build) void {
|
|||
|
||||
options.addOptionPath("remote_child_path", remote_child.getEmittedBin());
|
||||
options.addOptionPath("remote_child_roundtrip_path", remote_child_roundtrip.getEmittedBin());
|
||||
options.addOptionPath("remote_child_endpoint_path", remote_child_endpoint.getEmittedBin());
|
||||
|
||||
tests.root_module.addImport("build_options", options_mod);
|
||||
tests.root_module.addImport("cbor", cbor_mod);
|
||||
tests.root_module.addImport("thespian", thespian_mod);
|
||||
tests.root_module.addImport("framing", framing_mod);
|
||||
tests.root_module.addImport("protocol", protocol_mod);
|
||||
tests.root_module.addImport("endpoint", endpoint_mod);
|
||||
tests.addIncludePath(b.path("test"));
|
||||
tests.addIncludePath(b.path("src"));
|
||||
tests.addIncludePath(b.path("include"));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue