meson: separate meson.build for tests
Separate build file reduces indentation and makes things more readable.
Tested: Unit Tests Pass
```
Running all tests
1/4 test_systemd_parser OK 0.03s
2/4 test_systemd_signal OK 0.02s
3/4 test_scheduled_host_transition OK 0.01s
4/4 test_hypervisor_state OK 0.01s
Ok: 4
Fail: 0
```
Change-Id: I369d00698eddad28834aeebc5455fe9387019f9d
Signed-off-by: Alexander Hansen <alexander.hansen@9elements.com>
diff --git a/meson.build b/meson.build
index 65dc445..77c44b8 100644
--- a/meson.build
+++ b/meson.build
@@ -312,68 +312,5 @@
endif
endif
- test(
- 'test_systemd_parser',
- executable(
- 'test_systemd_parser',
- './test/systemd_parser.cpp',
- 'systemd_target_parser.cpp',
- dependencies: [gtest, nlohmann_json_dep],
- implicit_include_directories: true,
- include_directories: '../',
- ),
- )
-
- test(
- 'test_systemd_signal',
- executable(
- 'test_systemd_signal',
- './test/systemd_signal.cpp',
- 'systemd_target_signal.cpp',
- 'utils.cpp',
- dependencies: [
- gtest,
- libgpiod,
- nlohmann_json_dep,
- phosphorlogging,
- sdbusplus,
- sdeventplus,
- ],
- implicit_include_directories: true,
- include_directories: '../',
- ),
- )
-
- test(
- 'test_scheduled_host_transition',
- executable(
- 'test_scheduled_host_transition',
- './test/test_scheduled_host_transition.cpp',
- 'scheduled_host_transition.cpp',
- 'utils.cpp',
- dependencies: [
- cereal,
- gmock,
- gtest,
- libgpiod,
- phosphorlogging,
- sdbusplus,
- sdeventplus,
- ],
- implicit_include_directories: true,
- include_directories: '../',
- ),
- )
-
- test(
- 'test_hypervisor_state',
- executable(
- 'test_hypervisor_state',
- './test/hypervisor_state.cpp',
- 'hypervisor_state_manager.cpp',
- dependencies: [gtest, phosphorlogging, sdbusplus, sdeventplus],
- implicit_include_directories: true,
- include_directories: '../',
- ),
- )
+ subdir('test')
endif
diff --git a/test/meson.build b/test/meson.build
new file mode 100644
index 0000000..ef56b48
--- /dev/null
+++ b/test/meson.build
@@ -0,0 +1,65 @@
+
+test(
+ 'test_systemd_parser',
+ executable(
+ 'test_systemd_parser',
+ 'systemd_parser.cpp',
+ '../systemd_target_parser.cpp',
+ dependencies: [gtest, nlohmann_json_dep],
+ implicit_include_directories: true,
+ include_directories: '../',
+ ),
+)
+
+test(
+ 'test_systemd_signal',
+ executable(
+ 'test_systemd_signal',
+ 'systemd_signal.cpp',
+ '../systemd_target_signal.cpp',
+ '../utils.cpp',
+ dependencies: [
+ gtest,
+ libgpiod,
+ nlohmann_json_dep,
+ phosphorlogging,
+ sdbusplus,
+ sdeventplus,
+ ],
+ implicit_include_directories: true,
+ include_directories: '../',
+ ),
+)
+
+test(
+ 'test_scheduled_host_transition',
+ executable(
+ 'test_scheduled_host_transition',
+ 'test_scheduled_host_transition.cpp',
+ '../scheduled_host_transition.cpp',
+ '../utils.cpp',
+ dependencies: [
+ cereal,
+ gmock,
+ gtest,
+ libgpiod,
+ phosphorlogging,
+ sdbusplus,
+ sdeventplus,
+ ],
+ implicit_include_directories: true,
+ include_directories: '../',
+ ),
+)
+
+test(
+ 'test_hypervisor_state',
+ executable(
+ 'test_hypervisor_state',
+ 'hypervisor_state.cpp',
+ '../hypervisor_state_manager.cpp',
+ dependencies: [gtest, phosphorlogging, sdbusplus, sdeventplus],
+ implicit_include_directories: true,
+ include_directories: '../',
+ ),
+)