aboutsummaryrefslogtreecommitdiff
path: root/test/standalone.zig
AgeCommit message (Collapse)Author
2024-04-07Turn "simple" standalone test cases into a packageCarl Åstholm
2024-04-07Move "simple" standalone test cases to a new directoryCarl Åstholm
2024-04-07Promote standalone test cases to packagesCarl Åstholm
This is a prerequisite for removing `b.anonymousDependency()`, but having compiler tests dogfood package management might be a good idea in general.
2024-04-07Add standalone tests for `Compile.installHeaders`Carl Åstholm
Co-authored-by: Abhinav Gupta <mail@abhinavg.net>
2024-03-27Add standalone test for all possible MinGW exe entry pointsRyan Liptak
2024-03-12Move big enum tests to a standalone test caseCarl Åstholm
2024-02-23std.http: migrate remaining test/standalone/http.zig to std libAndrew Kelley
These tests were not being actually run. Now they are run along with testing the standard library.
2024-01-07remove tool: update-license-headersAndrew Kelley
This tool is not needed since license headers were removed in d29871977f97b50fe5e3f16cd9c68ebeba02a562.
2024-01-04build/LazyPath: Add dirname (#18371)Abhinav Gupta
Adds a variant to the LazyPath union representing a parent directory of a generated path. ```zig const LazyPath = union(enum) { generated_dirname: struct { generated: *const GeneratedFile, up: usize, }, // ... } ``` These can be constructed with the new method: ```zig pub fn dirname(self: LazyPath) LazyPath ``` For the cases where the LazyPath is already known (`.path`, `.cwd_relative`, and `dependency`) this is evaluated right away. For dirnames of generated files and their dirnames, this is evaluated at getPath time. dirname calls can be chained, but for safety, they are not allowed to escape outside a root defined for each case: - path: This is relative to the build root, so dirname can't escape outside the build root. - generated: Can't escape the zig-cache. - cwd_relative: This can be a relative or absolute path. If relative, can't escape the current directory, and if absolute, can't go beyond root (/). - dependency: Can't escape the dependency's root directory. Testing: I've included a standalone case for many of the happy cases. I couldn't find an easy way to test the negatives, though, because tests cannot yet expect panics.
2024-01-01add standalone test for depending on the main moduleAndrew Kelley
2024-01-01rename std.zig.CrossTarget to std.Target.QueryAndrew Kelley
2024-01-01zig build system: change target, compilation, and module APIsAndrew Kelley
Introduce the concept of "target query" and "resolved target". A target query is what the user specifies, with some things left to default. A resolved target has the default things discovered and populated. In the future, std.zig.CrossTarget will be rename to std.Target.Query. Introduces `std.Build.resolveTargetQuery` to get from one to the other. The concept of `main_mod_path` is gone, no longer supported. You have to put the root source file at the module root now. * remove deprecated API * update build.zig for the breaking API changes in this branch * move std.Build.Step.Compile.BuildId to std.zig.BuildId * add more options to std.Build.ExecutableOptions, std.Build.ObjectOptions, std.Build.SharedLibraryOptions, std.Build.StaticLibraryOptions, and std.Build.TestOptions. * remove `std.Build.constructCMacro`. There is no use for this API. * deprecate `std.Build.Step.Compile.defineCMacro`. Instead, `std.Build.Module.addCMacro` is provided. - remove `std.Build.Step.Compile.defineCMacroRaw`. * deprecate `std.Build.Step.Compile.linkFrameworkNeeded` - use `std.Build.Module.linkFramework` * deprecate `std.Build.Step.Compile.linkFrameworkWeak` - use `std.Build.Module.linkFramework` * move more logic into `std.Build.Module` * allow `target` and `optimize` to be `null` when creating a Module. Along with other fields, those unspecified options will be inherited from parent `Module` when inserted into an import table. * the `target` field of `addExecutable` is now required. pass `b.host` to get the host target.
2023-11-12sema: fixup underflows during struct / ptr array init when using -fstripkcbanner
2023-10-11move two TODO comments to a github issueAndrew Kelley
2023-10-11disable flaky testAndrew Kelley
2023-09-17Add a standalone test for Windows resource file compilationRyan Liptak
2023-08-19Merge pull request #16885 from squeek502/windows-selfExePath-symlinkAndrew Kelley
`fs.selfExePath`: Make the Windows implementation follow symlinks
2023-08-19Add self_exe_symlink standalone testRyan Liptak
Tests that fs.selfExePath follows symlinks by comparing it to the path of the File returned from fs.openSelfExe
2023-08-18standalone: add iOS smoke test - test ability to target iOS with ZigJakub Konka
2023-07-27test: add a test that verifies no debug handlers get pulled into compiler_rtkcbanner
build: fix CheckObject checkNotPresent only checking a single line of the haystack
2023-07-25remove tools/extract-grammar.zigAndrew Kelley
This is not a sound way to check Zig's grammar against the spec. This is a partial revert of f8f1c6ac06636d816e5dff205d6713a337df387d.
2023-07-25test/standalone: reinstate std.ChildProcess testsalex
67d5bfef removed std.ChildProcess tests, suggesting to make them standalone instead. This commit does exactly that after the bug creating SIGPIPE in ReleaseFast is no more with LLVM 15.0.5. Thanks to @x1ddos for the idea with the compile artifacts and PR improvements.
2023-07-20test: add a test for dwarf embedded in coffkcbanner
2023-07-20compilation: pass omit_frame_pointer through to builtin.zigkcbanner
Renamed dwarf_unwinding -> stack_iterator to better reflect that it's not just DWARF unwinding. Added a test for unwinding with a frame pointer.
2023-07-20test: add standalone test for DWARF unwinding with -fomit-frame-pointerkcbanner
2023-07-18Sema: fix return type of generic function is function pointerAndrew Kelley
also that's one less standalone test and one more behavior test.
2023-07-10add stand alone test to verify bulk-memory featuresLuuk de Gram
This adds a standalone test case to ensure the runtime does not trap when performing a memory.copy or memory.fill instruction while the destination or source address is out-of-bounds and the length is 0.
2023-06-21test: add standalone test for cmakedefineJan200101
2023-05-06std.http: add simple standalone http tests, add state check for http serverNameless
2023-04-17Sema: fix empty infinite loopsJacob Young
Closes #15284
2023-04-05Merge remote-tracking branch 'origin/master' into llvm16Andrew Kelley
2023-03-30tests: enable test_runner_module_imports standalone testdweiller
2023-03-19fix std.Build.OptionsStepAndrew Kelley
* use the same hash function as the rest of the steps * fix race condition due to a macOS oddity. * fix race condition due to file truncation (rename into place instead) * integrate with marking Step.result_cached. check if the file already exists with fs.access before doing anything else. * use a directory so that the file basename can be "options.zig" instead of a hash digest. * better error reporting in case of file system failures.
2023-03-16remove standalone test "issue_9812"Andrew Kelley
This test has a few problems: * I don't want to vendor third party projects into the main compiler repository such as kuba-zip just for test cases. If we want to test third party projects, that should be a separate repository dedicated to that purpose. * Ideally tests would be isolated to test a particular thing, rather than have a lot of unrelated logic that is not what is primarily being tested. * Ideally tests will not be named after GitHub issues, but named after the thing that is being tested. And not testing for the absence of a bug, but for the existence of correct behavior. Aside from these issues, it's also failing in the LLVM 16 branch: ``` kuba-zip/zip.c:276:16: error: call to undeclared function 'fileno'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] kuba-zip/zip.c:277:14: error: call to undeclared function 'ftruncate'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] kuba-zip/zip.c:364:11: error: call to undeclared function 'symlink'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] ``` These are not interesting failures related to the thing actually being tested; this is busywork related to the fact that we vendor third party code. So, that is why I chose to delete this test case instead of repair it.
2023-03-15add the new extern test to standalone testsAndrew Kelley
This was from master branch commit c93e0d86187cb589d6726acd36f741f3d87a96be. Since standalone test are completely reworked, I had to resolve the merge conflict later, in this commit.
2023-03-15standalone tests: avoid running on strange targetAndrew Kelley
Without this, aarch64-linux tried to compile this test for aarch64-windows with the same CPU settings, which is not an intended test combination.
2023-03-15re-enable standalone tests based on build.zigAndrew Kelley
2023-03-15re-enable the simple standalone testsAndrew Kelley
2023-03-12Sema: @extern fixesmlugg
* There was an edge case where the arena could be destroyed twice on error: once from the arena itself and once from the decl destruction. * The type of the created decl was incorrect (it should have been the pointer child type), but it's not required anyway, so it's now just initialized to anyopaque (which more accurately reflects what's actually at that memory, since e.g. [*]T may correspond to nothing). * A runtime bitcast of the pointer was performed, meaning @extern didn't work at comptime. This is unnecessary: the decl_ref can just be initialized with the correct pointer type.
2023-02-21Add test coverage for some module structuresmlugg
2023-02-17add test to ignore sigpipeJonathan Marler
2023-02-08fix custom test runner package path resolutiondweiller
Fixes #13970. This fix makes test runners resolve package paths relative to the directory the test runner is in. This means it is not possible to import a file from outside the file tree root at the directory containing the test runner.
2023-02-05make `@embedFile` support module-mapped names the same way as `@import`Andrew Kelley
closes #14553
2023-01-06tools: build all tools in ci to prevent bitrotJan Philipp Hafer
No LLVM assertions were triggered for me. Closes #12015 Closes #12022 Closes #12223
2023-01-02Revert "make a .rsp file for `zig clang`"Andrew Kelley
This reverts commit 9db293492bbbc5b8d70638bd9c59dea19d13596c. It's not OK to call `realpath` in the compiler. Reopens #12419
2022-12-18standalone tests: Add windows spawn testRyan Liptak
Tests a decent amount of edge cases dealing with how PATH and PATHEXT searching is handled.
2022-12-12Revert "compiler_c test: skip build modes on aarch64-windows"Coin
This reverts commit c029a98f1c601f4ff1369b49a4402d5c94fbb168.
2022-12-12Revert "mix_c_files: skip build modes on aarch64-windows due to bug"Coin
This reverts commit cf543199cad033b9739ce1b623d95fd30c973791.
2022-12-10compiler_c test: skip build modes on aarch64-windowsJakub Konka
2022-12-10mix_c_files: skip build modes on aarch64-windows due to bugJakub Konka