aboutsummaryrefslogtreecommitdiff
path: root/test/src
AgeCommit message (Collapse)Author
2025-10-29disable self-hosted wasm test-casesAndrew Kelley
Tracked by #25684
2025-10-29fix miscellaneous compilation errorsAndrew Kelley
- ILSEQ -> error.BadPathName - implement dirStatPath for WASI
2025-10-29std: updating to std.Io interfaceAndrew Kelley
got the build runner compiling
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-14Merge pull request #25402 from alexrp/libc-test-ciAlex Rønne Petersen
`ci`: enable running libc-test on `x86_64-linux-release`
2025-10-01libc-test: set a 1.6G max_rss for each test caseAlex Rønne Petersen
1.4G was the highest value I observed for any test case on x86_64-linux. This change should prevent OOM conditions in CI.
2025-10-01test: don't run error/stack trace tests on self-hosted on BSDsAlex Rønne Petersen
See: 0700ec35bda705fccb61cb3f28734ce11166fda5
2025-09-30std.debug.SelfInfo: mark ARM unwinding as unsupportedmlugg
We need to parse the `.ARM.exidx` section to be able to reliably unwind the stack on ARM.
2025-09-30test-error-traces: skip some more optimized tracesmlugg
2025-09-30test-stack-traces: fix on x86-windowsmlugg
2025-09-30test-stack-traces: don't try to strip unwind tables on x86-windowsmlugg
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-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-20Merge pull request #25298 from ziglang/SegmentedList-orphaned-againAndrew Kelley
std: delete SegmentedList again
2025-09-19std.Build.Step.Run: Enable passing (generated) file content as argsJustus Klausecker
Adds `addFileContentArg` and `addPrefixedFileContentArg` to pass the content of a file with a lazy path as an argument to a `std.Build.Step.Run`. This enables replicating shell `$()` / cmake `execute_process` with `OUTPUT_VARIABLE` as an input to another `execute_process` in conjuction with `captureStdOut`/`captureStdErr`. To also be able to replicate `$()` automatically trimming trailing newlines and cmake `OUTPUT_STRIP_TRAILING_WHITESPACE`, this patch adds an `options` arg to those functions which allows specifying the desired handling of surrounding whitespace. The `options` arg also allows to specify a custom `basename` for the output. e.g. to add a file extension (concrete use case: Zig `@import()` requires files to have a `.zig`/`.zon` extension to recognize them as valid source files).
2025-09-19std: delete SegmentedList againAndrew Kelley
The data structure was originally added in 41e1cd185b82a518c58c92544c45f0348c03ef74 and then removed in 50a336fff899ebd8a687c453ec6beb18a5a9baf9, but brought back in 711bf55eaa643c3d05640bebbf3e4315477b8ed8 for Decl in the compiler frontend, and then the last reference to it was eliminated in 548a087fafeda5b07d2237d5137906b8d07da699 which removed Decl in favor of Nav and Cau.
2025-09-18test: skip dumpCurrentStackTrace test on architectures with no unwind supportAlex Rønne Petersen
2025-09-16test: delete old stage1 compile_errors testsAlex Rønne Petersen
generic_function_returning_opaque_type.zig was salvaged as it's still worth having.
2025-09-16test: rename backend=stage2 to backend=selfhosted, and add backend=autoAlex Rønne Petersen
backend=auto (now the default if backend is omitted) means to let the compiler pick whatever backend it wants as the default. This is important for platforms where we don't yet have a self-hosted backend, such as loongarch64. Also purge a bunch of redundant target=native.
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-08-30update tools and other miscellaneous things to new APIsAndrew Kelley
2025-08-30upgrade more old API usesAndrew Kelley
2025-08-15fix: print error set members in a consistent orderWill Lillis
Co-authored-by: Matthew Lugg <mlugg@mlugg.co.uk>
2025-08-11std.ArrayList: make unmanaged the defaultAndrew Kelley
2025-08-02build: add -Dskip-compile-errors optionAlex Rønne Petersen
Skips tests in test/cases/compile_errors.
2025-07-26aarch64: implement some safety checksJacob Young
Closes #24553
2025-07-26Migrate from deprecated `Step.Compile` APIsCarl Åstholm
2025-07-24Revert "disable -fno-llvm -target wasm32-wasi testing"Pavel Verigo
This reverts commit 83960e0eb068f786c46c3fe559016e1e9faea3cd.
2025-07-19disable -fno-llvm -target wasm32-wasi testingAndrew Kelley
no active maintainer, and it's failing to lower some basic stuff
2025-07-11Remove numerous things deprecated during the 0.14 release cycleLinus Groh
Basically everything that has a direct replacement or no uses left. Notable omissions: - std.ArrayHashMap: Too much fallout, needs a separate cleanup. - std.debug.runtime_safety: Too much fallout. - std.heap.GeneralPurposeAllocator: Lots of references to it remain, not a simple find and replace as "debug allocator" is not equivalent to "general purpose allocator". - std.io.Reader: Is being reworked at the moment. - std.unicode.utf8Decode(): No replacement, needs a new API first. - Manifest backwards compat options: Removal would break test data used by TestFetchBuilder. - panic handler needs to be a namespace: Many tests still rely on it being a function, needs a separate cleanup.
2025-07-07update standalone and incremental tests to new APIAndrew Kelley
2025-07-03test: Respect various test skip options in test-casesAlex Rønne Petersen
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-12test-stack-traces: correct expected object file nameJacob Young
The name of the ZCU object file emitted by the LLVM backend has been changed in this branch from e.g. `foo.obj` to `foo_zcu.obj`. This is to avoid name clashes. This commit just updates the stack trace tests which started failing on windows because of the object name change.
2025-06-06restore debug llvm CI coverageAndrew Kelley
and reduce redundant coverage in slow runs to save time
2025-06-01cases: include dirname in case namesmlugg
For instance, the file 'cases/compile_errors/undeclared_identifier.zig' now corresponds to test name 'compile_errors.undeclared_identifier'. This is useful because you can now filter based on the case dirname using `-Dtest-filter`.
2025-05-13Merge pull request #21882 from alexrp/compiler-fixesAlex Rønne Petersen
compiler: Fix some real and theoretical miscompilations with `allowzero` and `volatile`
2025-05-12Merge pull request #23700 from sorairolake/rename-trimsAlex Rønne Petersen
chore(std.mem): Rename `trimLeft` and `trimRight` to `trimStart` and `trimEnd`
2025-05-12std.Build: Make no_builtin a property of Module instead of Step.Compile.Alex Rønne Petersen
This reflects how the compiler actually treats it. Closes #23424.
2025-05-12test: Add test-llvm-ir step and harness for testing generated LLVM IR.Alex Rønne Petersen
2025-05-12test: Fix incorrect interpretation of -Dtest-filter=... for test-debugger.Alex Rønne Petersen
2025-04-27test: Configure emit_asm/emit_bin correctly for some targets in llvm_targets.Alex Rønne Petersen
2025-04-27test: Allow cases to set emit_asm (defaults to false).Alex Rønne Petersen
2025-04-27chore(std.mem): Rename `trimLeft` and `trimRight`Shun Sakai
Rename `trimLeft` to `trimStart`, and `trimRight` to `trimEnd`. `trimLeft` and `trimRight` functions remain as deprecated aliases for these new names.
2025-04-13std: eradicate u29 and embrace std.mem.AlignmentAndrew Kelley
2025-03-05Remove uses of deprecated callconv aliasesLinus Groh