aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2023-03-18 18:32:43 -0700
committerAndrew Kelley <andrew@ziglang.org>2023-03-19 00:39:29 -0400
commit8f481dfc3c4f12327499485e3bf10fbbb1023186 (patch)
tree1b197c065a39b459ddb9b7d2cfae10dd8023cc28 /test
parent2ac8d90df05fdbb59a0ee9ff6609a058185f66ff (diff)
downloadzig-8f481dfc3c4f12327499485e3bf10fbbb1023186.tar.gz
zig-8f481dfc3c4f12327499485e3bf10fbbb1023186.zip
fix std.Build.OptionsStep
* use the same hash function as the rest of the steps * fix race condition due to a macOS oddity. * fix race condition due to file truncation (rename into place instead) * integrate with marking Step.result_cached. check if the file already exists with fs.access before doing anything else. * use a directory so that the file basename can be "options.zig" instead of a hash digest. * better error reporting in case of file system failures.
Diffstat (limited to 'test')
-rw-r--r--test/standalone.zig5
-rw-r--r--test/standalone/options/build.zig7
2 files changed, 7 insertions, 5 deletions
diff --git a/test/standalone.zig b/test/standalone.zig
index 4cf795a85f..98297e9578 100644
--- a/test/standalone.zig
+++ b/test/standalone.zig
@@ -213,6 +213,11 @@ pub const build_cases = [_]BuildCase{
.build_root = "test/standalone/issue_13030",
.import = @import("standalone/issue_13030/build.zig"),
},
+ // TODO restore this test
+ //.{
+ // .build_root = "test/standalone/options",
+ // .import = @import("standalone/options/build.zig"),
+ //},
};
const std = @import("std");
diff --git a/test/standalone/options/build.zig b/test/standalone/options/build.zig
index 5e894102a7..28e7e31eb7 100644
--- a/test/standalone/options/build.zig
+++ b/test/standalone/options/build.zig
@@ -1,13 +1,10 @@
const std = @import("std");
pub fn build(b: *std.Build) void {
- const target = b.standardTargetOptions(.{});
- const optimize = b.standardOptimizeOption(.{});
-
const main = b.addTest(.{
.root_source_file = .{ .path = "src/main.zig" },
- .target = target,
- .optimize = optimize,
+ .target = .{},
+ .optimize = .Debug,
});
const options = b.addOptions();