From eacc362c9cb1dcae8b8eeb7c31e199cf9a7e1535 Mon Sep 17 00:00:00 2001 From: Moritz Martinius Date: Sun, 19 Oct 2025 13:27:16 +0200 Subject: [PATCH] Remove the test binary split --- tests/meson.build | 74 +++++++++++++++++------------------------------ 1 file changed, 26 insertions(+), 48 deletions(-) diff --git a/tests/meson.build b/tests/meson.build index 71e0ce7..5bffb57 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -1,51 +1,29 @@ -tests = [ - [ - 'bitmap_test', - 'bitmap_test_exe', - ['../src/graphics/Bitmap.cpp', 'bitmap_test/bitmap_test.cpp'], - ], - [ - 'monochrome_test', - 'monochrome_test_exe', - [ - '../src/graphics/Monochrome.cpp', - 'monochrome_test/monochrome_test.cpp', - ], - ], +# Consolidated test binary - all tests in one executable for faster linking + +test_sources = [ + # Test files + 'bitmap_test/bitmap_test.cpp', + 'monochrome_test/monochrome_test.cpp', + 'label_test/label_test.cpp', + + # Source files under test + '../src/graphics/Bitmap.cpp', + '../src/graphics/Monochrome.cpp', + '../src/graphics/Label.cpp', ] -foreach test : tests - test( - test.get(0), - executable( - test.get(1), - sources: test.get(2), - include_directories: incdir, - dependencies: [ - gtest_dep, - usb_dep, - log_dep, - pangocairo_dep, - cli11_dep, - ], - ), - ) -endforeach +test_exe = executable( + 'ptprnt_tests', + sources: test_sources, + include_directories: incdir, + dependencies: [ + gmock_dep, # GMock includes GTest + usb_dep, + log_dep, + pangocairo_dep, + cli11_dep, + ], +) -# Label test requires GMock for mocking Cairo/Pango -test( - 'label_test', - executable( - 'label_test_exe', - sources: ['../src/graphics/Label.cpp', 'label_test/label_test.cpp'], - include_directories: incdir, - dependencies: [ - gmock_dep, - gtest_dep, - usb_dep, - log_dep, - pangocairo_dep, - cli11_dep, - ], - ), -) \ No newline at end of file +# Single test that runs all test suites +test('all_tests', test_exe)