From 58e7abba2c2c7a8d5f3b258b7c79919030cbc70f Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Sat, 8 Jun 2024 22:30:01 -0500 Subject: [PATCH] tests: split into separate binaries --- test/hyprland/meson.build | 6 ---- test/meson.build | 10 +----- test/{ => utils}/JsonParser.cpp | 0 test/{ => utils}/SafeSignal.cpp | 0 test/{ => utils}/css_reload_helper.cpp | 0 test/{ => utils}/date.cpp | 0 .../{ => utils}/fixtures/GlibTestsFixture.hpp | 0 test/utils/meson.build | 36 +++++++++++++++++++ 8 files changed, 37 insertions(+), 15 deletions(-) rename test/{ => utils}/JsonParser.cpp (100%) rename test/{ => utils}/SafeSignal.cpp (100%) rename test/{ => utils}/css_reload_helper.cpp (100%) rename test/{ => utils}/date.cpp (100%) rename test/{ => utils}/fixtures/GlibTestsFixture.hpp (100%) create mode 100644 test/utils/meson.build diff --git a/test/hyprland/meson.build b/test/hyprland/meson.build index 1f8e3a8b..533022fc 100644 --- a/test/hyprland/meson.build +++ b/test/hyprland/meson.build @@ -10,12 +10,6 @@ test_dep = [ test_src = files( '../main.cpp', - '../JsonParser.cpp', - '../SafeSignal.cpp', - '../config.cpp', - '../css_reload_helper.cpp', - '../../src/config.cpp', - '../../src/util/css_reload_helper.cpp', 'backend.cpp', '../../src/modules/hyprland/backend.cpp' ) diff --git a/test/meson.build b/test/meson.build index 2c5f9c76..ea430c50 100644 --- a/test/meson.build +++ b/test/meson.build @@ -10,19 +10,10 @@ test_dep = [ test_src = files( 'main.cpp', - 'JsonParser.cpp', - 'SafeSignal.cpp', 'config.cpp', - 'css_reload_helper.cpp', '../src/config.cpp', - '../src/util/css_reload_helper.cpp', ) -if tz_dep.found() - test_dep += tz_dep - test_src += files('date.cpp') -endif - waybar_test = executable( 'waybar_test', test_src, @@ -36,4 +27,5 @@ test( workdir: meson.project_source_root(), ) +subdir('utils') subdir('hyprland') diff --git a/test/JsonParser.cpp b/test/utils/JsonParser.cpp similarity index 100% rename from test/JsonParser.cpp rename to test/utils/JsonParser.cpp diff --git a/test/SafeSignal.cpp b/test/utils/SafeSignal.cpp similarity index 100% rename from test/SafeSignal.cpp rename to test/utils/SafeSignal.cpp diff --git a/test/css_reload_helper.cpp b/test/utils/css_reload_helper.cpp similarity index 100% rename from test/css_reload_helper.cpp rename to test/utils/css_reload_helper.cpp diff --git a/test/date.cpp b/test/utils/date.cpp similarity index 100% rename from test/date.cpp rename to test/utils/date.cpp diff --git a/test/fixtures/GlibTestsFixture.hpp b/test/utils/fixtures/GlibTestsFixture.hpp similarity index 100% rename from test/fixtures/GlibTestsFixture.hpp rename to test/utils/fixtures/GlibTestsFixture.hpp diff --git a/test/utils/meson.build b/test/utils/meson.build new file mode 100644 index 00000000..b7b3665a --- /dev/null +++ b/test/utils/meson.build @@ -0,0 +1,36 @@ +test_inc = include_directories('../../include') + +test_dep = [ + catch2, + fmt, + gtkmm, + jsoncpp, + spdlog, +] +test_src = files( + '../main.cpp', + '../config.cpp', + '../../src/config.cpp', + 'JsonParser.cpp', + 'SafeSignal.cpp', + 'css_reload_helper.cpp', + '../../src/util/css_reload_helper.cpp', +) + +if tz_dep.found() + test_dep += tz_dep + test_src += files('date.cpp') +endif + +utils_test = executable( + 'utils_test', + test_src, + dependencies: test_dep, + include_directories: test_inc, +) + +test( + 'utils', + utils_test, + workdir: meson.project_source_root(), +)