{frreetype,sysaudio}: use std.refAllDeclsRecursive
added to stdlib via #12103
This commit is contained in:
parent
0ff83ba517
commit
be9d2b431f
4 changed files with 23 additions and 51 deletions
|
|
@ -8,15 +8,15 @@ pub const Glyph = @import("Glyph.zig");
|
||||||
pub const Stroker = @import("Stroker.zig");
|
pub const Stroker = @import("Stroker.zig");
|
||||||
pub const Error = @import("error.zig").Error;
|
pub const Error = @import("error.zig").Error;
|
||||||
|
|
||||||
const utils = @import("utils");
|
const std = @import("std");
|
||||||
|
|
||||||
test {
|
test {
|
||||||
utils.refAllDecls(@import("freetype.zig"));
|
std.testing.refAllDeclsRecursive(@import("freetype.zig"));
|
||||||
utils.refAllDecls(@import("types.zig"));
|
std.testing.refAllDeclsRecursive(@import("types.zig"));
|
||||||
utils.refAllDecls(@import("image.zig"));
|
std.testing.refAllDeclsRecursive(@import("image.zig"));
|
||||||
utils.refAllDecls(@import("color.zig"));
|
std.testing.refAllDeclsRecursive(@import("color.zig"));
|
||||||
utils.refAllDecls(@import("lcdfilter.zig"));
|
std.testing.refAllDeclsRecursive(@import("lcdfilter.zig"));
|
||||||
utils.refAllDecls(@import("error.zig"));
|
std.testing.refAllDeclsRecursive(@import("error.zig"));
|
||||||
utils.refAllDecls(Glyph);
|
std.testing.refAllDeclsRecursive(Glyph);
|
||||||
utils.refAllDecls(Stroker);
|
std.testing.refAllDeclsRecursive(Stroker);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,14 +7,14 @@ pub usingnamespace @import("shape.zig");
|
||||||
pub usingnamespace @import("shape_plan.zig");
|
pub usingnamespace @import("shape_plan.zig");
|
||||||
pub const c = @import("c");
|
pub const c = @import("c");
|
||||||
|
|
||||||
const utils = @import("utils");
|
const std = @import("std");
|
||||||
|
|
||||||
test {
|
test {
|
||||||
utils.refAllDecls(@import("blob.zig"));
|
std.testing.refAllDeclsRecursive(@import("blob.zig"));
|
||||||
utils.refAllDecls(@import("buffer.zig"));
|
std.testing.refAllDeclsRecursive(@import("buffer.zig"));
|
||||||
utils.refAllDecls(@import("common.zig"));
|
std.testing.refAllDeclsRecursive(@import("common.zig"));
|
||||||
utils.refAllDecls(@import("face.zig"));
|
std.testing.refAllDeclsRecursive(@import("face.zig"));
|
||||||
utils.refAllDecls(@import("font.zig"));
|
std.testing.refAllDeclsRecursive(@import("font.zig"));
|
||||||
utils.refAllDecls(@import("shape.zig"));
|
std.testing.refAllDeclsRecursive(@import("shape.zig"));
|
||||||
utils.refAllDecls(@import("shape_plan.zig"));
|
std.testing.refAllDeclsRecursive(@import("shape_plan.zig"));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,18 +19,3 @@ pub fn bitFieldsToStruct(comptime StructType: type, comptime EnumDataType: type,
|
||||||
}
|
}
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn refAllDecls(comptime T: type) void {
|
|
||||||
@setEvalBranchQuota(10000);
|
|
||||||
inline for (comptime std.meta.declarations(T)) |decl| {
|
|
||||||
if (decl.is_pub) {
|
|
||||||
if (@TypeOf(@field(T, decl.name)) == type) {
|
|
||||||
switch (@typeInfo(@field(T, decl.name))) {
|
|
||||||
.Struct, .Enum, .Union, .Opaque => refAllDecls(@field(T, decl.name)),
|
|
||||||
else => {},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
_ = @field(T, decl.name);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -6,24 +6,11 @@ pub const InStream = @import("InStream.zig");
|
||||||
pub const OutStream = @import("OutStream.zig");
|
pub const OutStream = @import("OutStream.zig");
|
||||||
pub const Error = @import("error.zig").Error;
|
pub const Error = @import("error.zig").Error;
|
||||||
|
|
||||||
test {
|
const std = @import("std");
|
||||||
refAllDecls(@import("SoundIo.zig"));
|
|
||||||
refAllDecls(@import("Device.zig"));
|
|
||||||
refAllDecls(@import("OutStream.zig"));
|
|
||||||
refAllDecls(@import("ChannelLayout.zig"));
|
|
||||||
}
|
|
||||||
|
|
||||||
fn refAllDecls(comptime T: type) void {
|
test {
|
||||||
@setEvalBranchQuota(10000);
|
std.testing.refAllDeclsRecursive(@import("SoundIo.zig"));
|
||||||
inline for (comptime @import("std").meta.declarations(T)) |decl| {
|
std.testing.refAllDeclsRecursive(@import("Device.zig"));
|
||||||
if (decl.is_pub) {
|
std.testing.refAllDeclsRecursive(@import("OutStream.zig"));
|
||||||
if (@TypeOf(@field(T, decl.name)) == type) {
|
std.testing.refAllDeclsRecursive(@import("ChannelLayout.zig"));
|
||||||
switch (@typeInfo(@field(T, decl.name))) {
|
|
||||||
.Struct, .Enum, .Union, .Opaque => refAllDecls(@field(T, decl.name)),
|
|
||||||
else => {},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
_ = @field(T, decl.name);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue