Skip to content

Commit 309e379

Browse files
authored
test: link GLFW window path in portable smoke (#22)
1 parent a0fe71b commit 309e379

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

tests/smoke_compat_portable.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,8 @@ imgui = "1.92.8"
243243
glfw = "3.4"
244244
EOF
245245
cat > src/main.cpp <<'EOF'
246+
#include <cstdlib>
247+
246248
#define GLFW_INCLUDE_NONE
247249
#include <GLFW/glfw3.h>
248250
#include <imgui.h>
@@ -252,7 +254,32 @@ cat > src/main.cpp <<'EOF'
252254
#include "imgui_impl_glfw.cpp"
253255
#include "imgui_impl_opengl3.cpp"
254256
257+
static int run_glfw_window_smoke() {
258+
if (!glfwInit()) {
259+
return 10;
260+
}
261+
262+
glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE);
263+
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 2);
264+
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0);
265+
266+
GLFWwindow* window = glfwCreateWindow(64, 64, "mcpp compat glfw", nullptr, nullptr);
267+
if (!window) {
268+
glfwTerminate();
269+
return 11;
270+
}
271+
272+
glfwMakeContextCurrent(window);
273+
glfwDestroyWindow(window);
274+
glfwTerminate();
275+
return 0;
276+
}
277+
255278
int main() {
279+
if (std::getenv("MCPP_INDEX_RUN_GLFW_WINDOW_SMOKE")) {
280+
return run_glfw_window_smoke();
281+
}
282+
256283
const char* glfw = glfwGetVersionString();
257284
const char* imgui = ImGui::GetVersion();
258285
return glfw && imgui &&

0 commit comments

Comments
 (0)