Compare commits
2 commits
163150690f
...
5b2962fdc0
| Author | SHA1 | Date | |
|---|---|---|---|
| 5b2962fdc0 | |||
| 2aa3c1afc7 |
3 changed files with 15 additions and 31 deletions
29
build.zig
29
build.zig
|
|
@ -55,15 +55,7 @@ pub fn build(b: *std.Build) void {
|
|||
if (b.args) |args|
|
||||
run_cmd.addArgs(args);
|
||||
|
||||
const mod_tests = b.addTest(.{
|
||||
.name = "mod_tests",
|
||||
.root_module = mod,
|
||||
});
|
||||
const run_mod_tests = b.addRunArtifact(mod_tests);
|
||||
|
||||
const exe_tests = b.addTest(.{
|
||||
.name = "exe_tests",
|
||||
.root_module = b.createModule(.{
|
||||
const main_mod = b.createModule(.{
|
||||
.root_source_file = b.path("src/main.zig"),
|
||||
.target = target,
|
||||
.optimize = optimize,
|
||||
|
|
@ -71,31 +63,24 @@ pub fn build(b: *std.Build) void {
|
|||
.{ .name = "nightwatch", .module = mod },
|
||||
.{ .name = "build_options", .module = options_mod },
|
||||
},
|
||||
}),
|
||||
});
|
||||
const run_exe_tests = b.addRunArtifact(exe_tests);
|
||||
|
||||
// Integration test suite: exercises the public API by performing real
|
||||
// filesystem operations and verifying Handler callbacks via TestHandler.
|
||||
const integration_tests = b.addTest(.{
|
||||
.name = "integration_tests",
|
||||
const tests = b.addTest(.{
|
||||
.name = "tests",
|
||||
.root_module = b.createModule(.{
|
||||
.root_source_file = b.path("src/nightwatch_test.zig"),
|
||||
.target = target,
|
||||
.optimize = optimize,
|
||||
.imports = &.{
|
||||
.{ .name = "nightwatch", .module = mod },
|
||||
.{ .name = "main", .module = main_mod },
|
||||
},
|
||||
}),
|
||||
});
|
||||
const run_integration_tests = b.addRunArtifact(integration_tests);
|
||||
const run_tests = b.addRunArtifact(tests);
|
||||
|
||||
const test_step = b.step("test", "Run tests");
|
||||
test_step.dependOn(&run_mod_tests.step);
|
||||
test_step.dependOn(&run_exe_tests.step);
|
||||
test_step.dependOn(&run_integration_tests.step);
|
||||
test_step.dependOn(&run_tests.step);
|
||||
|
||||
b.installArtifact(mod_tests);
|
||||
b.installArtifact(exe_tests);
|
||||
b.installArtifact(integration_tests);
|
||||
b.installArtifact(tests);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -281,5 +281,3 @@ pub fn main() !void {
|
|||
run_posix();
|
||||
}
|
||||
}
|
||||
|
||||
test "simple test" {}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
const std = @import("std");
|
||||
const builtin = @import("builtin");
|
||||
const nw = @import("nightwatch");
|
||||
const main = @import("main");
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// RecordedEvent
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue