From 3f1c51ca906719fe2a064a73295ada230e34f1c2 Mon Sep 17 00:00:00 2001 From: Jacob Young Date: Fri, 21 Apr 2023 20:46:05 -0400 Subject: [PATCH] std: remove names from incorrectly named tests Tests that only reference decls for the purpose of analyzing more tests should be unnamed, otherwise trying to filter for just a referenced test can become impossible depending on the names. --- lib/std/Thread.zig | 2 +- lib/std/atomic.zig | 2 +- lib/std/crypto/pcurves/p256.zig | 2 +- lib/std/crypto/pcurves/p384.zig | 2 +- lib/std/crypto/pcurves/secp256k1.zig | 2 +- lib/std/hash.zig | 2 +- lib/std/math/complex.zig | 2 +- lib/std/meta.zig | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/std/Thread.zig b/lib/std/Thread.zig index d4e5c25f36..f2a78100ad 100644 --- a/lib/std/Thread.zig +++ b/lib/std/Thread.zig @@ -1141,7 +1141,7 @@ test "setName, getName" { thread.join(); } -test "std.Thread" { +test { // Doesn't use testing.refAllDecls() since that would pull in the compileError spinLoopHint. _ = Futex; _ = ResetEvent; diff --git a/lib/std/atomic.zig b/lib/std/atomic.zig index d10c122482..8038d383a5 100644 --- a/lib/std/atomic.zig +++ b/lib/std/atomic.zig @@ -7,7 +7,7 @@ pub const Stack = @import("atomic/stack.zig").Stack; pub const Queue = @import("atomic/queue.zig").Queue; pub const Atomic = @import("atomic/Atomic.zig").Atomic; -test "std.atomic" { +test { _ = @import("atomic/stack.zig"); _ = @import("atomic/queue.zig"); _ = @import("atomic/Atomic.zig"); diff --git a/lib/std/crypto/pcurves/p256.zig b/lib/std/crypto/pcurves/p256.zig index d060abd12b..a160d08016 100644 --- a/lib/std/crypto/pcurves/p256.zig +++ b/lib/std/crypto/pcurves/p256.zig @@ -473,6 +473,6 @@ pub const AffineCoordinates = struct { } }; -test "p256" { +test { _ = @import("tests/p256.zig"); } diff --git a/lib/std/crypto/pcurves/p384.zig b/lib/std/crypto/pcurves/p384.zig index 5fe0b6b576..3aaf9e341f 100644 --- a/lib/std/crypto/pcurves/p384.zig +++ b/lib/std/crypto/pcurves/p384.zig @@ -473,7 +473,7 @@ pub const AffineCoordinates = struct { } }; -test "p384" { +test { if (@import("builtin").zig_backend == .stage2_c) return error.SkipZigTest; _ = @import("tests/p384.zig"); diff --git a/lib/std/crypto/pcurves/secp256k1.zig b/lib/std/crypto/pcurves/secp256k1.zig index 2160aa73c4..6998b0db82 100644 --- a/lib/std/crypto/pcurves/secp256k1.zig +++ b/lib/std/crypto/pcurves/secp256k1.zig @@ -551,7 +551,7 @@ pub const AffineCoordinates = struct { } }; -test "secp256k1" { +test { if (@import("builtin").zig_backend == .stage2_c) return error.SkipZigTest; _ = @import("tests/secp256k1.zig"); diff --git a/lib/std/hash.zig b/lib/std/hash.zig index 8e92b4c9de..5c85b38d55 100644 --- a/lib/std/hash.zig +++ b/lib/std/hash.zig @@ -36,7 +36,7 @@ const xxhash = @import("hash/xxhash.zig"); pub const XxHash64 = xxhash.XxHash64; pub const XxHash32 = xxhash.XxHash32; -test "hash" { +test { _ = adler; _ = auto_hash; _ = crc; diff --git a/lib/std/math/complex.zig b/lib/std/math/complex.zig index b4a87492ce..8b9e8befab 100644 --- a/lib/std/math/complex.zig +++ b/lib/std/math/complex.zig @@ -189,7 +189,7 @@ test "complex.magnitude" { try testing.expect(math.approxEqAbs(f32, c, 5.83095, epsilon)); } -test "complex.cmath" { +test { _ = @import("complex/abs.zig"); _ = @import("complex/acosh.zig"); _ = @import("complex/acos.zig"); diff --git a/lib/std/meta.zig b/lib/std/meta.zig index 3aca23b267..97c2ff4fb0 100644 --- a/lib/std/meta.zig +++ b/lib/std/meta.zig @@ -10,7 +10,7 @@ pub const TrailerFlags = @import("meta/trailer_flags.zig").TrailerFlags; const Type = std.builtin.Type; -test "std.meta.TrailerFlags" { +test { _ = TrailerFlags; }