summaryrefslogtreecommitdiff
path: root/test/consumer/build.zig
blob: 9fc2c7789759772716643268431ccd49fd764b53 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
//! A package that depends on cloud9 as any other does: cloud9's `test`
//! step runs `zig build test` here, so its build API is used the way a
//! consumer uses it (modules by name, no option).
const std = @import("std");

pub fn build(b: *std.Build) void {
    const target = b.standardTargetOptions(.{});
    const optimize = b.standardOptimizeOption(.{});
    const cloud9 = b.dependency("cloud9", .{});
    const tests = b.addTest(.{ .root_module = b.createModule(.{
        .root_source_file = b.path("main.zig"),
        .target = target,
        .optimize = optimize,
        .imports = &.{
            .{ .name = "cloud9", .module = cloud9.module("cloud9") },
            .{ .name = "9proc", .module = cloud9.module("9proc") },
        },
    }) });
    b.step("test", "a client and a server on cloud9 talk over a socket pair").dependOn(&b.addRunArtifact(tests).step);
}