mirror of
https://github.com/ziglang/zig.git
synced 2026-02-12 20:37:54 +00:00
test runner: prepare stage2 workaround
This provides a simpler test runner that exercises fewer language features so that we can get to the point faster where `zig test` works for stage2.
This commit is contained in:
parent
8a7a07f30d
commit
ab6b0ad8a4
@ -22,6 +22,9 @@ fn processArgs() void {
|
||||
}
|
||||
|
||||
pub fn main() anyerror!void {
|
||||
if (builtin.zig_is_stage2) {
|
||||
return main2();
|
||||
}
|
||||
processArgs();
|
||||
const test_fn_list = builtin.test_functions;
|
||||
var ok_count: usize = 0;
|
||||
@ -123,3 +126,10 @@ pub fn log(
|
||||
std.debug.print("[{s}] ({s}): " ++ format ++ "\n", .{ @tagName(scope), @tagName(message_level) } ++ args);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn main2() anyerror!void {
|
||||
// Simpler main(), exercising fewer language features, so that stage2 can handle it.
|
||||
for (builtin.test_functions) |test_fn| {
|
||||
try test_fn.func();
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user