Skip to content

Commit 75cd37b

Browse files
committed
dragonfly: pass zig build test
1 parent 55811d8 commit 75cd37b

File tree

6 files changed

+293
-46
lines changed

6 files changed

+293
-46
lines changed

lib/std/dynamic_library.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const max = std.math.max;
1919
pub const DynLib = switch (builtin.os.tag) {
2020
.linux => if (builtin.link_libc) DlDynlib else ElfDynLib,
2121
.windows => WindowsDynLib,
22-
.macos, .tvos, .watchos, .ios, .freebsd, .openbsd => DlDynlib,
22+
.macos, .tvos, .watchos, .ios, .freebsd, .openbsd, .dragonfly => DlDynlib,
2323
else => void,
2424
};
2525

lib/std/fs/test.zig

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -277,12 +277,15 @@ test "directory operations on files" {
277277
try testing.expectError(error.NotDir, tmp_dir.dir.openDir(test_file_name, .{}));
278278
try testing.expectError(error.NotDir, tmp_dir.dir.deleteDir(test_file_name));
279279

280-
if (builtin.os.tag != .wasi and builtin.os.tag != .freebsd and builtin.os.tag != .openbsd) {
281-
const absolute_path = try tmp_dir.dir.realpathAlloc(testing.allocator, test_file_name);
282-
defer testing.allocator.free(absolute_path);
280+
switch (builtin.os.tag) {
281+
.wasi, .freebsd, .openbsd, .dragonfly => {},
282+
else => {
283+
const absolute_path = try tmp_dir.dir.realpathAlloc(testing.allocator, test_file_name);
284+
defer testing.allocator.free(absolute_path);
283285

284-
try testing.expectError(error.PathAlreadyExists, fs.makeDirAbsolute(absolute_path));
285-
try testing.expectError(error.NotDir, fs.deleteDirAbsolute(absolute_path));
286+
try testing.expectError(error.PathAlreadyExists, fs.makeDirAbsolute(absolute_path));
287+
try testing.expectError(error.NotDir, fs.deleteDirAbsolute(absolute_path));
288+
},
286289
}
287290

288291
// ensure the file still exists and is a file as a sanity check
@@ -314,12 +317,15 @@ test "file operations on directories" {
314317
// TODO: Add a read-only test as well, see https://github.com/ziglang/zig/issues/5732
315318
try testing.expectError(error.IsDir, tmp_dir.dir.openFile(test_dir_name, .{ .write = true }));
316319

317-
if (builtin.os.tag != .wasi and builtin.os.tag != .freebsd and builtin.os.tag != .openbsd) {
318-
const absolute_path = try tmp_dir.dir.realpathAlloc(testing.allocator, test_dir_name);
319-
defer testing.allocator.free(absolute_path);
320+
switch (builtin.os.tag) {
321+
.wasi, .freebsd, .openbsd, .dragonfly => {},
322+
else => {
323+
const absolute_path = try tmp_dir.dir.realpathAlloc(testing.allocator, test_dir_name);
324+
defer testing.allocator.free(absolute_path);
320325

321-
try testing.expectError(error.IsDir, fs.createFileAbsolute(absolute_path, .{}));
322-
try testing.expectError(error.IsDir, fs.deleteFileAbsolute(absolute_path));
326+
try testing.expectError(error.IsDir, fs.createFileAbsolute(absolute_path, .{}));
327+
try testing.expectError(error.IsDir, fs.deleteFileAbsolute(absolute_path));
328+
},
323329
}
324330

325331
// ensure the directory still exists as a sanity check

0 commit comments

Comments
 (0)