From b5d1ebd1cda1b6557aef0c295c677487a80b48e1 Mon Sep 17 00:00:00 2001 From: Stephen Gutekanst Date: Sun, 18 Jul 2021 15:19:27 -0700 Subject: [PATCH] glfw: window open test is optional (cannot open windows on CI) Signed-off-by: Stephen Gutekanst --- glfw/src/Monitor.zig | 2 +- glfw/src/main.zig | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/glfw/src/Monitor.zig b/glfw/src/Monitor.zig index 6ab4bcfe..1177838d 100644 --- a/glfw/src/Monitor.zig +++ b/glfw/src/Monitor.zig @@ -538,4 +538,4 @@ test "set_getGammaRamp" { // technically not needed here / noop because GLFW owns this gamma ramp. defer ramp.deinit(allocator); } -} \ No newline at end of file +} diff --git a/glfw/src/main.zig b/glfw/src/main.zig index dfbcb01f..88bff53a 100644 --- a/glfw/src/main.zig +++ b/glfw/src/main.zig @@ -126,7 +126,10 @@ pub fn basicTest() !void { c.glfwWindowHint(c.GLFW_VISIBLE, c.GLFW_FALSE); const window = c.glfwCreateWindow(640, 480, "GLFW example", null, null); if (window == null) { - @panic("failed to create window"); + // return without fail, because most of our CI environments are headless / we cannot open + // windows on them. + std.debug.print("note: failed to create window", .{}); + return; } var start = std.time.milliTimestamp();