Skip to content

Commit

Permalink
fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
elect86 committed Jun 2, 2020
1 parent a0a874a commit 55fa79c
Showing 1 changed file with 22 additions and 16 deletions.
38 changes: 22 additions & 16 deletions src/test/kotlin/gln/CapsTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,37 @@ import org.lwjgl.system.MemoryUtil.NULL
import java.io.File
import java.nio.file.Files

val isNotCI: Boolean
get() = System.getenv("GITHUB_ACTIONS") != "true" && System.getenv("TRAVIS") != "true"

class CapsTest : StringSpec() {

init {
"caps" {

// Initialize GLFW. Most GLFW functions will not work before doing this.
if ( !glfwInit() )
throw IllegalStateException("Unable to initialize GLFW")
if (isNotCI) {

// Initialize GLFW. Most GLFW functions will not work before doing this.
if (!glfwInit())
throw IllegalStateException("Unable to initialize GLFW")

// Configure GLFW
glfwDefaultWindowHints() // optional, the current window hints are already the default
glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE) // the window will stay hidden after creation
glfwWindowHint(GLFW_RESIZABLE, GLFW_TRUE) // the window will be resizable
// Configure GLFW
glfwDefaultWindowHints() // optional, the current window hints are already the default
glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE) // the window will stay hidden after creation
glfwWindowHint(GLFW_RESIZABLE, GLFW_TRUE) // the window will be resizable

// Create the window
val window = glfwCreateWindow(300, 300, "Hello World!", NULL, NULL)
// Make the OpenGL context current
glfwMakeContextCurrent(window)
// Create the window
val window = glfwCreateWindow(300, 300, "Hello World!", NULL, NULL)
// Make the OpenGL context current
glfwMakeContextCurrent(window)

val caps = Caps()
caps.writeTo("opengl.caps")
val caps = Caps()
caps.writeTo("opengl.caps")

val capsFile = File("opengl.caps")
assert(capsFile.exists() && capsFile.canRead())
assert(capsFile.delete())
val capsFile = File("opengl.caps")
assert(capsFile.exists() && capsFile.canRead())
assert(capsFile.delete())
}
}
}
}

0 comments on commit 55fa79c

Please sign in to comment.