aboutsummaryrefslogtreecommitdiff
path: root/test/cli.zig
AgeCommit message (Collapse)Author
2022-08-05init-exe template: align cli tests to new templateLoris Cro
2022-07-24stage2: don't skip liveness or codegen if -femit-asm is suppliedAndrew Kelley
Fixes Godbolt's CLI usage of Zig.
2022-07-24std: compile error on invalid testing allocator usageAli Chraghi
2022-07-20CI: increase stage3 test coverageAndrew Kelley
* Use a debug build of stage3 instead of a debug build of stage2 for our self-hosted compiler test coverage. * Move coverage from stage1 to stage3 for: - building self-hosted without LLVM - building self-hosted for 32-bit arm - test-compiler-rt - test-behavior - test-std - test-compare-output - test-asm-link - test-fmt
2022-01-30Full response file (*.rsp) supportPhaseMage
I hit the "quotes in an RSP file" issue when trying to compile gRPC using "zig cc". As a fun exercise, I decided to see if I could fix it myself. I'm fully open to this code being flat-out rejected. Or I can take feedback to fix it up. This modifies (and renames) _ArgIteratorWindows_ in process.zig such that it works with arbitrary strings (or the contents of an RSP file). In main.zig, this new _ArgIteratorGeneral_ is used to address the "TODO" listed in _ClangArgIterator_. This change closes #4833. **Pros:** - It has the nice attribute of handling "RSP file" arguments in the same way it handles "cmd_line" arguments. - High Performance, minimal allocations - Fixed bug in previous _ArgIteratorWindows_, where final trailing backslashes in a command line were entirely dropped - Added a test case for the above bug - Harmonized the _ArgIteratorXxxx._initWithAllocator()_ and _next()_ interface across Windows/Posix/Wasi (Moved Windows errors to _initWithAllocator()_ rather than _next()_) - Likely perf benefit on Windows by doing _utf16leToUtf8AllocZ()_ only once for the entire cmd_line **Cons:** - Breaking Change in std library on Windows: Call _ArgIterator.initWithAllocator()_ instead of _ArgIterator.init()_ - PhaseMage is new with contributions to Zig, might need a lot of hand-holding - PhaseMage is a Windows person, non-Windows stuff will need to be double-checked **Testing Done:** - Wrote a few new test cases in process.zig - zig.exe build test -Dskip-release (no new failures seen) - zig cc now builds gRPC without error
2021-12-21Change `ArgIterator.next()` return typeominitay
Changes the return type of `ArgIterator.next()` from `?(NextError![:0]u8)` to `NextError!?[:0]u8`.
2021-11-30allocgate: renamed getAllocator function to allocatorLee Cannon
2021-11-30allocgate: stage 1 and 2 buildingLee Cannon
2021-11-30allocgate: std Allocator interface refactorLee Cannon
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-01std: fix regressions from this branchAndrew Kelley
Also move some usingnamespace test cases from compare_output to behavior.
2021-06-23update godbolt test case for unused parameterAndrew Kelley
2021-05-17std: `@import("builtin").StackTrace` -> `std.builtin.StackTrace`Andrew Kelley
2021-05-08update usage of std.testing in behavior and standalone testsVeikka Tuominen
2021-03-17test-cli: Remove temporary directory after testsErsikan
2021-03-17zig fmt: fix non-UTF-8 encoding #2820Ersikan
Fixes #2820 After reading the source code, the first two bytes are inspected, and if they correspond to a UTF-16 BOM in little-endian order, the source code is converted to UTF-8.
2021-02-10test/cli.zig: Remove inline from panic function in testGodboltApiTadeo Kondrak
Might add another line to stack traces there.
2021-02-10Convert inline fn to callconv(.Inline) everywhereTadeo Kondrak
2021-02-09require specifier for arrayish typesJonathan Marler
2020-12-08add std.testing.expectStringEndsWithAndrew Kelley
2020-10-16zig fmt: write modified files to stdout not stderrIsaac Freund
2020-09-30fix the cli test expected string to support native path separatorsAndrew Kelley
2020-09-26stage2: implement -fno-emit-binAndrew Kelley
we are now passing the cli tests
2020-09-26implement -femit-asm, -femit-docs, -femit-llvm-ir, etcAndrew Kelley
These CLI options are now forwarded to the stage1 backend. We're not going to support the -mllvm CLI option any longer. As a compromise, we unconditionally tell LLVM to output intel x86 syntax when using -femit-asm. Simplify stage1 logic; it no longer has the concept of an output directory. --output-dir is no longer a valid CLI option. cmake uses the `-femit-bin=[path]` option. Note the changes to test/cli.zig. This breaks the CLI API that Godbolt is using so we're going to want to open a PR to help them upgrade to the new CLI for the upcoming Zig 0.7.0 release.
2020-09-25update test case for init-exe with respect to new templateAndrew Kelley
Now it uses std.log.info instead of std.debug.print
2020-06-20Add 'no changes' test to zig fmt cli testRyan Liptak
2020-06-20Simplify unformatted code in zig fmt cli testRyan Liptak
2020-06-20Add zig fmt test to cli tests for both files and directoriesRyan Liptak
Should catch basic `zig fmt` regressions that were previously going uncaught and breaking things
2020-03-30std lib API deprecations for the upcoming 0.6.0 releaseAndrew Kelley
See #3811
2020-03-18fix swapped logic for WindowsAndrew Kelley
Remove `std.fs.deleteTree`. Callers instead should use `std.fs.cwd().deleteTree`. Add `std.fs.deleteTreeAbsolute` for when the caller has an absolute path.
2020-03-03update cli test to new std.fs APIAndrew Kelley
2020-02-28remove special darwin os version min handlingAndrew Kelley
now it is integrated with zig's target OS range.
2020-02-28update tests to new Target APIAndrew Kelley
2020-01-30Convert a few more page_allocatorBenjamin Feng
2019-12-08std.fmt.format: tuple parameter instead of var argsAndrew Kelley
2019-11-29more test regression fixesAndrew Kelley
2019-11-25rename std.heap.direct_allocator to std.heap.page_allocatorAndrew Kelley
std.heap.direct_allocator is still available for now but it is marked deprecated.
2019-11-24update cli testAndrew Kelley
2019-10-21test runner: restore previous behavior of printing all tests passedAndrew Kelley
2019-10-19Use 8192 sized buffers and remove allocator parametersstratact
2019-10-17improve progress reportingAndrew Kelley
* use erase rest of line escape code. * use `stderr.supportsAnsiEscapeCodes` rather than `isTty`. * respect `--color off` * avoid unnecessary recursion * add `Progress.log` * disable the progress std lib test since it's noisy and uses `time.sleep()`. * enable/integrate progress printing with the default test runner
2019-09-24Create user-specified `output-dir`Jay Weisskopf
Fixes #2637
2019-06-22heap: make one global instance of DirectAllocatorSahnvour
it is now stateless, so the de/init are not necessary anymore
2019-06-09different array literal syntax when inferring the sizeAndrew Kelley
old syntax: []i32{1, 2, 3} new syntax: [_]i32{1, 2, 3} closes #1797
2019-05-26clean up references to osAndrew Kelley
2019-03-10Merge remote-tracking branch 'origin/master' into llvm8Andrew Kelley
2019-03-08breaking changes to zig build API and improved cachingAndrew Kelley
* in Zig build scripts, getOutputPath() is no longer a valid function to call, unless setOutputDir() was used, or within a custom make() function. Instead there is more convenient API to use which takes advantage of the caching system. Search this commit diff for `exe.run()` for an example. * Zig build by default enables caching. All build artifacts will go into zig-cache. If you want to access build artifacts in a convenient location, it is recommended to add an `install` step. Otherwise you can use the `run()` API mentioned above to execute programs directly from their location in the cache. Closes #330. `addSystemCommand` is available for programs not built with Zig build. * Please note that Zig does no cache evicting yet. You may have to manually delete zig-cache directories periodically to keep disk usage down. It's planned for this to be a simple Least Recently Used eviction system eventually. * `--output`, `--output-lib`, and `--output-h` are removed. Instead, use `--output-dir` which defaults to the current working directory. Or take advantage of `--cache on`, which will print the main output path to stdout, and the other artifacts will be in the same directory with predictable file names. `--disable-gen-h` is available when one wants to prevent .h file generation. * `@cImport` is always independently cached now. Closes #2015. It always writes the generated Zig code to disk which makes debug info and compile errors better. No more "TODO: remember C source location to display here" * Fix .d file parsing. (Fixes the MacOS CI failure) * Zig no longer creates "temporary files" other than inside a zig-cache directory. This breaks the CLI API that Godbolt uses. The suggested new invocation can be found in this commit diff, in the changes to `test/cli.zig`.
2019-02-09Merge remote-tracking branch 'origin/master' into llvm8Andrew Kelley
2019-02-08std.debug.assert: remove special case for test buildsAndrew Kelley
Previously, std.debug.assert would `@panic` in test builds, if the assertion failed. Now, it's always `unreachable`. This makes release mode test builds more accurately test the actual code that will be run. However this requires tests to call `std.testing.expect` rather than `std.debug.assert` to make sure output is correct. Here is the explanation of when to use either one, copied from the assert doc comments: Inside a test block, it is best to use the `std.testing` module rather than assert, because assert may not detect a test failure in ReleaseFast and ReleaseSafe mode. Outside of a test block, assert is the correct function to use. closes #1304