mirror of
https://github.com/ziglang/zig.git
synced 2026-01-03 03:53:20 +00:00
Merge branch 'skippable-tests-issue1274' of https://github.com/kristate/zig into kristate-skippable-tests-issue1274
This commit is contained in:
commit
44292721bf
@ -123,10 +123,17 @@ pub async fn connect(loop: *Loop, _address: *const std.net.Address) !std.os.File
|
||||
}
|
||||
|
||||
test "listen on a port, send bytes, receive bytes" {
|
||||
if (builtin.os != builtin.Os.linux) {
|
||||
// TODO build abstractions for other operating systems
|
||||
return;
|
||||
// TODO build abstractions for other operating systems
|
||||
const skip_test: bool = switch (builtin.os) {
|
||||
builtin.Os.linux => false,
|
||||
//builtin.Os.macosx, builtin.Os.ios => false,
|
||||
else => true,
|
||||
};
|
||||
|
||||
if (skip_test == true) {
|
||||
return error.skip;
|
||||
}
|
||||
|
||||
const MyServer = struct {
|
||||
tcp_server: Server,
|
||||
|
||||
|
||||
@ -8,7 +8,13 @@ pub fn main() !void {
|
||||
for (test_fn_list) |test_fn, i| {
|
||||
warn("Test {}/{} {}...", i + 1, test_fn_list.len, test_fn.name);
|
||||
|
||||
try test_fn.func();
|
||||
test_fn.func() catch |err| {
|
||||
if (err == error.skip) {
|
||||
warn("SKIPPED\n");
|
||||
continue;
|
||||
}
|
||||
return err;
|
||||
};
|
||||
|
||||
warn("OK\n");
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user