Compare commits

..

19 Commits

Author SHA1 Message Date
Shylie
96944fcaa9 Upload to same artifact 2024-05-28 13:40:59 -04:00
Shylie
fc4c150965 Use v3 artifact 2024-05-28 13:26:55 -04:00
Shylie
526924d02a Upload test images as artifacts 2024-05-28 13:23:49 -04:00
Shylie
be6a31043a Test testing code (again...) 2024-05-28 13:11:39 -04:00
Shylie
60117c5cf9 Test testing code 2024-05-28 13:06:06 -04:00
Shylie
3d635b67f5 Move back to xvfb-run 2024-05-28 13:04:38 -04:00
Shylie
09d5acc983 change to correct directory 2024-05-28 13:03:17 -04:00
Shylie
c168e795a4 Fix filepath 2024-05-28 12:58:55 -04:00
Shylie
1261ae71db Don't use xvfb-run 2024-05-28 12:57:37 -04:00
Shylie
5997c95f0d Read variable instead of run command 2024-05-28 12:45:38 -04:00
Shylie
e5edcd05b2 Another attempt at fixing xvfb-run issue 2024-05-28 12:44:00 -04:00
Shylie
8fb977a4a1 Change XDG dir 2024-05-28 12:40:48 -04:00
Shylie
4c03524fc5 Export XDG runtime dir 2024-05-28 12:15:56 -04:00
Shylie
e67bb9c017 Add auto flag to xvfb-run command 2024-05-28 11:26:16 -04:00
Shylie
853bec6df9 Build tests too 2024-05-28 11:21:12 -04:00
Shylie
43b77a4ece Add build call 2024-05-28 11:17:43 -04:00
Shylie
c1e9b1d6bd Checkout submodules 2024-05-28 11:16:24 -04:00
Shylie
374677349d Fix syntax errors 2024-05-28 11:15:12 -04:00
Shylie
d285983dea Initial automated testing 2024-05-28 11:13:15 -04:00
3 changed files with 47 additions and 9 deletions

View File

@ -0,0 +1,38 @@
name: Make PNG
run-name: ${{ gitea.actor }} is recording the PNG output.
on: push
jobs:
build-app:
runs-on: linux_amd64
steps:
- name: Checkout current
uses: actions/checkout@v4
with:
path: curr
submodules: recursive
- name: Checkout previous
uses: actions/checkout@v4
with:
path: prev
fetch-depth: 2
submodules: recursive
- run: cd prev && git checkout HEAD^
- name: Build current
run: cmake -S curr -B curr/build -DGLERMINAL_TEST=ON && cmake --build curr/build
- name: Build previous
run: cmake -S prev -B prev/build -DGLERMINAL_TEST=ON && cmake --build prev/build
- name: Generate PNG file for current
run: cd curr/build/tests && XDG_RUNTIME_DIR=$PWD xvfb-run -a -s="-screen 0 1280x800x24" ./test-basic
- name: Generate PNG file for previous
run: cd prev/build/tests && XDG_RUNTIME_DIR=$PWD xvfb-run -a -s="-screen 0 1280x800x24" ./test-basic
- name: Upload current PNG
uses: actions/upload-artifact@v3
with:
name: basic
path: |
curr/build/tests/image.png
prev/build/tests/image.png
- name: Compare PNG files
run: diff curr/build/tests/image.png prev/build/tests/image.png

View File

@ -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, "Could not compile vertex shader.");
log(GL_DEBUG_TYPE_ERROR, 0, 0, info_log); 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); 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, "Could not compile geometry shader.");
log(GL_DEBUG_TYPE_ERROR, 1, 0, info_log); 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); 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, "Could not compile fragment shader.");
log(GL_DEBUG_TYPE_ERROR, 2, 0, info_log); log(GL_DEBUG_TYPE_ERROR, 2, 0, info_log);
throw std::runtime_error(""); throw std::runtime_error("Could not compile fragment shader.");
} }
// link // 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, "Could not link shader program.");
log(GL_DEBUG_TYPE_ERROR, 3, 0, info_log); log(GL_DEBUG_TYPE_ERROR, 3, 0, info_log);
throw std::runtime_error(""); throw std::runtime_error("Could not link shader program.");
} }
// setup uniforms // 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, "Could not compile screen vertex shader.");
log(GL_DEBUG_TYPE_ERROR, 4, 0, info_log); 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); 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, "Could not compile screen fragment shader.");
log(GL_DEBUG_TYPE_ERROR, 5, 0, info_log); log(GL_DEBUG_TYPE_ERROR, 5, 0, info_log);
throw std::runtime_error(""); throw std::runtime_error("Could not compile screen fragment shader.");
} }
// link // 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, "Could not link screen shader program.");
log(GL_DEBUG_TYPE_ERROR, 6, 0, info_log); 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 // setup uniforms for screen shader

View File

@ -8,7 +8,7 @@
namespace namespace
{ {
unsigned char pixels[1280 * 800 * 3]; unsigned char pixels[(GRID_WIDTH * CELL_SCALE * 8) * (GRID_HEIGHT * CELL_SCALE * 8) * 3];
} }
void glerminal_test_save_image() void glerminal_test_save_image()
@ -21,5 +21,5 @@ void glerminal_test_save_image()
glGetTexImage(GL_TEXTURE_2D, 0, GL_RGB, GL_UNSIGNED_BYTE, pixels); glGetTexImage(GL_TEXTURE_2D, 0, GL_RGB, GL_UNSIGNED_BYTE, pixels);
stbi_flip_vertically_on_write(true); stbi_flip_vertically_on_write(true);
stbi_write_png("image.png", GRID_WIDTH * CELL_SCALE * 8, GRID_HEIGHT * CELL_SCALE * 8, 3, pixels, 1280 * 3); stbi_write_png("image.png", GRID_WIDTH * CELL_SCALE * 8, GRID_HEIGHT * CELL_SCALE * 8, 3, pixels, GRID_WIDTH * CELL_SCALE * 8 * 3);
} }