milestone 17: real deadlines, validator holes, upstream editor, trusted proxies, contract samples, badvers
This commit is contained in:
@@ -19,6 +19,15 @@ pub fn build(b: *std.Build) void {
|
||||
const integration = b.option(bool, "integration", "Run hermetic integration tests (loopback sockets only)") orelse false;
|
||||
const live = b.option(bool, "live", "Run tests that reach external network hosts") orelse false;
|
||||
const fuzz = b.option(bool, "fuzz", "Build the fuzz targets with the LLVM backend (required for --fuzz)") orelse false;
|
||||
// Milestone-17 ruling 5. The embedded golden carries no source-tree path,
|
||||
// so regeneration names the destination explicitly:
|
||||
// zig build test -Dintegration \
|
||||
// -Dcontract-samples-out="$PWD/web/src/lib/contractSamples.gen.ts"
|
||||
const contract_samples_out = b.option(
|
||||
[]const u8,
|
||||
"contract-samples-out",
|
||||
"Absolute path the contract-sample generator writes instead of comparing",
|
||||
) orelse "";
|
||||
const version_string = b.option([]const u8, "version-string", "Version reported by `nxdns version`") orelse "0.1.0-dev";
|
||||
const git_commit = b.option([]const u8, "git-commit", "Git commit reported by `nxdns version`") orelse "unknown";
|
||||
const web_dist = b.option(
|
||||
@@ -56,6 +65,7 @@ pub fn build(b: *std.Build) void {
|
||||
options.addOption([]const u8, "version_string", version_string);
|
||||
options.addOption([]const u8, "git_commit", git_commit);
|
||||
options.addOption([]const u8, "zig_version_string", builtin.zig_version_string);
|
||||
options.addOption([]const u8, "contract_samples_out", contract_samples_out);
|
||||
|
||||
const exe = addExecutable(b, target, optimize, options, web_assets);
|
||||
b.installArtifact(exe);
|
||||
@@ -118,6 +128,11 @@ pub fn build(b: *std.Build) void {
|
||||
tests.root_module.addAnonymousImport("docs_files", .{
|
||||
.root_source_file = b.path("docs/docs.zig"),
|
||||
});
|
||||
// An anonymous-import root must be Zig, so the committed TypeScript golden
|
||||
// is reached through a one-decl wrapper beside it.
|
||||
tests.root_module.addAnonymousImport("contract_samples", .{
|
||||
.root_source_file = b.path("web/src/lib/contract_samples.zig"),
|
||||
});
|
||||
tests.root_module.addAnonymousImport("web_assets", .{ .root_source_file = web_assets });
|
||||
const test_step = b.step("test", "Run the test suite");
|
||||
test_step.dependOn(&b.addRunArtifact(tests).step);
|
||||
@@ -263,6 +278,9 @@ pub fn build(b: *std.Build) void {
|
||||
aarch64_tests.root_module.addAnonymousImport("docs_files", .{
|
||||
.root_source_file = b.path("docs/docs.zig"),
|
||||
});
|
||||
aarch64_tests.root_module.addAnonymousImport("contract_samples", .{
|
||||
.root_source_file = b.path("web/src/lib/contract_samples.zig"),
|
||||
});
|
||||
aarch64_tests.root_module.addAnonymousImport("web_assets", .{ .root_source_file = web_assets });
|
||||
const aarch64_run = b.addRunArtifact(aarch64_tests);
|
||||
aarch64_run.skip_foreign_checks = true;
|
||||
|
||||
Reference in New Issue
Block a user