aboutsummaryrefslogtreecommitdiff
path: root/test/src/Cases.zig
AgeCommit message (Collapse)Author
5 daystest-cases: disable self-hosted aarch64 backend coverageAndrew Kelley
5 daysstd.heap.DebugAllocator: never detect TTY configAndrew Kelley
instead, allow the user to set it as a field. this fixes a bug where leak printing and error printing would run tty config detection for stderr, and then emit a log, which is not necessary going to print to stderr. however, the nice defaults are gone; the user must explicitly assign the tty_config field during initialization or else the logging will not have color. related: https://github.com/ziglang/zig/issues/24510
5 daysfix a handful of compilation errors related to std.fs migrationAndrew Kelley
5 daysupdate makeDir() sites to specify permissionsAndrew Kelley
5 daystest: std.fs.File -> std.Io.FileAndrew Kelley
2025-12-07stage2_wasm: revival, enabling testsPavel Verigo
2025-12-04build: add -Dskip-spirv and -Dskip-wasm optionsAlex Rønne Petersen
2025-11-15build: change -Dskip-macos to -Dskip-darwin and make it cover all darwin OSsAlex Rønne Petersen
2025-10-29disable self-hosted wasm test-casesAndrew Kelley
Tracked by #25684
2025-10-29std: updating to std.Io interfaceAndrew Kelley
got the build runner compiling
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-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-30upgrade more old API usesAndrew Kelley
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-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-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-12Merge pull request #23700 from sorairolake/rename-trimsAlex Rønne Petersen
chore(std.mem): Rename `trimLeft` and `trimRight` to `trimStart` and `trimEnd`
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-02-23cases: remove old incremental case systemmlugg
We now run incremental tests with `tools/incr-check.zig` (with the actual cases being in `test/incremental/`).
2025-02-15test: fix windows CIJacob Young
2025-02-03compiler,std: implement ZON supportMason Remaley
This commit allows using ZON (Zig Object Notation) in a few ways. * `@import` can be used to load ZON at comptime and convert it to a normal Zig value. In this case, `@import` must have a result type. * `std.zon.parse` can be used to parse ZON at runtime, akin to the parsing logic in `std.json`. * `std.zon.stringify` can be used to convert arbitrary data structures to ZON at runtime, again akin to `std.json`.
2025-01-24all: update for `panic.unwrapError` and `panic.call` signature changesmlugg
2025-01-22std.Build: add `addLibrary` function (#22554)BratishkaErik
Acts as a replacement for `addSharedLibrary` and `addStaticLibrary`, but linking mode can be changed more easily in build.zig, for example: In library: ```zig const linkage = b.option(std.builtin.LinkMode, "linkage", "Link mode for a foo_bar library") orelse .static; // or other default const lib = b.addLibrary(.{ .linkage = linkage, .name = "foo_bar", .root_module = mod, }); ``` In consumer: ```zig const dep_foo_bar = b.dependency("foo_bar", .{ .target = target, .optimize = optimize, .linkage = .static // or dynamic }); mod.linkLibrary(dep_foor_bar.artifact("foo_bar")); ``` It also matches nicely with `linkLibrary` name. Signed-off-by: Eric Joldasov <bratishkaerik@landless-city.net>
2024-12-18test-run-translated-c: migrate from deprecated std.Build APIsmlugg
2024-12-18test-cases: migrate from deprecated std.Build APIsmlugg
2024-11-28test: Change llvm_targets to actually emit an object for each target.Alex Rønne Petersen
Without doing this, we don't actually test whether the data layout string we generate matches LLVM's. A number of targets had to be commented out due to this change: * Some are using a non-working experimental LLVM backend (arc, csky, ...). * Some don't have working LLD support (lanai, sparc, ...). * Some don't have working self-hosted linker support (nvptx). * Some are using ABIs that haven't been standardized (loongarch32). Finally, all non-x86 uefi targets are hopelessly broken and can't really be fixed until we change our emit logic to lower *-uefi-* verbatim rather than to *-windows-*. See: https://github.com/ziglang/zig/issues/21630
2024-11-24test: Allow tests to set emit_bin=false.Alex Rønne Petersen
2024-11-24test: Force compile test cases to be codegen'd if requested.Alex Rønne Petersen
2024-11-24test: Allow setting PIC/PIE in test cases.Alex Rønne Petersen
2024-11-24test: Enable -Dtest-target-filter=... to work for test-cases and ↵Alex Rønne Petersen
test-translate-c.
2024-10-27spirv: forbid merging logical pointersRobin Voetter
Under some architecture/operating system combinations it is forbidden to return a pointer from a merge, as these pointers must point to a location at compile time. This adds a check for those cases when returning a pointer from a block merge.
2024-08-28std: update `std.builtin.Type` fields to follow naming conventionsmlugg
The compiler actually doesn't need any functional changes for this: Sema does reification based on the tag indices of `std.builtin.Type` already! So, no zig1.wasm update is necessary. This change is necessary to disallow name clashes between fields and decls on a type, which is a prerequisite of #9938.
2024-07-04compiler: rework type resolution, fully resolve all typesmlugg
I'm so sorry. This commit was just meant to be making all types fully resolve by queueing resolution at the moment of their creation. Unfortunately, a lot of dominoes ended up falling. Here's what happened: * I added a work queue job to fully resolve a type. * I realised that from here we could eliminate `Sema.types_to_resolve` if we made function codegen a separate job. This is desirable for simplicity of both spec and implementation. * This led to a new AIR traversal to detect whether any required type is unresolved. If a type in the AIR failed to resolve, then we can't run codegen. * Because full type resolution now occurs by the work queue job, a bug was exposed whereby error messages for type resolution were associated with the wrong `Decl`, resulting in duplicate error messages when the type was also resolved "by" its owner `Decl` (which really *all* resolution should be done on). * A correct fix for this requires using a different `Sema` when performing type resolution: we need a `Sema` owned by the type. Also note that this fix is necessary for incremental compilation. * This means a whole bunch of functions no longer need to take `Sema`s. * First-order effects: `resolveTypeFields`, `resolveTypeLayout`, etc * Second-order effects: `Type.abiAlignmentAdvanced`, `Value.orderAgainstZeroAdvanced`, etc The end result of this is, in short, a more correct compiler and a simpler language specification. This regressed a few error notes in the test cases, but nothing that seems worth blocking this change. Oh, also, I ripped out the old code in `test/src/Cases.zig` which introduced a dependency on `Compilation`. This dependency was problematic at best, and this code has been unused for a while. When we re-enable incremental test cases, we must rewrite their executor to use the compiler server protocol.
2024-07-04build: fix WriteFile and addCSourceFiles not adding LazyPath depsJonathan Marler
Adds a missing call to addLazyPathDependenciesOnly in std.Build.Module.addCSourceFiles. Also fixes an issue in std.Build.Step.WriteFile where it wasn't updating all the GeneratedFile instances for every directory. To fix the second issue, I removed all the GeneratedFile instances and now all files/directories reference the steps main GeneratedFile via sub paths.
2024-05-29rename zig-cache to .zig-cacheAndrew Kelley
closes #20077
2024-05-27translate-c tests: skip_foreign_checks=trueAndrew Kelley
2024-05-27test cases: try running foreign binariesAndrew Kelley
You don't know if it's possible to run a binary until you try. The build system already integrates with executors and has the `skip_foreign_checks` for exactly this use case.
2024-05-26std: restructure child process namespaceAndrew Kelley