diff options
author | Christian Segundo | 2023-07-24 10:28:58 +0200 |
---|---|---|
committer | Christian Segundo | 2023-07-24 10:28:58 +0200 |
commit | f743e05e207046073999ee7234a157359d6a4f57 (patch) | |
tree | 0ceb01ffdcdc3a094e488c28e80c80d89f8309c5 /build.zig | |
parent | b02b7f71978a172848322f0671d580e425634916 (diff) | |
download | zmission-master.tar.gz |
Diffstat (limited to 'build.zig')
-rw-r--r-- | build.zig | 31 |
1 files changed, 21 insertions, 10 deletions
@@ -1,5 +1,5 @@ const std = @import("std"); -//const DockerStep = @import("DockerStep.zig"); +const DockerStep = @import("DockerStep.zig"); // Although this function looks imperative, note that its job is to // declaratively construct a build graph that will be executed by an external @@ -30,11 +30,11 @@ pub fn build(b: *std.Build) void { // running `zig build`). b.installArtifact(lib); - //const docker_run = DockerStep.create(b, .{ - //.name = "transmission-zig", - //.image = "docker.io/linuxserver/transmission:4.0.3", - //.ports = &[_][]const u8{"9091:9091"}, - //}); + const docker_run_4_0_3 = DockerStep.create(b, .{ + .name = "transmission-zig", + .image = "docker.io/linuxserver/transmission:4.0.3", + .ports = &[_][]const u8{"9091:9091"}, + }); // Creates a step for unit testing. This only builds the test executable // but does not run it. @@ -52,11 +52,22 @@ pub fn build(b: *std.Build) void { const test_step_unit = b.step("test", "Run library unit tests"); test_step_unit.dependOn(&run_main_tests.step); - const test_step_int = b.step("test-int", "Run library integration tests"); - test_step_int.dependOn(&run_main_tests.step); - //test_step_int.dependOn(docker_run.step); + const integration_tests = b.addTest(.{ + .root_source_file = .{ .path = "src/test_int.zig" }, + .target = target, + .optimize = optimize, + }); - //const docker_rm = DockerStep.remove(b, "transmission-zig"); + const run_integration_tests = b.addRunArtifact(integration_tests); + + const test_step_int_4_0_3 = b.step( + "test-int-4-0-3", + "Run library integration tests against Transmission 4.0.3", + ); + //test_step_int.dependOn(&run_main_tests.step); + test_step_int_4_0_3.dependOn(docker_run_4_0_3.step); + test_step_int_4_0_3.dependOn(&run_integration_tests.step); + //const docker_rm = DockerStep.remove(b, "transmission-zig"); //docker_rm.step.dependOn(test_step_int); } |