From f743e05e207046073999ee7234a157359d6a4f57 Mon Sep 17 00:00:00 2001 From: Christian Segundo Date: Mon, 24 Jul 2023 10:28:58 +0200 Subject: wip --- build.zig | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) (limited to 'build.zig') diff --git a/build.zig b/build.zig index 7379c49..f29317f 100644 --- a/build.zig +++ b/build.zig @@ -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); } -- cgit v1.2.3