From 6b0d21da60ae3790f37813ca0bd8cc5e851e973d Mon Sep 17 00:00:00 2001 From: Madeorsk Date: Fri, 11 Apr 2025 23:55:10 +0200 Subject: [PATCH] Fix tests that were not running. --- build.zig | 4 +++- tests/root.zig | 4 ---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/build.zig b/build.zig index 9aaf4f8..0ed94c7 100644 --- a/build.zig +++ b/build.zig @@ -22,10 +22,12 @@ pub fn build(b: *std.Build) void { // Add unit tests. const lib_unit_tests = b.addTest(.{ - .root_module = lib_mod, + .root_source_file = b.path("tests/root.zig"), .target = target, .optimize = optimize, }); + lib_unit_tests.root_module.addImport("zap", zap.module("zap")); + lib_unit_tests.root_module.addImport("zouter", lib_mod); const run_lib_unit_tests = b.addRunArtifact(lib_unit_tests); const test_step = b.step("test", "Run unit tests."); diff --git a/tests/root.zig b/tests/root.zig index 0897ca1..3eacf48 100644 --- a/tests/root.zig +++ b/tests/root.zig @@ -1,10 +1,6 @@ const std = @import("std"); const zouter = @import("zouter"); -test { -// try std.testing.refAllDecls(zouter); -} - comptime { _ = @import("example.zig"); _ = @import("simple_routes.zig");