Generate the mocking framework (a bit)
Instead of adding new types in 5 different places, this adds a generation tool that you add the type once and it will be populated in the framework for you. This is defo one of those over engineered projects, but I had fun making it. Replaces empty spaces with const Refactor spaces
This commit is contained in:
parent
ccef3e2eb4
commit
7cafcec49e
4 changed files with 922 additions and 173 deletions
15
build.zig
15
build.zig
|
|
@ -99,22 +99,21 @@ pub fn build(b: *Builder) !void {
|
|||
unit_tests.addBuildOption(TestMode, "test_mode", test_mode);
|
||||
unit_tests.addBuildOption([]const u8, "mock_path", mock_path);
|
||||
unit_tests.addBuildOption([]const u8, "arch_mock_path", arch_mock_path);
|
||||
unit_tests.setTarget(.{ .cpu_arch = target.cpu_arch });
|
||||
|
||||
if (builtin.os.tag != .windows) {
|
||||
unit_tests.enable_qemu = true;
|
||||
}
|
||||
|
||||
unit_tests.setTarget(.{ .cpu_arch = target.cpu_arch });
|
||||
// Run the mock gen
|
||||
const mock_gen = b.addExecutable("mock_gen", "test/gen_types.zig");
|
||||
mock_gen.setMainPkgPath(".");
|
||||
const mock_gen_run = mock_gen.run();
|
||||
unit_tests.step.dependOn(&mock_gen_run.step);
|
||||
|
||||
test_step.dependOn(&unit_tests.step);
|
||||
|
||||
const rt_test_step = b.step("rt-test", "Run runtime tests");
|
||||
const build_mode_str = switch (build_mode) {
|
||||
.Debug => "",
|
||||
.ReleaseSafe => "-Drelease-safe",
|
||||
.ReleaseFast => "-Drelease-fast",
|
||||
.ReleaseSmall => "-Drelease-small",
|
||||
};
|
||||
|
||||
var qemu_args_al = ArrayList([]const u8).init(b.allocator);
|
||||
defer qemu_args_al.deinit();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue