ziglang / zig

General-purpose programming language and toolchain for maintaining robust, optimal, and reusable software.
https://ziglang.org
MIT License
34.93k stars 2.55k forks source link

Bitrotted compiler tests #21288

Open linusg opened 2 months ago

linusg commented 2 months ago

Zig Version

0.14.0-dev.1409+6d2945f1f

Steps to Reproduce and Observed Behavior

I tried to run zig test src/InternPool.zig while making some changes there.

https://github.com/ziglang/zig/blob/23a80b6c47f5c5a68dba29b808a5ffa5bed69db9/src/Package/Fetch.zig#L2253

src/Package/Fetch.zig:2253:29: error: no field named 'dont_print_on_dumb' in struct 'Progress'
        self.progress = .{ .dont_print_on_dumb = true };
                            ^~~~~~~~~~~~~~~~~~
lib/std/Progress.zig:1:1: note: struct declared here

TestFetchBuilder in turn is being used in a number of test blocks in the same file, which clearly are not being tested.

Expected Behavior

These tests should:

linusg commented 2 months ago
$ zig test src/link/MachO/dyld_info/Rebase.zig
src/link/MachO/dyld_info/Rebase.zig:284:48: error: no field or member function named 'size' in 'Rebase'
    try testing.expectEqual(@as(u64, 0), rebase.size());
                                         ~~~~~~^~~~~
Rexicon226 commented 2 months ago

The MachO test isn't run as part of the compiler test suite. It's a test just copied over from zld and hasn't been updated after #20650. This will just happen when the changes are down streamed into zld I think.

linusg commented 2 months ago

I found that by running zig test on something else, it doesn't look like any test blocks in compiler source files are being run.

linusg commented 1 month ago

Use of old Enum tag casing:

https://github.com/ziglang/zig/blob/d3ba5f397d3270047bcf05c7ed21c5bd6b97e75b/lib/compiler/resinator/lang.zig#L121-L122