~alva/zig-bare

ba783ec1146d848d7d4331baede1896f4187ecbf — owl 5 months ago 2f09147
move interop tests out of src
10 files changed, 25 insertions(+), 7 deletions(-)

M build.zig
R src/interop/go-bare/examples/customer.bin => interop/go-bare/examples/customer.bin
R src/interop/go-bare/examples/employee.bin => interop/go-bare/examples/employee.bin
R src/interop/go-bare/examples/people.bin => interop/go-bare/examples/people.bin
R src/interop/go-bare/examples/schema.zig => interop/go-bare/examples/schema.zig
R src/interop/go-bare/examples/terminated.bin => interop/go-bare/examples/terminated.bin
R src/interop/go-bare/marshal_test.zig => interop/go-bare/marshal_test.zig
R src/interop/go-bare/unmarshal_test.zig => interop/go-bare/unmarshal_test.zig
A interop/root.zig
M src/test.zig
M build.zig => build.zig +18 -4
@@ 29,22 29,36 @@ pub fn build(b: *Builder) !void {
        .optimize = optimize,
        .target = target,
    });

    bench.addModule("bare", bare_mod);
    bench.addModule("varint", varint_dep.module("varint"));

    const tests = b.addTest(.{
    const unit_tests = b.addTest(.{
        .root_source_file = .{ .path = "src" ++ sep ++ "test.zig" },
        .optimize = optimize,
        .target = target,
    });
    tests.addModule("bare", bare_mod);

    unit_tests.addModule("bare", bare_mod);

    const interop_tests = b.addTest(.{
        .root_source_file = .{ .path = "interop" ++ sep ++ "root.zig" },
        .optimize = optimize,
        .target = target,
    });

    interop_tests.addModule("bare", bare_mod);

    const bench_run_cmd = b.addRunArtifact(bench);
    const bench_run_step = b.step("bench", "Run " ++ program_name ++ " benchmarks");

    bench_run_step.dependOn(&bench_run_cmd.step);

    const run_tests = b.addRunArtifact(tests);
    const test_step = b.step("test", "Run all " ++ program_name ++ " tests");
    test_step.dependOn(&run_tests.step);

    const run_unit_tests = b.addRunArtifact(unit_tests);
    test_step.dependOn(&run_unit_tests.step);

    const run_interop_tests = b.addRunArtifact(interop_tests);
    test_step.dependOn(&run_interop_tests.step);
}

R src/interop/go-bare/examples/customer.bin => interop/go-bare/examples/customer.bin +0 -0
R src/interop/go-bare/examples/employee.bin => interop/go-bare/examples/employee.bin +0 -0
R src/interop/go-bare/examples/people.bin => interop/go-bare/examples/people.bin +0 -0
R src/interop/go-bare/examples/schema.zig => interop/go-bare/examples/schema.zig +0 -0
R src/interop/go-bare/examples/terminated.bin => interop/go-bare/examples/terminated.bin +0 -0
R src/interop/go-bare/marshal_test.zig => interop/go-bare/marshal_test.zig +0 -0
R src/interop/go-bare/unmarshal_test.zig => interop/go-bare/unmarshal_test.zig +0 -0
A interop/root.zig => interop/root.zig +7 -0
@@ 0,0 1,7 @@
const std = @import("std");

test {
    _ = @import("go-bare/unmarshal_test.zig");
    _ = @import("go-bare/marshal_test.zig");
    _ = @import("go-bare/examples/schema.zig");
}

M src/test.zig => src/test.zig +0 -3
@@ 15,9 15,6 @@ const expectError = testing.expectError;

test "refAllDecls" {
    std.testing.refAllDecls(bare);
    std.testing.refAllDecls(@import("interop/go-bare/unmarshal_test.zig"));
    std.testing.refAllDecls(@import("interop/go-bare/marshal_test.zig"));
    std.testing.refAllDecls(@import("interop/go-bare/examples/schema.zig"));
}

test "read u8" {