meson: break out test/meson.build

Take advantage of nesting meson files in directories to make things more
readable.

e.g. file path literals become shorter.

Tested: tests still build and pass.

Change-Id: I20cca4f35fb326df33a337bdbadb9811b78962a7
Signed-off-by: Alexander Hansen <alexander.hansen@9elements.com>
diff --git a/meson.build b/meson.build
index c5b689f..ef95c8f 100644
--- a/meson.build
+++ b/meson.build
@@ -445,89 +445,4 @@
     install_dir: bindir,
 )
 
-srcfiles_unittest = files(
-    'test/http/crow_getroutes_test.cpp',
-    'test/http/http2_connection_test.cpp',
-    'test/http/http_body_test.cpp',
-    'test/http/http_connection_test.cpp',
-    'test/http/http_response_test.cpp',
-    'test/http/mutual_tls.cpp',
-    'test/http/parsing_test.cpp',
-    'test/http/router_test.cpp',
-    'test/http/server_sent_event_test.cpp',
-    'test/http/utility_test.cpp',
-    'test/http/verb_test.cpp',
-    'test/http/zstd_decompressor_test.cpp',
-    'test/include/async_resolve_test.cpp',
-    'test/include/credential_pipe_test.cpp',
-    'test/include/dbus_utility_test.cpp',
-    'test/include/http_utility_test.cpp',
-    'test/include/human_sort_test.cpp',
-    'test/include/json_html_serializer.cpp',
-    'test/include/multipart_test.cpp',
-    'test/include/ossl_random.cpp',
-    'test/include/sessions_test.cpp',
-    'test/include/ssl_key_handler_test.cpp',
-    'test/include/str_utility_test.cpp',
-    'test/redfish-core/include/dbus_log_watcher_test.cpp',
-    'test/redfish-core/include/event_log_test.cpp',
-    'test/redfish-core/include/event_matches_filter_test.cpp',
-    'test/redfish-core/include/filter_expr_executor_test.cpp',
-    'test/redfish-core/include/filter_expr_parser_test.cpp',
-    'test/redfish-core/include/privileges_test.cpp',
-    'test/redfish-core/include/redfish_aggregator_test.cpp',
-    'test/redfish-core/include/redfish_oem_routing_test.cpp',
-    'test/redfish-core/include/redfish_test.cpp',
-    'test/redfish-core/include/registries_test.cpp',
-    'test/redfish-core/include/submit_test_event_test.cpp',
-    'test/redfish-core/include/utils/dbus_utils.cpp',
-    'test/redfish-core/include/utils/error_code_test.cpp',
-    'test/redfish-core/include/utils/hex_utils_test.cpp',
-    'test/redfish-core/include/utils/ip_utils_test.cpp',
-    'test/redfish-core/include/utils/json_utils_test.cpp',
-    'test/redfish-core/include/utils/query_param_test.cpp',
-    'test/redfish-core/include/utils/sensor_utils_test.cpp',
-    'test/redfish-core/include/utils/stl_utils_test.cpp',
-    'test/redfish-core/include/utils/time_utils_test.cpp',
-    'test/redfish-core/lib/chassis_test.cpp',
-    'test/redfish-core/lib/ethernet_test.cpp',
-    'test/redfish-core/lib/log_services_dump_test.cpp',
-    'test/redfish-core/lib/manager_diagnostic_data_test.cpp',
-    'test/redfish-core/lib/metadata_test.cpp',
-    'test/redfish-core/lib/power_subsystem_test.cpp',
-    'test/redfish-core/lib/service_root_test.cpp',
-    'test/redfish-core/lib/system_test.cpp',
-    'test/redfish-core/lib/systems_logservices_postcode.cpp',
-    'test/redfish-core/lib/thermal_subsystem_test.cpp',
-    'test/redfish-core/lib/update_service_test.cpp',
-) + test_sources
-
-if (get_option('tests').allowed())
-    gtest = dependency(
-        'gtest_main',
-        main: true,
-        version: '>=1.15.0',
-        required: true,
-    )
-    gmock = dependency('gmock', required: true)
-    gtestlib = static_library('gtestlib', dependencies: [gtest, gmock])
-    gtestdep = declare_dependency(
-        link_with: gtestlib,
-        dependencies: [
-            gtest.partial_dependency(includes: true),
-            gmock.partial_dependency(includes: true),
-        ],
-    )
-    # generate the test executable
-    foreach test_src : srcfiles_unittest
-        test_bin = executable(
-            fs.stem(test_src),
-            test_src,
-            link_with: bmcweblib,
-            include_directories: incdir,
-            install_dir: bindir,
-            dependencies: bmcweb_dependencies + [gtestdep],
-        )
-        test(fs.stem(test_src), test_bin, protocol: 'gtest')
-    endforeach
-endif
+subdir('test')