diff options
| author | Ed Tanous <etanous@nvidia.com> | 2024-09-24 00:51:55 +0300 |
|---|---|---|
| committer | Ed Tanous <ed@tanous.net> | 2025-06-27 23:20:39 +0300 |
| commit | 3b28fa2b201513be89807dfb76b47b3ca7ee3f9b (patch) | |
| tree | 2233d014600a7c6b0ff597fc24bd7a28111a289c | |
| parent | 8f1a35b9f9046b4c84a5002d0a16b93624a76f22 (diff) | |
| download | bmcweb-3b28fa2b201513be89807dfb76b47b3ca7ee3f9b.tar.xz | |
Rearrange features
The backends are different things compared to generic code. Today,
these are all included in the /include folder, but it's not very clear
what options control which backends, or how things map together. This
also means that we can't separate ownership between the various
companies.
This commit is a proposal to try to create a features folder,
separated by the code for the various backends, to make interacting
with this easier. It takes the form
features/<option name>/files.hpp
features/<option name>/files_test.hpp
Note, redfish-core was already at top level, and contains lots of code,
so to prevent lots of conflicts, it's simply symlinked into that folder
to make clear that it is a backend, but not to move the implementation
and cause code conflicts.
Tested: Unit tests pass. Code compiles.
Change-Id: Idcc80ffcfd99c876734ee41d53f894ca5583fed5
Signed-off-by: Ed Tanous <etanous@nvidia.com>
| -rw-r--r-- | features/google/google_service_root.hpp (renamed from include/google/google_service_root.hpp) | 0 | ||||
| -rw-r--r-- | features/google/google_service_root_test.cpp (renamed from test/include/google/google_service_root_test.cpp) | 2 | ||||
| -rw-r--r-- | features/google/meson.build | 2 | ||||
| -rw-r--r-- | features/ibm/configfile_test.cpp (renamed from test/include/ibm/configfile_test.cpp) | 2 | ||||
| -rw-r--r-- | features/ibm/ibm_management_console_rest.hpp (renamed from include/ibm/management_console_rest.hpp) | 2 | ||||
| -rw-r--r-- | features/ibm/meson.build | 2 | ||||
| -rw-r--r-- | features/ibm/utils.hpp (renamed from include/ibm/utils.hpp) | 0 | ||||
| -rw-r--r-- | features/kvm/kvm_websocket.hpp (renamed from include/kvm_websocket.hpp) | 0 | ||||
| -rw-r--r-- | features/kvm/meson.build | 1 | ||||
| -rw-r--r-- | features/meson.build | 7 | ||||
| -rw-r--r-- | features/openbmc_rest/dbus_monitor.hpp (renamed from include/dbus_monitor.hpp) | 0 | ||||
| -rw-r--r-- | features/openbmc_rest/image_upload.hpp (renamed from include/image_upload.hpp) | 0 | ||||
| -rw-r--r-- | features/openbmc_rest/meson.build | 2 | ||||
| -rw-r--r-- | features/openbmc_rest/openbmc_dbus_rest.hpp (renamed from include/openbmc_dbus_rest.hpp) | 0 | ||||
| -rw-r--r-- | features/openbmc_rest/openbmc_dbus_rest_test.cpp (renamed from test/include/openbmc_dbus_rest_test.cpp) | 0 | ||||
| l--------- | features/redfish | 1 | ||||
| -rw-r--r-- | features/serial/meson.build | 1 | ||||
| -rw-r--r-- | features/serial/obmc_console.hpp (renamed from include/obmc_console.hpp) | 0 | ||||
| -rw-r--r-- | features/virtual_media/meson.build | 1 | ||||
| -rw-r--r-- | features/virtual_media/vm_websocket.hpp (renamed from include/vm_websocket.hpp) | 0 | ||||
| -rw-r--r-- | features/webui_login/login_routes.hpp (renamed from include/login_routes.hpp) | 0 | ||||
| -rw-r--r-- | features/webui_login/meson.build | 1 | ||||
| -rw-r--r-- | meson.build | 22 | ||||
| -rw-r--r-- | src/webserver_run.cpp | 4 |
24 files changed, 35 insertions, 15 deletions
diff --git a/include/google/google_service_root.hpp b/features/google/google_service_root.hpp index 3d21af7b73..3d21af7b73 100644 --- a/include/google/google_service_root.hpp +++ b/features/google/google_service_root.hpp diff --git a/test/include/google/google_service_root_test.cpp b/features/google/google_service_root_test.cpp index 77c194dbde..c104494f01 100644 --- a/test/include/google/google_service_root_test.cpp +++ b/features/google/google_service_root_test.cpp @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-FileCopyrightText: Copyright OpenBMC Authors #include "async_resp.hpp" -#include "google/google_service_root.hpp" +#include "google_service_root.hpp" #include "http_request.hpp" #include "http_response.hpp" diff --git a/features/google/meson.build b/features/google/meson.build new file mode 100644 index 0000000000..5df3400767 --- /dev/null +++ b/features/google/meson.build @@ -0,0 +1,2 @@ +incdir += include_directories('.') +test_sources += files('google_service_root_test.cpp') diff --git a/test/include/ibm/configfile_test.cpp b/features/ibm/configfile_test.cpp index 490e0954ee..b64a2d3fc1 100644 --- a/test/include/ibm/configfile_test.cpp +++ b/features/ibm/configfile_test.cpp @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-FileCopyrightText: Copyright OpenBMC Authors #include "http_response.hpp" -#include "ibm/management_console_rest.hpp" +#include "ibm_management_console_rest.hpp" #include <string> diff --git a/include/ibm/management_console_rest.hpp b/features/ibm/ibm_management_console_rest.hpp index 0b14575e14..764e50448a 100644 --- a/include/ibm/management_console_rest.hpp +++ b/features/ibm/ibm_management_console_rest.hpp @@ -5,9 +5,9 @@ #include "app.hpp" #include "async_resp.hpp" #include "http_request.hpp" -#include "ibm/utils.hpp" #include "logging.hpp" #include "str_utility.hpp" +#include "utils.hpp" #include "utils/json_utils.hpp" #include <boost/beast/core/string_type.hpp> diff --git a/features/ibm/meson.build b/features/ibm/meson.build new file mode 100644 index 0000000000..c73258f1c0 --- /dev/null +++ b/features/ibm/meson.build @@ -0,0 +1,2 @@ +incdir += include_directories('.') +test_sources += files('configfile_test.cpp') diff --git a/include/ibm/utils.hpp b/features/ibm/utils.hpp index fe99f8ea28..fe99f8ea28 100644 --- a/include/ibm/utils.hpp +++ b/features/ibm/utils.hpp diff --git a/include/kvm_websocket.hpp b/features/kvm/kvm_websocket.hpp index adf4c5e02d..adf4c5e02d 100644 --- a/include/kvm_websocket.hpp +++ b/features/kvm/kvm_websocket.hpp diff --git a/features/kvm/meson.build b/features/kvm/meson.build new file mode 100644 index 0000000000..ab60765e27 --- /dev/null +++ b/features/kvm/meson.build @@ -0,0 +1 @@ +incdir += include_directories('.') diff --git a/features/meson.build b/features/meson.build new file mode 100644 index 0000000000..ff01c88574 --- /dev/null +++ b/features/meson.build @@ -0,0 +1,7 @@ +subdir('google') +subdir('ibm') +subdir('kvm') +subdir('openbmc_rest') +subdir('serial') +subdir('virtual_media') +subdir('webui_login') diff --git a/include/dbus_monitor.hpp b/features/openbmc_rest/dbus_monitor.hpp index 050bd3421e..050bd3421e 100644 --- a/include/dbus_monitor.hpp +++ b/features/openbmc_rest/dbus_monitor.hpp diff --git a/include/image_upload.hpp b/features/openbmc_rest/image_upload.hpp index f6a0dfc49e..f6a0dfc49e 100644 --- a/include/image_upload.hpp +++ b/features/openbmc_rest/image_upload.hpp diff --git a/features/openbmc_rest/meson.build b/features/openbmc_rest/meson.build new file mode 100644 index 0000000000..cfceb7978b --- /dev/null +++ b/features/openbmc_rest/meson.build @@ -0,0 +1,2 @@ +incdir += include_directories('.') +test_sources += files('openbmc_dbus_rest_test.cpp') diff --git a/include/openbmc_dbus_rest.hpp b/features/openbmc_rest/openbmc_dbus_rest.hpp index d2bd48f8d7..d2bd48f8d7 100644 --- a/include/openbmc_dbus_rest.hpp +++ b/features/openbmc_rest/openbmc_dbus_rest.hpp diff --git a/test/include/openbmc_dbus_rest_test.cpp b/features/openbmc_rest/openbmc_dbus_rest_test.cpp index 1bc320e7d2..1bc320e7d2 100644 --- a/test/include/openbmc_dbus_rest_test.cpp +++ b/features/openbmc_rest/openbmc_dbus_rest_test.cpp diff --git a/features/redfish b/features/redfish new file mode 120000 index 0000000000..635be9a32a --- /dev/null +++ b/features/redfish @@ -0,0 +1 @@ +../redfish-core
\ No newline at end of file diff --git a/features/serial/meson.build b/features/serial/meson.build new file mode 100644 index 0000000000..ab60765e27 --- /dev/null +++ b/features/serial/meson.build @@ -0,0 +1 @@ +incdir += include_directories('.') diff --git a/include/obmc_console.hpp b/features/serial/obmc_console.hpp index 40b72fe912..40b72fe912 100644 --- a/include/obmc_console.hpp +++ b/features/serial/obmc_console.hpp diff --git a/features/virtual_media/meson.build b/features/virtual_media/meson.build new file mode 100644 index 0000000000..ab60765e27 --- /dev/null +++ b/features/virtual_media/meson.build @@ -0,0 +1 @@ +incdir += include_directories('.') diff --git a/include/vm_websocket.hpp b/features/virtual_media/vm_websocket.hpp index b930b64094..b930b64094 100644 --- a/include/vm_websocket.hpp +++ b/features/virtual_media/vm_websocket.hpp diff --git a/include/login_routes.hpp b/features/webui_login/login_routes.hpp index 4b4a6213bf..4b4a6213bf 100644 --- a/include/login_routes.hpp +++ b/features/webui_login/login_routes.hpp diff --git a/features/webui_login/meson.build b/features/webui_login/meson.build new file mode 100644 index 0000000000..ab60765e27 --- /dev/null +++ b/features/webui_login/meson.build @@ -0,0 +1 @@ +incdir += include_directories('.') diff --git a/meson.build b/meson.build index d24437d5f8..e92821f531 100644 --- a/meson.build +++ b/meson.build @@ -57,13 +57,15 @@ if (get_option('optimization') == '0') endif # Include Directories +incdir = [ + include_directories( + 'include', + 'redfish-core/include', + 'redfish-core/lib', + 'http', + ), +] -incdir = include_directories( - 'include', - 'redfish-core/include', - 'redfish-core/lib', - 'http', -) incdir_cli = include_directories('http', 'include') # Add compiler arguments @@ -371,6 +373,9 @@ subdir('config') bmcweb_dependencies += conf_h_dep bmcweb_cli_dependencies += conf_h_dep +test_sources = [] +subdir('features') + # Source files fs = import('fs') @@ -449,13 +454,10 @@ srcfiles_unittest = files( 'test/include/async_resolve_test.cpp', 'test/include/credential_pipe_test.cpp', 'test/include/dbus_utility_test.cpp', - 'test/include/google/google_service_root_test.cpp', 'test/include/http_utility_test.cpp', 'test/include/human_sort_test.cpp', - 'test/include/ibm/configfile_test.cpp', 'test/include/json_html_serializer.cpp', 'test/include/multipart_test.cpp', - 'test/include/openbmc_dbus_rest_test.cpp', 'test/include/ossl_random.cpp', 'test/include/sessions_test.cpp', 'test/include/ssl_key_handler_test.cpp', @@ -491,7 +493,7 @@ srcfiles_unittest = files( '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( diff --git a/src/webserver_run.cpp b/src/webserver_run.cpp index aebe43cae4..feda8ad490 100644 --- a/src/webserver_run.cpp +++ b/src/webserver_run.cpp @@ -8,9 +8,9 @@ #include "dbus_monitor.hpp" #include "dbus_singleton.hpp" #include "event_service_manager.hpp" -#include "google/google_service_root.hpp" +#include "google_service_root.hpp" #include "hostname_monitor.hpp" -#include "ibm/management_console_rest.hpp" +#include "ibm_management_console_rest.hpp" #include "image_upload.hpp" #include "io_context_singleton.hpp" #include "kvm_websocket.hpp" |
