mirror of
https://github.com/ziglang/zig.git
synced 2024-11-28 08:02:32 +00:00
f1d338194e
* Introduce the concept of packages. Closes #3 * Add support for error notes. * Introduce `@import` and `@c_import` builtin functions and remove the `import` and `c_import` top level declarations. * Introduce the `use` top level declaration. * Add `--check-unused` parameter to perform semantic analysis and codegen on all top level declarations, not just exported ones and ones referenced by exported ones. * Delete the root export node and add `--library` argument.
28 lines
619 B
Zig
28 lines
619 B
Zig
const io = @import("std").io;
|
|
|
|
struct TestFn {
|
|
name: []u8,
|
|
func: extern fn(),
|
|
}
|
|
|
|
extern var zig_test_fn_list: []TestFn;
|
|
|
|
pub fn run_tests() -> %void {
|
|
for (zig_test_fn_list) |test_fn, i| {
|
|
%%io.stderr.print_str("Test ");
|
|
%%io.stderr.print_i64(i + 1);
|
|
%%io.stderr.print_str("/");
|
|
%%io.stderr.print_i64(zig_test_fn_list.len);
|
|
%%io.stderr.print_str(" ");
|
|
%%io.stderr.print_str(test_fn.name);
|
|
%%io.stderr.print_str("...");
|
|
%%io.stderr.flush();
|
|
|
|
test_fn.func();
|
|
|
|
|
|
%%io.stderr.print_str("OK\n");
|
|
%%io.stderr.flush();
|
|
}
|
|
}
|