Skip to content
This repository has been archived by the owner on Jun 23, 2022. It is now read-only.

refactor: make utils decoupled from dsn_runtime #517

Merged
merged 28 commits into from
Jul 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions include/dsn/tool-api/env_provider.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class env_provider

typedef env_provider *(*factory)(env_provider *);

env_provider(env_provider *inner_provider);
env_provider(env_provider *inner_provider){};
};
/*@}*/
} // end namespace
} // namespace dsn
2 changes: 1 addition & 1 deletion scripts/linux/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ echo "################################# start testing ##########################
if [ -z "$TEST_MODULE" ]
then
# supported test module
TEST_MODULE="dsn.core.tests,dsn_perf_counter_test,dsn.zookeeper.tests,dsn_aio_test,dsn.failure_detector.tests,dsn_meta_state_tests,dsn_nfs_test,dsn_block_service_test,dsn.replication.simple_kv,dsn.rep_tests.simple_kv,dsn.meta.test,dsn.replica.test,dsn_http_test,dsn_replica_dup_test,dsn_replica_backup_test,dsn_replica_bulk_load_test"
TEST_MODULE="dsn.core.tests,dsn_utils_tests,dsn_perf_counter_test,dsn.zookeeper.tests,dsn_aio_test,dsn.failure_detector.tests,dsn_meta_state_tests,dsn_nfs_test,dsn_block_service_test,dsn.replication.simple_kv,dsn.rep_tests.simple_kv,dsn.meta.test,dsn.replica.test,dsn_http_test,dsn_replica_dup_test,dsn_replica_backup_test,dsn_replica_bulk_load_test"
fi

echo "TEST_MODULE=$TEST_MODULE"
Expand Down
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ add_subdirectory(common)
add_subdirectory(replica)
add_subdirectory(meta)
add_subdirectory(tools)
add_subdirectory(utils)
1 change: 1 addition & 0 deletions src/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ add_library(dsn_runtime STATIC
$<TARGET_OBJECTS:dsn.tools.common>
$<TARGET_OBJECTS:dsn.tools.simulator>
)
target_link_libraries(dsn_runtime dsn_utils)
install(TARGETS dsn_runtime DESTINATION "lib")
152 changes: 0 additions & 152 deletions src/core/core/admission_controller.cpp

This file was deleted.

48 changes: 0 additions & 48 deletions src/core/core/env_provider.cpp

This file was deleted.

2 changes: 1 addition & 1 deletion src/core/core/service_api_c.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#include "service_engine.h"
#include "core/rpc/rpc_engine.h"
#include "core/task/task_engine.h"
#include "coredump.h"
#include "utils/coredump.h"

//
// global state
Expand Down
2 changes: 1 addition & 1 deletion src/core/core/tool_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#include <dsn/tool_api.h>
#include <dsn/utility/factory_store.h>
#include <dsn/utility/singleton_store.h>
#include "service_engine.h"
#include "core/core/service_engine.h"
#include "core/rpc/message_parser_manager.h"

namespace dsn {
Expand Down
2 changes: 1 addition & 1 deletion src/core/core/zlocks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

#include <dsn/utility/factory_store.h>
#include <dsn/tool-api/zlocks.h>
#include "core/core/zlock_provider.h"
#include "utils/zlock_provider.h"
#include "core/core/service_engine.h"

namespace dsn {
Expand Down
2 changes: 1 addition & 1 deletion src/core/task/task_engine.sim.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#include <dsn/utility/priority_queue.h>
#include <dsn/tool-api/timer_service.h>
#include <dsn/tool-api/task_queue.h>
#include "core/core/zlock_provider.h"
#include "utils/zlock_provider.h"

namespace dsn {
namespace tools {
Expand Down
11 changes: 1 addition & 10 deletions src/core/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,9 @@ set(MY_PROJ_LIBS gtest
set(MY_BOOST_LIBS Boost::system Boost::filesystem Boost::regex)

# Extra files that will be installed
set(MY_BINPLACES "${CMAKE_CURRENT_SOURCE_DIR}/config-bad-section.ini"
"${CMAKE_CURRENT_SOURCE_DIR}/config-dup-key.ini"
"${CMAKE_CURRENT_SOURCE_DIR}/config-dup-section.ini"
"${CMAKE_CURRENT_SOURCE_DIR}/config-empty.ini"
"${CMAKE_CURRENT_SOURCE_DIR}/config-no-key.ini"
"${CMAKE_CURRENT_SOURCE_DIR}/config-no-section.ini"
"${CMAKE_CURRENT_SOURCE_DIR}/config-null-section.ini"
"${CMAKE_CURRENT_SOURCE_DIR}/config-sample.ini"
"${CMAKE_CURRENT_SOURCE_DIR}/config-test-corrupt-message.ini"
set(MY_BINPLACES "${CMAKE_CURRENT_SOURCE_DIR}/config-test-corrupt-message.ini"
"${CMAKE_CURRENT_SOURCE_DIR}/config-test.ini"
"${CMAKE_CURRENT_SOURCE_DIR}/config-test-sim.ini"
"${CMAKE_CURRENT_SOURCE_DIR}/config-unmatch-section.ini"
"${CMAKE_CURRENT_SOURCE_DIR}/command.txt"
"${CMAKE_CURRENT_SOURCE_DIR}/run.sh"
"${CMAKE_CURRENT_SOURCE_DIR}/clear.sh"
Expand Down
2 changes: 0 additions & 2 deletions src/core/tests/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
#include "test_utils.h"

extern void task_engine_module_init();
extern void command_manager_module_init();

int g_test_count = 0;
int g_test_ret = 0;
Expand All @@ -49,7 +48,6 @@ GTEST_API_ int main(int argc, char **argv)

// register all tools
task_engine_module_init();
command_manager_module_init();

// register all possible services
dsn::service_app::register_factory<test_client>("test");
Expand Down
2 changes: 1 addition & 1 deletion src/core/tests/rpc_message.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@
* xxxx-xx-xx, author, fix bug about xxx
*/

#include "core/core/message_utils.cpp"
#include <dsn/utility/crc.h>
#include <dsn/utility/transient_memory.h>
#include <dsn/tool-api/rpc_message.h>
#include <core/core/message_utils.cpp>
#include <gtest/gtest.h>

using namespace ::dsn;
Expand Down
50 changes: 0 additions & 50 deletions src/core/tools/common/lockp.std.cpp

This file was deleted.

2 changes: 1 addition & 1 deletion src/core/tools/common/profiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ START<== queue(server) == ENQUEUE <===== net(reply) ======= REPLY <=============
#include <dsn/toollet/profiler.h>
#include <dsn/service_api_c.h>
#include <dsn/tool-api/aio_task.h>
#include "shared_io_service.h"
#include "utils/shared_io_service.h"
#include "profiler_header.h"
#include <dsn/tool-api/command_manager.h>
#include <dsn/perf_counter/perf_counter_wrapper.h>
Expand Down