aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2021-07-23 22:23:03 -0700
committerAndrew Kelley <andrew@ziglang.org>2021-07-23 22:42:31 -0700
commit7b8cb881df7e034a8626caabf355055ee81a0fef (patch)
treee56858cd22ccf90217a49c51c7d8ff7df49ab0f3 /lib
parentf9798108f8434f277de6089502446f2544ee98b3 (diff)
downloadzig-7b8cb881df7e034a8626caabf355055ee81a0fef.tar.gz
zig-7b8cb881df7e034a8626caabf355055ee81a0fef.zip
stage2: improvements towards `zig test`
* There is now a main_pkg in addition to root_pkg. They are usually the same. When using `zig test`, main_pkg is the user's source file and root_pkg has the test runner. * scanDecl no longer looks for test decls outside the package being tested. honoring `--test-filter` is still TODO. * test runner main function has a void return value rather than `anyerror!void` * Sema is improved to generate better AIR for for loops on slices. * Sema: fix incorrect capacity calculation in zirBoolBr * Sema: add compile errors for trying to use slice fields as an lvalue. * Sema: fix type coercion for error unions * Sema: fix analyzeVarRef generating garbage AIR * C codegen: fix renderValue for error unions with 0 bit payload * C codegen: implement function pointer calls * CLI: fix usage text Adds 4 new AIR instructions: * slice_len, slice_ptr: to get the ptr and len fields of a slice. * slice_elem_val, ptr_slice_elem_val: to get the element value of a slice, and a pointer to a slice. AstGen gains a new functionality: * One of the unused flags of struct decls is now used to indicate structs that are known to have non-zero size based on the AST alone.
Diffstat (limited to 'lib')
-rw-r--r--lib/std/special/test_runner.zig4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/std/special/test_runner.zig b/lib/std/special/test_runner.zig
index d78de41436..f8411c036b 100644
--- a/lib/std/special/test_runner.zig
+++ b/lib/std/special/test_runner.zig
@@ -21,9 +21,9 @@ fn processArgs() void {
std.testing.zig_exe_path = args[1];
}
-pub fn main() anyerror!void {
+pub fn main() void {
if (builtin.zig_is_stage2) {
- return main2();
+ return main2() catch @panic("test failure");
}
processArgs();
const test_fn_list = builtin.test_functions;