aboutsummaryrefslogtreecommitdiff
path: root/test/tests.zig
AgeCommit message (Collapse)Author
2025-10-27remove all Oracle Solaris supportAlex Rønne Petersen
There is no straightforward way for the Zig team to access the Solaris system headers; to do this, one has to create an Oracle account, accept their EULA to download the installer ISO, and finally install it on a machine or VM. We do not have to jump through hoops like this for any other OS that we support, and no one on the team has expressed willingness to do it. As a result, we cannot audit any Solaris contributions to std.c or other similarly sensitive parts of the standard library. The best we would be able to do is assume that Solaris and illumos are 100% compatible with no way to verify that assumption. But at that point, the solaris and illumos OS tags would be functionally identical anyway. For Solaris especially, any contributions that involve APIs introduced after the OS was made closed-source would also be inherently more risky than equivalent contributions for other proprietary OSs due to the case of Google LLC v. Oracle America, Inc., wherein Oracle clearly demonstrated its willingness to pursue legal action against entities that merely copy API declarations. Finally, Oracle laid off most of the Solaris team in 2017; the OS has been in maintenance mode since, presumably to be retired completely sometime in the 2030s. For these reasons, this commit removes all Oracle Solaris support. Anyone who still wishes to use Zig on Solaris can try their luck by simply using illumos instead of solaris in target triples - chances are it'll work. But there will be no effort from the Zig team to support this use case; we recommend that people move to illumos instead.
2025-10-25compiler: avoid using self-hosted backend on x86_64-solaris/illumosAlex Rønne Petersen
https://github.com/ziglang/zig/issues/25699
2025-10-23std.Target: add arceb and xtensaeb Cpu.Arch tagsAlex Rønne Petersen
2025-10-23test: enable dynamic hexagon-linux-musl with -Dtest-extra-targetsAlex Rønne Petersen
2025-10-17Merge pull request #25609 from alexrp/test-targetsAlex Rønne Petersen
`test`: put some niche targets behind `-Dtest-extra-targets`
2025-10-17test: put soft float powerpc targets behind -Dtest-extra-targetsAlex Rønne Petersen
2025-10-17test: put all n32 and x32 targets behind -Dtest-extra-targetsAlex Rønne Petersen
2025-10-17test: put all dynamic musl targets behind -Dtest-extra-targetsAlex Rønne Petersen
2025-10-16test: enable std tests for hexagonAlex Rønne Petersen
2025-10-10Coff: implement threadlocal variablesJacob Young
2025-10-08build.zig: add -Dtest-default-only optionAndrew Kelley
handy during development when it is already known that not all tests will pass.
2025-10-06drop support for powerpc64 ELF v1Alex Rønne Petersen
* ELF v1 on powerpc64 is only barely kept on life support in a couple of Linux distros. I don't anticipate that this will last much longer. * Most of the Linux world has moved to powerpc64le which requires ELF v2. * Some Linux distros have even started supporting powerpc64 with ELF v2. * The BSD world has long since moved to ELF v2. * We have no actual linking support for ELF v1. * ELF v1 had confused DWARF register mappings which is becoming a problem in our DWARF code in std.debug. It's clear that ELF v1 is on its way out, and we never fully supported it anyway. So let's not waste any time or energy on it going forward. closes #5927
2025-10-04test: move standalone/options/ to cli/options/Alex Rønne Petersen
It's now used only by test-cli, so make that clear.
2025-09-30tests: fix 32-bit compatible arch selectionmlugg
2025-09-30tests: split up and enhance stack trace testsmlugg
Previously, the `test-stack-traces` step was essentially just testing error traces, and even there we didn't have much coverage. This commit solves that by splitting the "stack trace" tests into two separate harnesses: the "stack trace" tests are for actual stack traces (i.e. involving stack unwinding), while the "error trace" tests are specifically for error return traces. The "stack trace" tests will test different configurations of: * `-lc` * `-fPIE` * `-fomit-frame-pointer` * `-fllvm` * unwind tables (currently disabled) * strip debug info (currently disabled) The main goal there is to test *stack unwinding* under different conditions. Meanwhile, the "error trace" tests will test different configurations of `-O` and `-fllvm`; the main goal here, aside from checking that error traces themselves do not miscompile, is to check whether debug info is still working even in optimized builds. Of course, aggressive optimizations *can* thwart debug info no matter what, so as before, there is a way to disable cases for specific targets / optimize modes. The program which converts stack traces into a more validatable format by removing things like addresses (previously `check-stack-trace.zig`, now `convert-stack-trace.zig`) has been rewritten and simplified. Also, thanks to various fixes in this branch, several workarounds have become unnecessary: for instance, we don't need to ignore the function name printed in stack traces in release modes, because `std.debug.Dwarf` now uses the correct DIE for inlined functions! Neither `test-stack-traces` nor `test-error-traces` does general foreign architecture testing, because it seems that (at least for now) external executors often aren't particularly good at handling stack tracing correctly (looking at you, Wine). Generally, they just test the native target (this matches the old behavior of `test-stack-traces`). However, there is one exception: when on an x86_64 or aarch64 host, we will also test the 32-bit version (x86 or arm) if the OS supports it, because such executables can be trivially tested without an external executor. Oh, also, I wrote a bunch of stack trace tests. Previously there was, erm, *one* test in `test-stack-traces` which wasn't for error traces. Now there are a good few!
2025-09-27tests: fix redundant target in matrixmlugg
Because -fno-llvm is now the default on x86_64-linux, this target was exactly equivalent to one specified earlier in the matrix. This was probably just missed when doing the work to enable the self-hosted backend by default for x86_64.
2025-09-24delete all the translate-c testsAndrew Kelley
the ziglang/translate-c package has its own test suite, so these are redundant
2025-09-24Integrate libc-test cases into the build systemrpkak
zig build test-libc -Dlibc-test-path=/path/to/libc-test
2025-09-22compiler: don't use self-hosted backend on any BSD yetalexrp
There are some blocking bugs in the self-hosted ELF linker.
2025-09-20disable wasm backend coverageAndrew Kelley
Disabled due to no active maintainer (feel free to fix the failures and then re-enable at any time). The failures occur due to backend miscompilation of different AIR from the frontend.
2025-09-20disable spirv64-vulkan coverageAndrew Kelley
Disabled due to no active maintainer (feel free to fix the failures and then re-enable at any time). The failures occur due to changing AIR from the frontend, and backend being incomplete.
2025-09-20add behavior test: return undefined pointer from functionAndrew Kelley
This clarifies that it is legal to return an invalid pointer from a function, provided that such pointer is not dereferenced. This matches current status quo of the language. Any change to this should be a proposal that argues for different semantics. It is also legal in C to return a pointer to a local. The C backend lowers such thing directly, so the corresponding warning in C must be disabled (`-Wno-return-stack-address`).
2025-09-18test: respect -Dskip-translate-c in test-standaloneAlex Rønne Petersen
2025-09-18test: re-enable test-std for loongarch64-linuxAlex Rønne Petersen
2025-09-16test: remove test-compare-output and test-asm-link testsAlex Rønne Petersen
These were low value and unfocused tests. We already have coverage of the important aspects of these tests elsewhere. Additionally, there was really no need for these to have their own test harness.
2025-09-03Revert "test: disable non-native loongarch64 behavior and std tests"Alex Rønne Petersen
This reverts commit f4ed35f800396f12c7cd6aa1f70cf2555ddf7c84. This should no longer be needed now that stack traces are disabled on loongarch. closes #24405
2025-08-30test: use -Wno-unterminated-string-initialization for cbe testsAlex Rønne Petersen
https://github.com/llvm/llvm-project/issues/153314
2025-08-30test: use long calls for hexagon-linux module testsAlex Rønne Petersen
2025-08-30test: expand C ABI test coverage to hexagon-linux-muslAlex Rønne Petersen
2025-08-06Revert "Sema: Stop adding Windows implib link inputs for `extern "..."` syntax."Alex Rønne Petersen
This reverts commit b461d07a5464aec86c533434dab0b58edfffb331. After some discussion in the team, we've decided that this is too disruptive, especially because the linker errors are less than helpful. That's a fixable problem, so we might reconsider this in the future, but revert it for now.
2025-07-26Migrate from deprecated `Step.Compile` APIsCarl Åstholm
2025-07-25init: replace '--strip' with '--minimal'mlugg
This option never worked properly (it emitted wrongly-formatted code), and it doesn't seem particularly *useful* -- someone who's proficient enough with `std.Build` to not need explanations probably just wants to write their own thing. Meanwhile, the use case of writing your own `build.zig` was extremely poorly served, because `build.zig.zon` *needs* to be generated programmatically for a correct `fingerprint`, but the only ways to do that were to a) do it wrong and get an error, or b) get the full init template and delete the vast majority of it. Both of these were pretty clunky, and `-s` didn't really help. So, replace this flag with a new one, `--minimal`/`-m`, which uses a different template. This template is trivial enough that I opted to just hardcode it into the compiler for simplicity. The main job of `zig init -m` is to generate a correct `build.zig.zon` (if it is unable to do this, it exits with a fatal error). In addition, it will *attempt* to generate a tiny stub `build.zig`, with only an `std` import and an empty `pub fn build`. However, if `build.zig` already exists, it will avoid overwriting it, and doesn't even complain. This serves the use case of writing `build.zig` manually and *then* running `zig init -m` to generate an appropriate `build.zig.zon`.
2025-07-24Revert "disable -fno-llvm -target wasm32-wasi testing"Pavel Verigo
This reverts commit 83960e0eb068f786c46c3fe559016e1e9faea3cd.
2025-07-23Merge pull request #24536 from jacobly0/aarch64Andrew Kelley
aarch64: add new from scratch self-hosted backend
2025-07-23test: enable arm-freebsd-eabihf std testsAlex Rønne Petersen
Closes #23949.
2025-07-22aarch64: add new from scratch self-hosted backendJacob Young
2025-07-19disable -fno-llvm -target wasm32-wasi testingAndrew Kelley
no active maintainer, and it's failing to lower some basic stuff
2025-07-16test: mark riscv soft float targets as extra targetsAlex Rønne Petersen
Soft float is a very rare use case for riscv*-linux. No point wasting CI resources on these targets, especially since our arm and mips soft float coverage is already likely to catch most soft float bugs.
2025-07-15better default min versions for freebsd and netbsdAndrew Kelley
Without this change, by default you get a failure when trying to cross compile for these targets. freebsd was error: undefined symbol: __libc_start1 netbsd was warning: invalid target NetBSD libc version: 9.4.0 error: unable to build NetBSD libc shared objects: InvalidTargetLibCVersion now they work by default
2025-07-11test: disable non-native loongarch64 behavior and std testsAlex Rønne Petersen
https://github.com/ziglang/zig/issues/24405
2025-07-08CI: disable self-hosted riscv64Andrew Kelley
it's missing some critical features like `@fieldParentPtr` and `@memmove`
2025-07-07std.fmt: breaking API changesAndrew Kelley
added adapter to AnyWriter and GenericWriter to help bridge the gap between old and new API make std.testing.expectFmt work at compile-time std.fmt no longer has a dependency on std.unicode. Formatted printing was never properly unicode-aware. Now it no longer pretends to be. Breakage/deprecations: * std.fs.File.reader -> std.fs.File.deprecatedReader * std.fs.File.writer -> std.fs.File.deprecatedWriter * std.io.GenericReader -> std.io.Reader * std.io.GenericWriter -> std.io.Writer * std.io.AnyReader -> std.io.Reader * std.io.AnyWriter -> std.io.Writer * std.fmt.format -> std.fmt.deprecatedFormat * std.fmt.fmtSliceEscapeLower -> std.ascii.hexEscape * std.fmt.fmtSliceEscapeUpper -> std.ascii.hexEscape * std.fmt.fmtSliceHexLower -> {x} * std.fmt.fmtSliceHexUpper -> {X} * std.fmt.fmtIntSizeDec -> {B} * std.fmt.fmtIntSizeBin -> {Bi} * std.fmt.fmtDuration -> {D} * std.fmt.fmtDurationSigned -> {D} * {} -> {f} when there is a format method * format method signature - anytype -> *std.io.Writer - inferred error set -> error{WriteFailed} - options -> (deleted) * std.fmt.Formatted - now takes context type explicitly - no fmt string
2025-07-06Sema: Stop adding Windows implib link inputs for `extern "..."` syntax.Alex Rønne Petersen
Closes #23971.
2025-07-05test: More cleanup of Windows targets in the module test matrixAlex Rønne Petersen
It's kind of unclear what `*-windows-none` actually means, but as far as LLVM is concerned, it's equivalent to `*-windows-msvc`. For clarity, only test `*-windows-msvc` and `*-windows-gnu`. #20690 will clean this situation up eventually. Also ensure coverage of `link_libc = true` and `link_libc = false` for both.
2025-07-03test: Respect various test skip options in test-casesAlex Rønne Petersen
2025-06-23remove `spirv` cpu archAli Cheraghi
2025-06-19x86_64: increase passing test coverage on windowsJacob Young
Now that codegen has no references to linker state this is much easier. Closes #24153
2025-06-19Target: pass and use locals by pointer instead of by valueJacob Young
This struct is larger than 256 bytes and code that copies it consistently shows up in profiles of the compiler.
2025-06-19Build: change how the target is printed in step namesJacob Young
e.g. `x86_64-windows.win10...win11_dt-gnu` -> `x86_64-windows-gnu` When the OS version is the default this is redundant with checking the default in the standard library.
2025-06-06CI: skip llvm backend tests in the script for testing x86 backendAndrew Kelley