aboutsummaryrefslogtreecommitdiff
path: root/test/tests.zig
AgeCommit message (Collapse)Author
2022-09-07tests: force LLD off for stage2 backends until auto-select deems worthyJakub Konka
2022-09-07enable testing of x86_64-windows-gnu using self-hosted backend and linkerJakub Konka
2022-08-22test harness: don't skip testsAndrew Kelley
The meaning of this "skip_stage2" flag was intended to mean the self-hosted backends, not the stage2 frontend. Sorry for the confusion. closes #12541
2022-08-19test-stack-traces: relax parsing rulesAndrew Kelley
* accept forward and backward slashes in file paths * strip multiple extensions; e.g. if the basename is "test.exe.obj" then it strips to "test".
2022-08-19build: hook up -Dskip-stage2-tests and remove test-toolchainAndrew Kelley
2022-08-19make self-hosted the default compilerAndrew Kelley
stage1 is available behind the -fstage1 flag. closes #89
2022-08-19build: remove the option to omit stage2Andrew Kelley
2022-08-11disable failing C backend behavior test on WindowsAndrew Kelley
See tracking issue #12415
2022-07-25wasm: Enable C-ABI tests for self-hosted compilerLuuk de Gram
2022-07-21tests: remove superfluous newlines from logsAndrew Kelley
2022-07-12wasm-linker: Implement linker tests (#12006)Luuk de Gram
* test/link: initial wasm support This adds basic parsing and dumping of wasm section so they can be tested using the new linker-test infrastructure. * test/link: all wasm sections parsing and dumping We now parse and dump all sections for the wasm binary format. Currently, this only dumps the name of a custom section. Later this should also dump symbol table, name, linking metadata and relocations. All of those live within the custom sections. * Add wasm linker test This also fixes a parser mistake in reading the flags. * test/link: implement linker tests wasm & fixes Adds several test cases to test the wasm self-hosted linker. This also introduces fixes that were caught during the implementation of those tests. * test-runner: obey omit_stage2 for standalone When a standalone test requires stage2, but stage2 is omit from the compiler, such test case will not be included as part of the test suite that is being ran. This is to support CI's where we omit stage2 to lower the memory usage.
2022-06-20link-tests: CheckFileStep to do grep test on the binaryJakub Konka
2022-06-20test: introduce link(er) tests - builds on standalone testsJakub Konka
2022-05-22stage2: append min version to target triple when lowering to LLVMJakub Konka
2022-05-13migrate runtime safety tests to the new test harnessAndrew Kelley
* migrate runtime safety tests to the new test harness - this required adding compare output / execution support for stage1 to the test harness. * rename `zig build test-stage2` to `zig build test-cases` since it now does quite a bit of stage1 testing actually. I named it this way since the main directory in the source tree associated with these tests is "test/cases/". * add some documentation for the test manifest format.
2022-05-05CI: add non-LLVM backends to the test matrixAndrew Kelley
We can't yet run the behavior tests with stage3, but at least we can run them with stage2, and we can use the proper test matrix. This commit also adds use_llvm and ofmt to the zig build system.
2022-04-29std: Do not allocate the result for ChildProcess.initJimmi Holst Christensen
Instead, just return ChildProcess directly. This structure does not require a stable address, so we can put it on the stack just fine. If someone wants it on the heap they should do. const proc = try allocator.create(ChildProcess); proc.* = ChildProcess.init(args, allocator);
2022-02-06Replace argvCmd with std.mem.joinCody Tapscott
2022-02-06Avoid depending on child process execution when not supported by host OSCody Tapscott
In accordance with the requesting issue (#10750): - `zig test` skips any tests that it cannot spawn, returning success - `zig run` and `zig build` exit with failure, reporting the command the cannot be run - `zig clang`, `zig ar`, etc. already punt directly to the appropriate clang/lld main(), even before this change - Native `libc` Detection is not supported Additionally, `exec()` and related Builder functions error at run-time, reporting the command that cannot be run
2022-01-24Normalize some build function namesJonathan Marler
An attempt to normalize some of the function names in build.zig. Normalize add*Dir to add*Path. Also use "Library" instead of the "Lib" abbreviation. The PR does not remove the old names, only adds the new normalized ones to faciliate a transition period.
2021-12-16glibc: fix inconsistency of powerpc ABI mappingAndrew Kelley
See the commit message of 5b6d26e97bb97d79782f3c77b02a997e361a1497 for an explanation. This is the same thing but for powerpc instead of mips.
2021-12-15glibc: fix inconsistency of mips ABI mappingAndrew Kelley
Before this commit, glibc headers did the following mapping: * (zig) mipsel-linux-gnu => (glibc) mipsel-linux-gnu * (zig) mipsel-linux-gnu-soft => (glibc) (none) * (zig) mips-linux-gnu => (glibc) mips-linux-gnu * (zig) mips-linux-gnu-soft => (glibc) (none) While the glibc ABI stubs used the (zig) gnueabi and gnueabihf ABIs, and the stage2 available_libcs array listed: * (zig) mipsel-linux-gnu * (zig) mips-linux-gnu The problem is the mismatch between the ABI component of the headers and the stubs. This commit makes the following clarifications: * (zig) mips-linux-gnueabi means soft-float * (zig) mipsel-linux-gnueabi means soft-float * (zig) mips-linux-gnueabihf means hard-float * (zig) mipsel-linux-gnueabihf means hard-float Consequently, the glibc headers now do this mapping: * (zig) mips-linux-gnueabihf => (glibc) mips-linux-gnu * (zig) mipsel-linux-gnueabihf => (glibc) mipsel-linux-gnu * (zig) mips-linux-gnueabi => (glibc) mips-linux-gnu-soft * (zig) mipsel-linux-gnueabi => (glibc) mipsel-linux-gnu-soft The glibc ABI stubs are unchanged, and the stage2 available_libcs array's 2 entries are modified and it gains 2 more: * (zig) mipsel-linux-gnueabi * (zig) mipsel-linux-gnueabihf * (zig) mips-linux-gnueabi * (zig) mips-linux-gnueabihf Now everything is consistent. Zig no longer recognizes a `mips-linux-gnu` triple; one must use `mips-linux-gnueabi` (soft float) or `mips-linux-gnueabihf` (hard float).
2021-12-02zig build: promote qemu, wine, wasmtime, darling, and rosettaAndrew Kelley
from zig-specific options to generally recognized zig build options that any project can take advantage of. See the updated usage text for more details.
2021-12-02Remove .disable_native for x86_64-macos as it's fixed nowJakub Konka
Add `aarch64-macos-gnu` corresponding test case. Fix rebase gone wrong.
2021-12-02Make Rosetta availability declarative by the userJakub Konka
Like QEMU or Wine, you need to declare you want Rosetta enabled for running tests/build artifacts via `-Denable-rosetta` flag.
2021-11-30std lib API deprecations for the upcoming 0.9.0 releaseAndrew Kelley
See #3811
2021-10-04migrate from `std.Target.current` to `@import("builtin").target`Andrew Kelley
closes #9388 closes #9321
2021-09-24Spelling corrections (#9833)Josh Soref
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> Co-authored-by: Josh Soref <jsoref@users.noreply.github.com>
2021-09-07Fix building aarch64-windows-gnu by adding missing libc files and ↵Jonathan Marler
compiler_rt functions (#9555) * fix issue 9519 Added some missing files from mingw * add missing compiler_rt functions * finish PR * add aarch64-windows-gnu to test targets * add more compiler_rt * add log2 * add pow * add modti3
2021-08-31re-enable all the MIPS testsAndrew Kelley
LLVM 12.0.1 fixed the regressions from LLVM 12.0.0. Closes #8155
2021-08-09Merge remote-tracking branch 'origin' into libc-wasi-testTakeshi Yoneda
2021-08-06Update all usages of mem.split/mem.tokenize for generic versionRyan Liptak
2021-08-02Add -Denable-macos-sdk explicit flag to build.zigJakub Konka
This way, we can explicitly signal if a test requires the presence of macOS SDK to build. For instance, when testing our in-house MachO linker for correctly linking Objective-C, we require the presence of the SDK on the host system, and we can enforce this with `-Denable-macos-sdk` flag to `zig build test-standalone`.
2021-07-27WASI,libc: enable tests.Takeshi Yoneda
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
2021-07-02avoid calling into stage1 backend when AstGen failsAndrew Kelley
The motivation for this commit is that there exists source files which produce ast-check errors, but crash stage1 or otherwise trigger stage1 bugs. Previously to this commit, Zig would run AstGen, collect the compile errors, run stage1, report stage1 compile errors and exit if any, and then report AstGen compile errors. The main change in this commit is to report AstGen errors prior to invoking stage1, and in fact if any AstGen errors occur, do not invoke stage1 at all. This caused most of the compile error tests to fail due to things such as unused local variables and mismatched stage1/stage2 error messages. It was taking a long time to update the test cases one-by-one, so I took this opportunity to unify the stage1 and stage2 testing harness, specifically with regards to compile errors. In this way we can start keeping track of which tests pass for 1, 2, or both. `zig build test-compile-errors` no longer works; it is now integrated into `zig build test-stage2`. This is one step closer to executing compile error tests in parallel; in fact the ThreadPool object is already in scope. There are some cases where the stage1 compile errors were actually better; those are left failing in this commit, to be addressed in a follow-up commit. Other changes in this commit: * build.zig: improve support for -Dstage1 used with the test step. * AstGen: minor cosmetic changes to error messages. * stage2: add -fstage1 and -fno-stage1 flags. This now allows one to download a binary of the zig compiler and use the llvm backend of self-hosted. This was also needed for hooking up the test harness. However, I realized that stage1 calls exit() and also has memory leaks, so had to complicate the test harness by not using this flag after all and instead invoking as a child process. - These CLI flags will disappear once we start shipping the self-hosted compiler as the main compiler. Until then, they can be used to try out the work-in-progress stage2. * stage2: select the LLVM backend by default for release modes, as long as the target architecture is supported by LLVM. * test harness: support setting the optimize mode
2021-06-21fix code broken from previous commitJacob G-W
2021-06-21std, src, doc, test: remove unused variablesJacob G-W
2021-06-13format zig files and add formatting check to cijacob gw
2021-06-12std.build: don't default to static linkageVeikka Tuominen
2021-06-11make remaining enums in build.zig snake_caseVeikka Tuominen
2021-06-11Changes to .path instead of .getPathFn. Changes LibExeObjStep to also ↵Felix (xq) Queißner
provide FileSource.
2021-06-11Changes createExecutable parameter is_dynamic to a enum to make code more ↵Felix (xq) Queißner
readable .
2021-06-06Revert "tests: disable i386-linux-gnu -lc target due to CI failures"LemonBoy
This reverts commit 97a2f4e7ae9c52c595841347bb0b26572b180dcf.
2021-05-28tests: disable i386-linux-gnu -lc target due to CI failuresAndrew Kelley
See #8930
2021-05-25standalone tests may now test cross targets and build modes.xavier
2021-05-15Merge remote-tracking branch 'origin/master' into stage2-whole-file-astgenAndrew Kelley
Conflicts: * build.zig * src/Compilation.zig * src/codegen/spirv/spec.zig * src/link/SpirV.zig * test/stage2/darwin.zig - this one might be problematic; start.zig looks for `main` in the root source file, not `_main`. Not sure why there is an underscore there in master branch.
2021-05-13Add experimental Darling support for cross testing macOSJakub Konka
* for cross testing stage2 tests, we use `darling shell` command since the path to the tested binary is relative to cwd * for the `zig test` command, we simply use `darling` since the path to the binary is absolute
2021-05-12Merge remote-tracking branch 'origin/master' into stage2-whole-file-astgenAndrew Kelley
Conflicts: * lib/std/os/linux.zig * lib/std/os/windows/bits.zig * src/Module.zig * src/Sema.zig * test/stage2/test.zig Mainly I wanted Jakub's new macOS code for respecting stack size, since we now depend on it for debug builds able to pass one of the test cases for recursive comptime function calls with `@setEvalBranchQuota`. The conflicts were all trivial.
2021-05-11test: Enable i386-linux-gnu testLemonBoy
This is needed to catch any possible problem with executables linking to 32bit glibc.
2021-04-24Merge remote-tracking branch 'origin/master' into stage2-whole-file-astgenAndrew Kelley
In particular I wanted the change that makes `suspend;` illegal in the parser.