aboutsummaryrefslogtreecommitdiff
path: root/lib/std/testing.zig
diff options
context:
space:
mode:
authorVeikka Tuominen <git@vexu.eu>2022-02-13 14:35:49 +0200
committerVeikka Tuominen <git@vexu.eu>2022-02-13 14:36:55 +0200
commit8937f18a6f8496e011b13cb086b7948b5f1d540e (patch)
tree6db21281a31a02c2b5a6b048d891873c6f169e73 /lib/std/testing.zig
parent17822e4a050dcbcf7fe324fcdff68887fee73ff1 (diff)
downloadzig-8937f18a6f8496e011b13cb086b7948b5f1d540e.tar.gz
zig-8937f18a6f8496e011b13cb086b7948b5f1d540e.zip
std: force refAllDecls to actually resolve all decls
Only about half of the tests in std were actually being run (918 vs 2144).
Diffstat (limited to 'lib/std/testing.zig')
-rw-r--r--lib/std/testing.zig2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/std/testing.zig b/lib/std/testing.zig
index a9874d4df1..1134717c02 100644
--- a/lib/std/testing.zig
+++ b/lib/std/testing.zig
@@ -466,6 +466,8 @@ test {
pub fn refAllDecls(comptime T: type) void {
if (!builtin.is_test) return;
inline for (comptime std.meta.declarations(T)) |decl| {
+ if (decl.is_pub and @typeInfo(@TypeOf(@field(T, decl.name))) == .Struct)
+ _ = @hasDecl(@field(T, decl.name), "foo");
_ = decl;
}
}