From e0e65698ff6c9f75c9944c38f75ce66811300af1 Mon Sep 17 00:00:00 2001 From: Meghan Denny Date: Fri, 14 Feb 2025 02:57:32 -0800 Subject: [PATCH] update to 0.13 and add tests --- build.zig | 13 +++++++++++-- test.zig | 7 +++++++ zig.mod | 5 ++++- 3 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 test.zig diff --git a/build.zig b/build.zig index c5018f02df58fc276d32a5064aa3b4fe12fd294d..86d836a5c54d38f235217a4e55b42e6c22d648a3 100644 --- a/build.zig +++ b/build.zig @@ -23,6 +23,15 @@ pub fn build(b: *std.Build) void { const run_step = b.step("run", "Run the app"); run_step.dependOn(&run_cmd.step); - const test_step = b.step("test", "dummy test step to pass CI checks"); - _ = test_step; + const tests = b.addTest(.{ + .root_source_file = b.path("test.zig"), + .target = target, + .optimize = mode, + }); + deps.addAllTo(tests); + + const test_step = b.step("test", "Run all library tests"); + const tests_run = b.addRunArtifact(tests); + tests_run.has_side_effects = true; + test_step.dependOn(&tests_run.step); } diff --git a/test.zig b/test.zig new file mode 100644 index 0000000000000000000000000000000000000000..3ba63fb4ec21a345db50940851243c3947465c81 --- /dev/null +++ b/test.zig @@ -0,0 +1,7 @@ +const std = @import("std"); +const zorm = @import("zorm"); + +// TODO: add more behavior tests that create+update+delete dbs +test { + std.testing.refAllDeclsRecursive(zorm.engine(.sqlite3)); +} diff --git a/zig.mod b/zig.mod index 02e6b7fed0e9db6a9935a4a109fb5417bfdca215..1eb9d7bd841215a38d64c5344d243a20a6eb0b14 100644 --- a/zig.mod +++ b/zig.mod @@ -4,5 +4,8 @@ main: src/lib.zig license: AGPL-3.0 description: The ORM library for Zig. dependencies: - - src: git https://github.com/vrischmann/zig-sqlite + - src: git https://github.com/vrischmann/zig-sqlite commit-91e5fedd15c5ea3cb42ccceefb3d0f4bb9bad68f + c_source_files: + - c/sqlite3.c + - c/workaround.c - src: git https://github.com/nektro/zig-tracer -- 2.54.0