diff options
author | Nan Zhou <nanzhoumails@gmail.com> | 2022-09-10 21:11:41 +0300 |
---|---|---|
committer | Nan Zhou <nanzhoumails@gmail.com> | 2022-09-22 02:44:37 +0300 |
commit | c33a039b56fc5789ae71289adaca1e572a48d318 (patch) | |
tree | 8b936ca291537cebebf6bf505e565bff9635f511 | |
parent | 6ab9ad5492b9203c7dd8fb3e8c59d37bbc455cde (diff) | |
download | bmcweb-c33a039b56fc5789ae71289adaca1e572a48d318.tar.xz |
treewide: reorganize unit tests
Like other C++ projects, unit tests normally are in a separate repo and
respect the folder structure of the file under test.
This commit deleted all "ut" folder and move tests to a "test" folder.
The test folder also has similar structure as the main folder.
This commit also made neccessary include changes to make codes compile.
Unused tests are untouched.
Tested: unit test passed.
Reference:
[1] https://github.com/grpc/grpc/tree/master/test
[2] https://github.com/boostorg/core/tree/414dfb466878af427d33b36e6ccf84d21c0e081b/test
[3] Many other OpenBMC repos: https://github.com/openbmc/entity-manager/tree/master/test
[4] https://stackoverflow.com/questions/2360734/whats-a-good-directory-structure-for-larger-c-projects-using-makefile
Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Change-Id: I4521c7ef5fa03c47cca5c146d322bbb51365ee96
-rw-r--r-- | meson.build | 46 | ||||
-rw-r--r-- | test/http/crow_getroutes_test.cpp (renamed from src/crow_getroutes_test.cpp) | 0 | ||||
-rw-r--r-- | test/http/router_test.cpp (renamed from http/ut/router_test.cpp) | 0 | ||||
-rw-r--r-- | test/http/utility_test.cpp (renamed from http/ut/utility_test.cpp) | 0 | ||||
-rw-r--r-- | test/include/dbus_utility_test.cpp (renamed from include/ut/dbus_utility_test.cpp) | 0 | ||||
-rw-r--r-- | test/include/google/google_service_root_test.cpp (renamed from include/google/google_service_root_test.cpp) | 2 | ||||
-rw-r--r-- | test/include/http_utility_test.cpp (renamed from include/ut/http_utility_test.cpp) | 0 | ||||
-rw-r--r-- | test/include/human_sort_test.cpp (renamed from include/ut/human_sort_test.cpp) | 0 | ||||
-rw-r--r-- | test/include/ibm/configfile_test.cpp (renamed from redfish-core/ut/configfile_test.cpp) | 0 | ||||
-rw-r--r-- | test/include/ibm/lock_test.cpp (renamed from redfish-core/ut/lock_test.cpp) | 0 | ||||
-rw-r--r-- | test/include/multipart_test.cpp (renamed from include/ut/multipart_test.cpp) | 0 | ||||
-rw-r--r-- | test/include/openbmc_dbus_rest_test.cpp (renamed from include/ut/openbmc_dbus_rest_test.cpp) | 0 | ||||
-rw-r--r-- | test/redfish-core/include/privileges_test.cpp (renamed from redfish-core/ut/privileges_test.cpp) | 0 | ||||
-rw-r--r-- | test/redfish-core/include/registries_test.cpp (renamed from redfish-core/ut/registries_test.cpp) | 0 | ||||
-rw-r--r-- | test/redfish-core/include/utils/hex_utils_test.cpp (renamed from redfish-core/ut/hex_utils_test.cpp) | 0 | ||||
-rw-r--r-- | test/redfish-core/include/utils/ip_utils_test.cpp (renamed from redfish-core/ut/ip_utils_test.cpp) | 0 | ||||
-rw-r--r-- | test/redfish-core/include/utils/json_utils_test.cpp (renamed from redfish-core/ut/json_utils_test.cpp) | 0 | ||||
-rw-r--r-- | test/redfish-core/include/utils/query_param_test.cpp (renamed from redfish-core/include/utils/query_param_test.cpp) | 2 | ||||
-rw-r--r-- | test/redfish-core/include/utils/stl_utils_test.cpp (renamed from redfish-core/ut/stl_utils_test.cpp) | 0 | ||||
-rw-r--r-- | test/redfish-core/include/utils/time_utils_test.cpp (renamed from redfish-core/ut/time_utils_test.cpp) | 0 | ||||
-rw-r--r-- | test/redfish-core/lib/chassis_test.cpp (renamed from redfish-core/lib/chassis_test.cpp) | 0 | ||||
-rw-r--r-- | test/redfish-core/lib/log_services_dump_test.cpp (renamed from redfish-core/lib/ut/log_services_dump_test.cpp) | 0 | ||||
-rw-r--r-- | test/redfish-core/lib/service_root_test.cpp (renamed from redfish-core/lib/ut/service_root_test.cpp) | 0 | ||||
-rw-r--r-- | test/redfish-core/lib/thermal_subsystem_test.cpp (renamed from redfish-core/lib/ut/thermal_subsystem_test.cpp) | 0 |
24 files changed, 25 insertions, 25 deletions
diff --git a/meson.build b/meson.build index b3425beb85..7e58791aa2 100644 --- a/meson.build +++ b/meson.build @@ -391,29 +391,29 @@ executable( ) srcfiles_unittest = [ - 'http/ut/utility_test.cpp', - 'http/ut/router_test.cpp', - 'include/google/google_service_root_test.cpp', - 'include/ut/dbus_utility_test.cpp', - 'include/ut/http_utility_test.cpp', - 'include/ut/human_sort_test.cpp', - 'include/ut/multipart_test.cpp', - 'include/ut/openbmc_dbus_rest_test.cpp', - 'redfish-core/include/utils/query_param_test.cpp', - 'redfish-core/lib/ut/log_services_dump_test.cpp', - 'redfish-core/lib/ut/service_root_test.cpp', - 'redfish-core/lib/ut/thermal_subsystem_test.cpp', - 'redfish-core/lib/chassis_test.cpp', - 'redfish-core/ut/configfile_test.cpp', - 'redfish-core/ut/hex_utils_test.cpp', - 'redfish-core/ut/ip_utils_test.cpp', - 'redfish-core/ut/json_utils_test.cpp', - 'redfish-core/ut/lock_test.cpp', - 'redfish-core/ut/privileges_test.cpp', - 'redfish-core/ut/registries_test.cpp', - 'redfish-core/ut/stl_utils_test.cpp', - 'redfish-core/ut/time_utils_test.cpp', - 'src/crow_getroutes_test.cpp', + 'test/http/crow_getroutes_test.cpp', + 'test/http/router_test.cpp', + 'test/http/utility_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/ibm/lock_test.cpp', + 'test/include/multipart_test.cpp', + 'test/include/openbmc_dbus_rest_test.cpp', + 'test/redfish-core/include/privileges_test.cpp', + 'test/redfish-core/include/registries_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/stl_utils_test.cpp', + 'test/redfish-core/include/utils/time_utils_test.cpp', + 'test/redfish-core/lib/chassis_test.cpp', + 'test/redfish-core/lib/log_services_dump_test.cpp', + 'test/redfish-core/lib/service_root_test.cpp', + 'test/redfish-core/lib/thermal_subsystem_test.cpp', ] if(get_option('tests').enabled()) diff --git a/src/crow_getroutes_test.cpp b/test/http/crow_getroutes_test.cpp index 23a511e735..23a511e735 100644 --- a/src/crow_getroutes_test.cpp +++ b/test/http/crow_getroutes_test.cpp diff --git a/http/ut/router_test.cpp b/test/http/router_test.cpp index 9b5d9bec98..9b5d9bec98 100644 --- a/http/ut/router_test.cpp +++ b/test/http/router_test.cpp diff --git a/http/ut/utility_test.cpp b/test/http/utility_test.cpp index 8eef93f4a3..8eef93f4a3 100644 --- a/http/ut/utility_test.cpp +++ b/test/http/utility_test.cpp diff --git a/include/ut/dbus_utility_test.cpp b/test/include/dbus_utility_test.cpp index 71978d01ba..71978d01ba 100644 --- a/include/ut/dbus_utility_test.cpp +++ b/test/include/dbus_utility_test.cpp diff --git a/include/google/google_service_root_test.cpp b/test/include/google/google_service_root_test.cpp index f979a42275..32d4e526fb 100644 --- a/include/google/google_service_root_test.cpp +++ b/test/include/google/google_service_root_test.cpp @@ -1,5 +1,5 @@ #include "async_resp.hpp" -#include "google_service_root.hpp" +#include "google/google_service_root.hpp" #include "http_request.hpp" #include "nlohmann/json.hpp" diff --git a/include/ut/http_utility_test.cpp b/test/include/http_utility_test.cpp index d1df6d1087..d1df6d1087 100644 --- a/include/ut/http_utility_test.cpp +++ b/test/include/http_utility_test.cpp diff --git a/include/ut/human_sort_test.cpp b/test/include/human_sort_test.cpp index be21a198b0..be21a198b0 100644 --- a/include/ut/human_sort_test.cpp +++ b/test/include/human_sort_test.cpp diff --git a/redfish-core/ut/configfile_test.cpp b/test/include/ibm/configfile_test.cpp index 1d95a79066..1d95a79066 100644 --- a/redfish-core/ut/configfile_test.cpp +++ b/test/include/ibm/configfile_test.cpp diff --git a/redfish-core/ut/lock_test.cpp b/test/include/ibm/lock_test.cpp index 33c5354f64..33c5354f64 100644 --- a/redfish-core/ut/lock_test.cpp +++ b/test/include/ibm/lock_test.cpp diff --git a/include/ut/multipart_test.cpp b/test/include/multipart_test.cpp index 7ad7d98f89..7ad7d98f89 100644 --- a/include/ut/multipart_test.cpp +++ b/test/include/multipart_test.cpp diff --git a/include/ut/openbmc_dbus_rest_test.cpp b/test/include/openbmc_dbus_rest_test.cpp index b01e92a505..b01e92a505 100644 --- a/include/ut/openbmc_dbus_rest_test.cpp +++ b/test/include/openbmc_dbus_rest_test.cpp diff --git a/redfish-core/ut/privileges_test.cpp b/test/redfish-core/include/privileges_test.cpp index 2d0da021eb..2d0da021eb 100644 --- a/redfish-core/ut/privileges_test.cpp +++ b/test/redfish-core/include/privileges_test.cpp diff --git a/redfish-core/ut/registries_test.cpp b/test/redfish-core/include/registries_test.cpp index 95a093e54d..95a093e54d 100644 --- a/redfish-core/ut/registries_test.cpp +++ b/test/redfish-core/include/registries_test.cpp diff --git a/redfish-core/ut/hex_utils_test.cpp b/test/redfish-core/include/utils/hex_utils_test.cpp index 8fd4638d09..8fd4638d09 100644 --- a/redfish-core/ut/hex_utils_test.cpp +++ b/test/redfish-core/include/utils/hex_utils_test.cpp diff --git a/redfish-core/ut/ip_utils_test.cpp b/test/redfish-core/include/utils/ip_utils_test.cpp index f358c51477..f358c51477 100644 --- a/redfish-core/ut/ip_utils_test.cpp +++ b/test/redfish-core/include/utils/ip_utils_test.cpp diff --git a/redfish-core/ut/json_utils_test.cpp b/test/redfish-core/include/utils/json_utils_test.cpp index 826d4375a6..826d4375a6 100644 --- a/redfish-core/ut/json_utils_test.cpp +++ b/test/redfish-core/include/utils/json_utils_test.cpp diff --git a/redfish-core/include/utils/query_param_test.cpp b/test/redfish-core/include/utils/query_param_test.cpp index 4b89b2e1a1..51f0b7101f 100644 --- a/redfish-core/include/utils/query_param_test.cpp +++ b/test/redfish-core/include/utils/query_param_test.cpp @@ -1,6 +1,6 @@ #include "bmcweb_config.h" -#include "query_param.hpp" +#include "utils/query_param.hpp" #include <boost/system/result.hpp> #include <boost/url/url_view.hpp> diff --git a/redfish-core/ut/stl_utils_test.cpp b/test/redfish-core/include/utils/stl_utils_test.cpp index f1febd088d..f1febd088d 100644 --- a/redfish-core/ut/stl_utils_test.cpp +++ b/test/redfish-core/include/utils/stl_utils_test.cpp diff --git a/redfish-core/ut/time_utils_test.cpp b/test/redfish-core/include/utils/time_utils_test.cpp index 035d8ce95b..035d8ce95b 100644 --- a/redfish-core/ut/time_utils_test.cpp +++ b/test/redfish-core/include/utils/time_utils_test.cpp diff --git a/redfish-core/lib/chassis_test.cpp b/test/redfish-core/lib/chassis_test.cpp index a04385984e..a04385984e 100644 --- a/redfish-core/lib/chassis_test.cpp +++ b/test/redfish-core/lib/chassis_test.cpp diff --git a/redfish-core/lib/ut/log_services_dump_test.cpp b/test/redfish-core/lib/log_services_dump_test.cpp index 192b79dc8d..192b79dc8d 100644 --- a/redfish-core/lib/ut/log_services_dump_test.cpp +++ b/test/redfish-core/lib/log_services_dump_test.cpp diff --git a/redfish-core/lib/ut/service_root_test.cpp b/test/redfish-core/lib/service_root_test.cpp index 661f157859..661f157859 100644 --- a/redfish-core/lib/ut/service_root_test.cpp +++ b/test/redfish-core/lib/service_root_test.cpp diff --git a/redfish-core/lib/ut/thermal_subsystem_test.cpp b/test/redfish-core/lib/thermal_subsystem_test.cpp index c6880239da..c6880239da 100644 --- a/redfish-core/lib/ut/thermal_subsystem_test.cpp +++ b/test/redfish-core/lib/thermal_subsystem_test.cpp |