Commit Graph

24 Commits

Author SHA1 Message Date
mlugg
f26dda2117 all: migrate code to new cast builtin syntax
Most of this migration was performed automatically with `zig fmt`. There
were a few exceptions which I had to manually fix:

* `@alignCast` and `@addrSpaceCast` cannot be automatically rewritten
* `@truncate`'s fixup is incorrect for vectors
* Test cases are not formatted, and their error locations change
2023-06-24 16:56:39 -07:00
Eric Joldasov
50339f595a all: zig fmt and rename "@XToY" to "@YFromX"
Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
2023-06-19 12:34:42 -07:00
Luuk de Gram
6c06944b59
wasm: fix return ret_load with zero-size type
When we have a `ret_load` instruction with a zero-sized type which was
not an error, we would not emit any instruction. This resulted in
no `return` instruction and also not correctly resetting the global
stack_pointer.

This commit also enables the regular test runner for the WebAssembly
backend.
2023-05-19 20:19:00 +02:00
Jacob Young
10a4c2269d x86_64: enable normal start/test_runner logic on more targets 2023-05-01 19:22:52 -04:00
Jacob Young
00ae3592e6 test_runner: use const to control verbose output 2023-05-01 19:22:52 -04:00
Jacob Young
894406b9d3 behavior: update passing cbe tests 2023-04-26 19:05:17 -04:00
Borja Clemente
bd801dc489
std: GPA deinit return an enum instead of a bool 2023-04-22 14:09:44 +03:00
Jacob Young
d5879ad1d0
x86_64: enable advanced test runner on Linux 2023-04-20 20:49:35 +01:00
Andrew Kelley
8e6d46bca5 test runner: remove one superfluous stack frame 2023-03-15 10:48:14 -07:00
Andrew Kelley
ede5dcffea make the build runner and test runner talk to each other
std.Build.addTest creates a CompileStep as before, however, this kind of
step no longer actually runs the unit tests. Instead it only compiles
it, and one must additionally create a RunStep from the CompileStep in
order to actually run the tests.

RunStep gains integration with the default test runner, which now
supports the standard --listen=- argument in order to communicate over
stdin and stdout. It also reports test statistics; how many passed,
failed, and leaked, as well as directly associating the relevant stderr
with the particular test name that failed.

This separation of CompileStep and RunStep means that
`CompileStep.Kind.test_exe` is no longer needed, and therefore has been
removed in this commit.

 * build runner: show unit test statistics in build summary
 * added Step.writeManifest since many steps want to treat it as a
   warning and emit the same message if it fails.
 * RunStep: fixed error message that prints the failed command printing
   the original argv and not the adjusted argv in case an interpreter
   was used.
 * RunStep: fixed not passing the command line arguments to the
   interpreter.
 * move src/Server.zig to std.zig.Server so that the default test runner
   can use it.
 * the simpler test runner function which is used by work-in-progress
   backends now no longer prints to stderr, which is necessary in order
   for the build runner to not print the stderr as a warning message.
2023-03-15 10:48:14 -07:00
Andrew Kelley
aeaef8c0ff update std lib and compiler sources to new for loop syntax 2023-02-18 19:17:21 -07:00
Takeshi Yoneda
3c6c4f88bb wasm: uses main instead of main2 for test runner
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
2023-01-26 17:49:43 +01:00
Veikka Tuominen
f83834993e std: collect all options under one namespace 2023-01-05 02:31:29 -07:00
joachimschmidt557
3051fab97c
stage2 AArch64: misc fixes, enable printing in test runner
- Fixed missing airRetPtr implementation
- Fixed wrong pop_regs order
- Fixed wrong source and destination register in store
2022-11-01 20:44:18 +01:00
Jacob Young
b945d3eb90 cbe: improve support for non-native float types
* Fix _start on aarch64.
 * Add fallbacks when a float type is unsupported.

Fixes #13357
2022-10-31 20:18:15 -04:00
Jacob Young
4765294ca4 cbe: get enough things working to support basic programs
* Enable advanced start support.
 * Enable advanced test_runner support.
 * Zig Language Reference's Hello World now works.
2022-10-25 05:11:29 -04:00
Martin Wickham
5523e2061b Move std.testing.zig_exe_path into build options 2022-09-14 14:42:58 -07:00
Andrew Kelley
c955379504 Revert "test_runner: workaround #1923, isolating error traces in tests"
This reverts commit 1a32f2a7f4.

Sorry, this workaround is not welcome. Instead, please solve the actual
issue by doing the accepted behavior in the compiler itself:

> in a catch or else (handling a returned error), if the block does not
> try or return error.xyz, set the index to 0

This also applies to if statements, such as the one that test runner is
doing just above this hack.
2022-08-22 11:46:54 -07:00
Techcable
1a32f2a7f4
test_runner: workaround #1923, isolating error traces in tests
Essentially #1923 means "caught" errors still show up in error return traces.
The correct fix would require the compiler to fix this, but that could affect performance.

For now, simply workaround this issue by clearing the return traces
between tests.

This means that "caught" errors in one test will not show up in the
error traces of other tests.
2022-08-22 14:38:03 +03:00
Lewis Gaul
a08b0fa706 Fix indexing in the test runner's log formatting 2022-07-24 12:08:02 +03:00
Andrew Kelley
f2e8c79763 std.Progress.log: adjust API
Now it will fall back to std.debug.print if there is no tty.
2022-05-26 21:58:19 -07:00
YeonJiKun
f3517a1aa6 zig test: Add proper detection for Windows console 2022-05-17 14:22:10 +03:00
Veikka Tuominen
66c3988e5e stage2: disable error return tracing on unsupported targets 2022-05-16 17:42:51 -07:00
Andrew Kelley
ec95e00e28 flatten lib/std/special and improve "pkg inside another" logic
stage2: change logic for detecting whether the main package is inside
the std package. Previously it relied on realpath() which is not portable.
This uses resolve() which is how imports already work.

 * stage2: fix cleanup bug when creating Module
 * flatten lib/std/special/* to lib/*
   - this was motivated by making main_pkg_is_inside_std false for
     compiler_rt & friends.
 * rename "mini libc" to "universal libc"
2022-05-06 22:41:00 -07:00