aboutsummaryrefslogtreecommitdiff
path: root/test/tests.zig
AgeCommit message (Collapse)Author
2020-03-03Merge remote-tracking branch 'origin/master' into llvm10Andrew Kelley
2020-02-28separate std.Target and std.zig.CrossTargetAndrew Kelley
Zig now supports a more fine-grained sense of what is native and what is not. Some examples: This is now allowed: -target native Different OS but native CPU, default Windows C ABI: -target native-windows This could be useful for example when running in Wine. Different CPU but native OS, native C ABI. -target x86_64-native -mcpu=skylake Different C ABI but otherwise native target: -target native-native-musl -target native-native-gnu Lots of breaking changes to related std lib APIs. Calls to getOs() will need to be changed to getOsTag(). Calls to getArch() will need to be changed to getCpuArch(). Usage of Target.Cross and Target.Native need to be updated to use CrossTarget API. `std.build.Builder.standardTargetOptions` is changed to accept its parameters as a struct with default values. It now has the ability to specify a whitelist of targets allowed, as well as the default target. Rather than two different ways of collecting the target, it's now always a string that is validated, and prints helpful diagnostics for invalid targets. This feature should now be actually useful, and contributions welcome to further improve the user experience. `std.build.LibExeObjStep.setTheTarget` is removed. `std.build.LibExeObjStep.setTarget` is updated to take a CrossTarget parameter. `std.build.LibExeObjStep.setTargetGLibC` is removed. glibc versions are handled in the CrossTarget API and can be specified with the `-target` triple. `std.builtin.Version` gains a `format` method.
2020-02-28update std lib to new Target APIAndrew Kelley
2020-02-28introduce operating system version ranges as part of the targetAndrew Kelley
* re-introduce `std.build.Target` which is distinct from `std.Target`. `std.build.Target` wraps `std.Target` so that it can be annotated as "the native target" or an explicitly specified target. * `std.Target.Os` is moved to `std.Target.Os.Tag`. The former is now a struct which has the tag as well as version range information. * `std.elf` gains some more ELF header constants. * `std.Target.parse` gains the ability to parse operating system version ranges as well as glibc version. * Added `std.Target.isGnuLibC()`. * self-hosted dynamic linker detection and glibc version detection. This also adds the improved logic using `/usr/bin/env` rather than invoking the system C compiler to find the dynamic linker when zig is statically linked. Related: #2084 Note: this `/usr/bin/env` code is work-in-progress. * `-target-glibc` CLI option is removed in favor of the new `-target` syntax. Example: `-target x86_64-linux-gnu.2.27` closes #1907
2020-02-28restructuring std.Target for OS version ranges, pass 1Andrew Kelley
2020-02-26update test expectationsAndrew Kelley
2020-02-25Merge remote-tracking branch 'origin/master' into llvm10Andrew Kelley
2020-02-20Merge remote-tracking branch 'origin/master' into sub-architecture-annihilationAndrew Kelley
2020-02-20support -mcpu=baseline, both in stage1 and stage2Andrew Kelley
See e381a42de9c0f0c5439a926b0ac99026a0373f49 for more details. This is set up so that if we wish to make "baseline" depend on the OS in the future, it is possible to do that.
2020-02-20ir: Compile error on result_loc type mismatch w/ slicingLemonBoy
Closes #4508
2020-02-19remove the concept of "sub-architecture"Andrew Kelley
in favor of CPU features. Also rearrange the `std.Target` data structure. * note: `@import("builtin")` was already deprecated in favor of `@import("std").builtin`. * `std.builtin.arch` is now deprecated in favor of `std.builtin.cpu.arch`. * `std.Target.CpuFeatures.Cpu` is now `std.Target.Cpu.Model`. * `std.Target.CpuFeatures` is now `std.Target.Cpu`. * `std.Target` no longer has an `arch` field. Instead it has a `cpu` field, which has `arch`, `model`, and `features`. * `std.Target` no longer has a `cpu_features` field. * `std.Target.Arch` is moved to `std.Target.Cpu.Arch` and it is an enum instead of a tagged union. * `std.Target.parseOs` is moved to `std.Target.Os.parse`. * `std.Target.parseAbi` is moved to `std.Target.Abi.parse`. * `std.Target.parseArchSub` is only for arch now and moved to `std.Target.Cpu.Arch.parse`. * `std.Target.parse` is improved to accept CPU name and features. * `std.Target.Arch.getBaselineCpuFeatures` is moved to `std.Target.Cpu.baseline`. * `std.Target.allCpus` is renamed to `std.Target.allCpuModels`. * `std.Target.defaultAbi` is moved to `std.Target.Abi.default`. * Significant cleanup of aarch64 and arm CPU features, resulting in the needed bit count for cpu feature set going from 174 to 138. * Add `std.Target.Cpu.Feature.Set.addFeatureSet` for merging feature sets together. `-target-feature` and `-target-cpu` are removed in favor of `-mcpu`, to conform to established conventions, and it gains additional power to support cpu features. The syntax is: -mcpu=name+on1+on2-off1-off2 closes #4261
2020-02-17enable behavior and std lib tests for RISC-V 64-bitAndrew Kelley
closes #3338
2020-01-26fix regression in windows stack traces tty detectionAndrew Kelley
2020-01-23fix incorrect list of sub-arches for aarch64Andrew Kelley
tests use older sub-arch that works in the older qemu
2020-01-23use an older arm64 sub-arch for test suiteAndrew Kelley
hopefully this avoids the older qemu version crashing
2020-01-22std.Target.CpuFeatures is now a struct with both CPU and feature setAndrew Kelley
Previously it was a tagged union which was one of: * baseline * a specific CPU * a set of features Now, it's possible to have a CPU but also modify the CPU's feature set on top of that. This is closer to what LLVM does. This is more correct because Zig's notion of CPUs (and LLVM's) is not exact CPU models. For example "skylake" is not one very specific model; there are several different pieces of hardware that match "skylake" that have different feature sets enabled.
2020-01-21Revert "tests: use an older aarch64 sub-arch"Andrew Kelley
This reverts commit 4640ef589e8fddcab7aeab2c6044bc031cf33515. This attempted workaround did not have the desired effect.
2020-01-21tests: use an older aarch64 sub-archAndrew Kelley
to avoid an illegal instruction error with the older qemu version that is available on the CI server.
2020-01-05fix test-gen-h and test-compile-errors regressionAndrew Kelley
2020-01-05fix test-stack-traces regressionAndrew Kelley
2020-01-05rework and improve some of the zig build stepsAndrew Kelley
* `RunStep` moved to lib/std/build/run.zig and gains ability to compare output and exit code against expected values. Multiple redundant locations in the test harness code are replaced to use `RunStep`. * `WriteFileStep` moved to lib/std/build/write_file.zig and gains ability to write more than one file into the cache directory, for when the files need to be relative to each other. This makes usage of `WriteFileStep` no longer problematic when parallelizing zig build. * Added `CheckFileStep`, which can be used to validate that the output of another step produced a valid file. Multiple redundant locations in the test harness code are replaced to use `CheckFileStep`. * Added `TranslateCStep`. This exposes `zig translate-c` to the build system, which is likely to be rarely useful by most Zig users; however Zig's own test suite uses it both for translate-c tests and for run-translated-c tests. * Refactored ad-hoc code to handle source files coming from multiple kinds of sources, into `std.build.FileSource`. * Added `std.build.Builder.addExecutableFromWriteFileStep`. * Added `std.build.Builder.addExecutableSource`. * Added `std.build.Builder.addWriteFiles`. * Added `std.build.Builder.addTranslateC`. * Added `std.build.LibExeObjStep.addCSourceFileSource`. * Added `std.build.LibExeObjStep.addAssemblyFileFromWriteFileStep`. * Added `std.build.LibExeObjStep.addAssemblyFileSource`. * Exposed `std.fs.base64_encoder`.
2020-01-03add test harness for "run translated C" testsAndrew Kelley
2020-01-02translate-c tests: print clang compile errors on nonzero exit codeAndrew Kelley
2019-12-29use self hosted translate-c for cimportsVexu
2019-12-13revert removal of translate mode in stage 1Vexu
2019-12-12update testsVexu
2019-12-09remove var args from the languageAndrew Kelley
closes #208
2019-12-08std.fmt.format: tuple parameter instead of var argsAndrew Kelley
2019-12-01Merge remote-tracking branch 'origin/master' into remove-array-type-coercionAndrew Kelley
2019-11-30Eat shit and die mipsLemonBoy
2019-11-30Eat shit and die glibcLemonBoy
2019-11-30linux-i386 supportLemonBoy
2019-11-27remove type coercion from array values to referencesAndrew Kelley
* Implements #3768. This is a sweeping breaking change that requires many (trivial) edits to Zig source code. Array values no longer coerced to slices; however one may use `&` to obtain a reference to an array value, which may then be coerced to a slice. * Adds `IrInstruction::dump`, for debugging purposes. It's useful to call to inspect the instruction when debugging Zig IR. * Fixes bugs with result location semantics. See the new behavior test cases, and compile error test cases. * Fixes bugs with `@typeInfo` not properly resolving const values. * Behavior tests are passing but std lib tests are not yet. There is more work to do before merging this branch.
2019-11-08update the codebase to use `@as`Andrew Kelley
2019-10-11Fix cross-compilation to i386-windows-msvcLemonBoy
Use Mingw's .def files to build a .lib when possible and show an error otherwise.
2019-10-10Add i386/mingw to the test roosterLemonBoy
2019-09-27Enable mipsel+libc tests on CILemonBoy
2019-09-26Initial support for mipsel architecture¬LemonBoy
2019-09-25remove --override-std-dir. fix issues caused by moving std libAndrew Kelley
2019-09-25enable test coverage for armv8-linux-musleabihfAndrew Kelley
* fix libc prototypes of offsets to have correct integer sizes and signedness. This gets all behavior tests to pass for armv8-linux-musleabihf * fix linux mmap syscall to have correct integer size and signedness for offset * disable failing armv8-linux-musleabihf std lib tests. See 3289. I suspect compiler-rt issue. Note these tests fail with this target triple regardless of whether musl is actually linked (-lc).
2019-09-22enable test coverage for cross compiling windows mingw-w64Andrew Kelley
closes #3285
2019-09-22do the release tests last because they take longerAndrew Kelley
2019-09-22disable running cross compiled macos testsAndrew Kelley
due to #3295
2019-09-22significantly increase test coverageAndrew Kelley
* add zig build option `-Dskip-libc` to skip tests that build libc (e.g. if you don't want to wait for musl to build) * add `-Denable-wine` option which uses wine to run cross compiled windows tests on non-windows hosts * add `-Denable-qemu` option which uses qemu to run cross compiled foreign architecture tests * add `-Denable-foreign-glibc=path` option which combined with `-Denable-qemu` enables running cross compiled tests that link against glibc. See https://github.com/ziglang/zig/wiki/Updating-libc#glibc for how to produce this directory. * the test matrix is done manually. release test builds are only enabled by default for the native target. this should save us some CI time, while still providing decent coverage of release builds. - add test coverage for `x86_64-linux-musl -lc` (building musl libc) - add test coverage for `x86_64-linux-gnu -lc` (building glibc) - add test coverage for `aarch64v8_5a-linux-none` - add test coverage for `aarch64v8_5a-linux-musl -lc` (building musl libc) - add test coverage for `aarch64v8_5a-linux-gnu -lc` (building glibc) - add test coverage for `arm-linux-none` - test coverage for `arm-linux-musleabihf -lc` (building musl libc) is disabled due to #3286 - test coverage for `arm-linux-gnueabihf -lc` (building glibc) is disabled due to #3287 - test coverage for `x86_64-windows-gnu -lc` (building mingw-w64) is disabled due to #3285 * enable qemu testing on the Linux CI job. There's not really a good reason to enable wine, since we have a Windows CI job as well. * remove the no longer needed `--build-file ../build.zig` from CI scripts * fix bug in glibc compilation where it wasn't properly reading the abi list txt files, resulting in "key not found" error. * std.build.Target gains: - isNetBSD - isLinux - osRequiresLibC - getArchPtrBitWidth - getExternalExecutor * zig build system gains support for enabling wine and enabling qemu. `artifact.enable_wine = true;`, `artifact.enable_qemu = true;`. This communicates that the system has these tools installed and the build system will use them to run tests. * zig build system gains support for overriding the dynamic linker of an executable artifact. * fix std.c.lseek prototype. makes behavior tests for arm-linux-musleabihf pass. * disable std lib tests that are failing on ARM. See #3288, #3289 * provide `std.os.off_t`. * disable some of the compiler_rt symbols for arm 32 bit. Fixes compiler_rt tests for arm 32 bit * add __stack_chk_guard when linking against glibc. Fixes std lib tests for aarch64-linux-gnu * workaround for "unable to inline function" using `@inlineCall`. Fixes compiler_rt tests for arm 32 bit.
2019-09-10fix tests.addPkgTests to always run native targetMichael Dusan
- include native-target when native-target ∉ cross_targets old behavior: - do nothing when `-Dskip-non-native` - never execute pkg tests for non-members of cross_targets
2019-09-03rename test-compare-panic to test-stack-tracesAndrew Kelley
2019-09-03rename compare-panic to compare-stack-tracesAndrew Kelley
2019-09-03test: add compare-panicMichael Dusan
`zig build test-compare-panic` Create basic tests to compare panic output. The address field is replaced by a symbolic constant and each expected output is specific to os. Tests will only run for explicitly defined platforms. see also #2485
2019-08-20specify the target for the newest test caseAndrew Kelley
2019-07-22compiler-rt: add __muldi3Andrew Kelley