added deserialiser tests, fixed some bugs in deserialised

This commit is contained in:
Moritz Gmeiner 2025-03-31 00:02:39 +02:00
commit 0275d67669
8 changed files with 267 additions and 93 deletions

View file

@ -33,7 +33,7 @@ pub fn build(b: *std.Build) void {
// for actually invoking the compiler.
const lib = b.addLibrary(.{
.linkage = .static,
.name = "msgpack_zig",
.name = "msgpack",
.root_module = lib_mod,
});
@ -47,12 +47,23 @@ pub fn build(b: *std.Build) void {
const lib_unit_tests = b.addTest(.{
.root_module = lib_mod,
});
const run_lib_unit_tests = b.addRunArtifact(lib_unit_tests);
const tests_tests = b.addTest(.{
.root_source_file = b.path("tests/root.zig"),
.target = target,
.optimize = optimize,
});
tests_tests.root_module.addImport("msgpack", lib.root_module);
const run_tests_tests = b.addRunArtifact(tests_tests);
// Similar to creating the run step earlier, this exposes a `test` step to
// the `zig build --help` menu, providing a way for the user to request
// running the unit tests.
const test_step = b.step("test", "Run unit tests");
const test_step = b.step("test", "Run tests");
test_step.dependOn(&run_lib_unit_tests.step);
test_step.dependOn(&run_tests_tests.step);
}