diff options
| author | Gabriel Schneider <[email protected]> | 2026-06-08 22:36:22 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-06-08 23:05:25 -0300 |
| commit | 34de4c7fa3a740eed14bd58b778728942bf0b005 (patch) | |
| tree | c9bc67c7e3361fa25f94fdc567506fc70cf7545b /build.zig | |
| parent | d578c82c7fb3a2ac9557926ae6690b4f13534c22 (diff) | |
| download | codenomicon-34de4c7fa3a740eed14bd58b778728942bf0b005.tar.gz codenomicon-34de4c7fa3a740eed14bd58b778728942bf0b005.zip | |
added tests
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 }, |
