╭ changed ╮ │build.zig│ ╰─────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭───────────────────────────────────────────────────────────────────────────╮ │74 │ │75 break :blk install_exe; │ │76 }; │ │77 + │ │78 + // test │ │79 + { │ │80 + const unit_tests = b.addTest(.{ │ │81 + .root_module = b.createModule(.{ │ │82 + .root_source_file = b.path("src/test.zig"), │ │83 + .target = target, │ │84 + .optimize = optimize, │ │85 + }), │ │86 + }); │ │87 + unit_tests.root_module.addImport("xit", xit_dep.module("xit"));│ │88 + │ │89 + const run_unit_tests = b.addRunArtifact(unit_tests); │ │90 + run_unit_tests.has_side_effects = true; │ │91 + const test_step = b.step("test", "Run unit tests"); │ │92 + test_step.dependOn(&install_main_exe.step); │ │93 + test_step.dependOn(&run_unit_tests.step); │ │94 + } │ │95 │ │96 // module for using haxy as a library │ │97 // (the commands below consume haxy this way) │ ╰───────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────╮ │121 │ │122 const run_step = b.step("try", "Try the app"); │ │123 run_step.dependOn(&run_cmd.step); │ │106 - } │ │107 - │ │108 - // test │ │109 - { │ │110 - const unit_tests = b.addTest(.{ │ │111 - .root_module = b.createModule(.{ │ │112 - .root_source_file = b.path("src/test.zig"), │ │113 - .target = target, │ │114 - .optimize = optimize, │ │115 - }), │ │116 - }); │ │117 - unit_tests.root_module.addImport("haxy", haxy); │ │118 - │ │119 - const run_unit_tests = b.addRunArtifact(unit_tests);│ │120 - run_unit_tests.has_side_effects = true; │ │121 - const test_step = b.step("test", "Run unit tests"); │ │122 - test_step.dependOn(&install_main_exe.step); │ │123 - test_step.dependOn(&run_unit_tests.step); │ │124 } │ │125 │ │126 // testnet │ ╰─────────────────────────────────────────────────────────────────╯