From 0f8cbb1faf2e4f58fba319b341a8653861156705 Mon Sep 17 00:00:00 2001 From: ISSOtm Date: Sun, 24 Apr 2022 15:25:10 +0200 Subject: [PATCH] Generate all necessary files for RGBGFX tests --- test/gfx/.gitignore | 7 ++++++- test/gfx/rgbgfx_test.cpp | 14 +++++++++----- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/test/gfx/.gitignore b/test/gfx/.gitignore index 8beda033..69d04b64 100644 --- a/test/gfx/.gitignore +++ b/test/gfx/.gitignore @@ -1,5 +1,10 @@ +# Test binaries /randtilegen /rgbgfx_test +# Generated by randtilegen /*.png -/result*.2bpp /*.rng +# Generated by the test program (some PNGs are already covered by the above) +/result.2bpp +/result.pal +/result.attrmap diff --git a/test/gfx/rgbgfx_test.cpp b/test/gfx/rgbgfx_test.cpp index 0cfd6b73..112f98c8 100644 --- a/test/gfx/rgbgfx_test.cpp +++ b/test/gfx/rgbgfx_test.cpp @@ -312,8 +312,10 @@ int main(int argc, char **argv) { { char path[] = "../../rgbgfx", out_opt[] = "-o", out_file[] = "result.2bpp", - in_file[] = "out0.png"; - std::vector args({path, out_opt, out_file, in_file}); + pal_opt[] = "-p", pal_file[] = "result.pal", attr_opt[] = "-a", + attr_file[] = "result.attrmap", in_file[] = "out0.png"; + std::vector args( + {path, out_opt, out_file, pal_opt, pal_file, attr_opt, attr_file, in_file}); // Also copy the trailing `nullptr` std::copy_n(&argv[2], argc - 1, std::back_inserter(args)); @@ -327,10 +329,12 @@ int main(int argc, char **argv) { { char path[] = "../../rgbgfx", reverse_opt[] = "-r", out_opt[] = "-o", - out_file[] = "result.2bpp", in_file[] = "result.png"; + out_file[] = "result.2bpp", pal_opt[] = "-p", pal_file[] = "result.pal", + attr_opt[] = "-a", attr_file[] = "result.attrmap", in_file[] = "result.png"; auto width_string = std::to_string(image0.getWidth()); - std::vector args = {path, reverse_opt, width_string.data(), - out_opt, out_file, in_file}; + std::vector args = { + path, reverse_opt, width_string.data(), out_opt, out_file, pal_opt, + pal_file, attr_opt, attr_file, in_file}; // Also copy the trailing `nullptr` std::copy_n(&argv[2], argc - 1, std::back_inserter(args));