未验证 提交 e0e329ad 编写于 作者: W Wu Tao 提交者: GitHub

travis: add .travis.yml (#57)

上级 b17d3be6
sudo: required
dist: trusty
language: cpp
os: linux
compiler:
- gcc
before_install:
- wget https://raw.githubusercontent.com/xiaomi/pegasus-common/master/build-depends.tar.gz
- tar xf build-depends.tar.gz
- cd packages
- ls | xargs sudo dpkg -i --force-depends
- cd ..
install:
- sudo apt-get -f install
- sudo apt-get -y install libsnappy-dev
before_script:
- cd rdsn/thirdparty
- wget https://raw.githubusercontent.com/xiaomi/pegasus-common/master/pegasus-thirdparty-prebuild.tar.gz
- tar xf pegasus-thirdparty-prebuild.tar.gz
- rm -rf pegasus-thirdparty-prebuild.tar.gz
- cd ../..
- ulimit -c unlimited -S
script:
- ./run.sh build && ./run.sh test
notifications:
email: false
Subproject commit f19ad49dd37420f59f0e72f5bb70d4aaac04e3db Subproject commit 9f5c4144a8f64d875f734b6f38f764855a4e941d
...@@ -206,7 +206,7 @@ function run_test() ...@@ -206,7 +206,7 @@ function run_test()
done done
if [ "$test_modules" == "" ]; then if [ "$test_modules" == "" ]; then
test_modules="pegasus_rproxy_test pegasus_function_test" test_modules="pegasus_rproxy_test pegasus_function_test pegasus_unit_test"
fi fi
./run.sh clear_onebox #clear the onebox before test ./run.sh clear_onebox #clear the onebox before test
......
...@@ -40,6 +40,6 @@ add_definitions(-DPEGASUS_UNIT_TEST) ...@@ -40,6 +40,6 @@ add_definitions(-DPEGASUS_UNIT_TEST)
set(MY_BOOST_PACKAGES system filesystem) set(MY_BOOST_PACKAGES system filesystem)
set(MY_BINPLACES config.ini) set(MY_BINPLACES config.ini run.sh)
dsn_add_executable() dsn_add_executable()
...@@ -6,6 +6,9 @@ ...@@ -6,6 +6,9 @@
#include <dsn/service_api_cpp.h> #include <dsn/service_api_cpp.h>
#include <dsn/dist/replication/replication_service_app.h> #include <dsn/dist/replication/replication_service_app.h>
#include "server/pegasus_perf_counter.h"
#include "server/pegasus_server_impl.h"
std::atomic_bool gtest_done{false}; std::atomic_bool gtest_done{false};
class gtest_app : public ::dsn::replication::replication_service_app class gtest_app : public ::dsn::replication::replication_service_app
...@@ -29,6 +32,18 @@ GTEST_API_ int main(int argc, char **argv) ...@@ -29,6 +32,18 @@ GTEST_API_ int main(int argc, char **argv)
{ {
testing::InitGoogleTest(&argc, argv); testing::InitGoogleTest(&argc, argv);
// register perf counter.
dsn::tools::internal_use_only::register_component_provider(
"pegasus::server::pegasus_perf_counter",
pegasus::server::pegasus_perf_counter_factory,
::dsn::PROVIDER_TYPE_MAIN);
dsn::service_app::register_factory<gtest_app>("replica");
dsn::replication::replication_app_base::register_storage_engine(
"pegasus",
dsn::replication::replication_app_base::create<pegasus::server::pegasus_server_impl>);
dsn::service_app::register_factory<gtest_app>("replica"); dsn::service_app::register_factory<gtest_app>("replica");
dsn_run_config("config.ini", false); dsn_run_config("config.ini", false);
......
...@@ -24,7 +24,7 @@ public: ...@@ -24,7 +24,7 @@ public:
_gpid = dsn::gpid(100, 1); _gpid = dsn::gpid(100, 1);
dsn::app_info app_info; dsn::app_info app_info;
app_info.app_type = "replica"; app_info.app_type = "pegasus";
_replica = _replica =
dsn::replication::create_test_replica(_replica_stub, _gpid, app_info, "./", false); dsn::replication::create_test_replica(_replica_stub, _gpid, app_info, "./", false);
......
#!/usr/bin/env bash
./pegasus_unit_test
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册