From d285983dea0835652d461f2279e076ed86daaf3e Mon Sep 17 00:00:00 2001 From: Shylie Date: Tue, 28 May 2024 11:13:15 -0400 Subject: [PATCH] Initial automated testing --- .gitea/workflows/make_png.yaml | 27 +++++++++++++++++++++++++++ source/glerminal.cpp | 14 +++++++------- 2 files changed, 34 insertions(+), 7 deletions(-) create mode 100644 .gitea/workflows/make_png.yaml diff --git a/.gitea/workflows/make_png.yaml b/.gitea/workflows/make_png.yaml new file mode 100644 index 0000000..b55a6e7 --- /dev/null +++ b/.gitea/workflows/make_png.yaml @@ -0,0 +1,27 @@ +name: Make PNG +run-name: ${{ gitea.actor }} is recording the PNG output. + +on: push + +jobs: + build-app: + runs-on: linux_amd64 + steps: + - name: Checkout curr + uses: actions/checkout@v4 + with: + path: curr + - name: Checkout prev + uses: actions/checkout@v4 + with: + path: prev + fetch-depth: 2 + - run: cd prev && git checkout HEAD^ + - name: Configure CMake + run: cmake -S curr -B curr/build + run: cmake -S prev -B prev/build + - name: Generate PNG files + run: cd curr/build/tests && xvfb-run ./test-basic + run: cd prev/build/tests && xvfb-run ./test-basic + - name: Compare PNG files + run: diff curr/build/tests/image.png prev/build/tests/image.png diff --git a/source/glerminal.cpp b/source/glerminal.cpp index aa79960..1f44bc3 100644 --- a/source/glerminal.cpp +++ b/source/glerminal.cpp @@ -529,7 +529,7 @@ namespace glerminal log(GL_DEBUG_TYPE_ERROR, 0, 0, "Could not compile vertex shader."); log(GL_DEBUG_TYPE_ERROR, 0, 0, info_log); - throw std::runtime_error(""); + throw std::runtime_error("Could not compile vertex shader."); } glGetShaderiv(geometry_shader, GL_COMPILE_STATUS, &success); @@ -543,7 +543,7 @@ namespace glerminal log(GL_DEBUG_TYPE_ERROR, 1, 0, "Could not compile geometry shader."); log(GL_DEBUG_TYPE_ERROR, 1, 0, info_log); - throw std::runtime_error(""); + throw std::runtime_error("Could not compile geometry shader."); } glGetShaderiv(fragment_shader, GL_COMPILE_STATUS, &success); @@ -557,7 +557,7 @@ namespace glerminal log(GL_DEBUG_TYPE_ERROR, 2, 0, "Could not compile fragment shader."); log(GL_DEBUG_TYPE_ERROR, 2, 0, info_log); - throw std::runtime_error(""); + throw std::runtime_error("Could not compile fragment shader."); } // link @@ -584,7 +584,7 @@ namespace glerminal log(GL_DEBUG_TYPE_ERROR, 3, 0, "Could not link shader program."); log(GL_DEBUG_TYPE_ERROR, 3, 0, info_log); - throw std::runtime_error(""); + throw std::runtime_error("Could not link shader program."); } // setup uniforms @@ -613,7 +613,7 @@ namespace glerminal log(GL_DEBUG_TYPE_ERROR, 4, 0, "Could not compile screen vertex shader."); log(GL_DEBUG_TYPE_ERROR, 4, 0, info_log); - throw std::runtime_error(""); + throw std::runtime_error("Could not compile screen vertex shader."); } glGetShaderiv(screen_fragment_shader, GL_COMPILE_STATUS, &success); @@ -626,7 +626,7 @@ namespace glerminal log(GL_DEBUG_TYPE_ERROR, 5, 0, "Could not compile screen fragment shader."); log(GL_DEBUG_TYPE_ERROR, 5, 0, info_log); - throw std::runtime_error(""); + throw std::runtime_error("Could not compile screen fragment shader."); } // link @@ -645,7 +645,7 @@ namespace glerminal log(GL_DEBUG_TYPE_ERROR, 6, 0, "Could not link screen shader program."); log(GL_DEBUG_TYPE_ERROR, 6, 0, info_log); - throw std::runtime_error(""); + throw std::runtime_error("Could not link screen shader program."); } // setup uniforms for screen shader