diff options
Diffstat (limited to 'build.zig')
| -rw-r--r-- | build.zig | 21 |
1 files changed, 20 insertions, 1 deletions
@@ -101,6 +101,22 @@ pub fn build(b: *std.Build) !void { const objdump_step = b.step("objdump", "Compare elfo output against objdump per symbol"); objdump_step.dependOn(&compare_runner.step); + + // Symbol resolution test + const test_symbols_mod = b.createModule(.{ + .root_source_file = b.path("tests/test_symbols.zig"), + .target = target, + .optimize = optimize, + .link_libc = true, + }); + test_symbols_mod.addImport("elfo", elfo.root_module); + const test_symbols = b.addExecutable(.{ + .name = "test_symbols", + .root_module = test_symbols_mod, + }); + const run_test_symbols = b.addRunArtifact(test_symbols); + run_test_symbols.addArtifactArg(c_test_exe); + run_test_symbols.expectExitCode(0); // --- const zls_check = b.step("check", "Check if the program compiles"); @@ -108,8 +124,11 @@ pub fn build(b: *std.Build) !void { zls_check.dependOn(&shock.step); zls_check.dependOn(&unit_tests.step); + const test_step = b.step("test", "Run unit tests"); + test_step.dependOn(&run_test_symbols.step); + const run_steps = [_]struct { *std.Build.Step, *std.Build.Step.Compile }{ - .{ b.step("test", "Run unit tests"), unit_tests }, + .{ test_step, unit_tests }, .{ b.step("elfo", "See the pretty elfo!"), elfo }, .{ b.step("gloves", "See the pretty gloves!"), gloves }, .{ b.step("shock", "SHOCK something!"), shock }, |
