コード例 #1
0
ファイル: main.cpp プロジェクト: shengofsun/rDSN
GTEST_API_ int main(int argc, char **argv)
{
    dsn::service_app::register_factory<replication_service_test_app>("replica");
    if (argc < 2)
        dassert(dsn_run_config("config-test.ini", false), "");
    else
        dassert(dsn_run_config(argv[1], false), "");

    while (gtest_flags == 0) {
        std::this_thread::sleep_for(std::chrono::seconds(1));
    }

#ifndef ENABLE_GCOV
    dsn_exit(gtest_ret);
#endif
    return gtest_ret;
}
コード例 #2
0
ファイル: nfs_test.main.cpp プロジェクト: Bran-Stark/rDSN
int main(int argc, char** argv)
{
    dsn::register_app<::dsn::replication::application::nfs_client_app>("client");
    dsn::register_app<::dsn::replication::application::nfs_server_app>("server");
    
    // specify what services and tools will run in config file, then run
    dsn_run_config("config.ini", true);
    return 0;
}
コード例 #3
0
ファイル: main.cpp プロジェクト: Bran-Stark/rDSN
GTEST_API_ int main(int argc, char **argv)
{
    // register all possible services
    dsn::register_app<test_client>("test");

    // specify what services and tools will run in config file, then run
    dsn_run_config("config-test.ini", true);
    return 0;
}
コード例 #4
0
ファイル: cli.main.cpp プロジェクト: strategist922/rDSN
int main(int argc, char** argv)
{
    // register all possible service apps
    dsn::register_app<::dsn::service::cli>("cli");

    // specify what services and tools will run in config file, then run
    dsn_run_config("config.ini", true);
    return 0;
}
コード例 #5
0
ファイル: repli.main.cpp プロジェクト: Strongc/rDSN
int main(int argc, char** argv)
{
    if (argc < 2)
    {
        std::cerr << "USAGE: " << argv[0] << " <command> <params...>" << std::endl;
        dsn::service::repli_app::usage();
        return -1;
    }

    std::string conf;
    char buf[4096];
    int slen;

# if defined(_WIN32)
    slen = ::GetModuleFileNameA(NULL, buf, sizeof(buf));
# else
    slen = readlink("/proc/self/exe", buf, sizeof(buf));
# endif

    if (slen != -1)
    {
        std::string dir = dsn::utils::filesystem::remove_file_name(buf);
        conf = dir + "/config.ini";
        if (!dsn::utils::filesystem::file_exists(conf))
        {
            std::cerr << "ERROR: config file not found: " << conf << std::endl;
            dsn::service::repli_app::usage();
            return -1;
        }
    }

    dsn_core_init();

    // register all possible service apps
    dsn::register_app< ::dsn::service::repli_app>("repli");

    dsn::service::repli_app::set_args(argc - 1, argv + 1);

    // specify what services and tools will run in config file, then run
    dsn_run_config(conf.c_str(), false);

    while (!g_done)
    {
        std::this_thread::sleep_for(std::chrono::milliseconds(1));
    }

    return 0;
}
コード例 #6
0
ファイル: main.cpp プロジェクト: ykwd/rDSN
GTEST_API_ int main(int argc, char **argv) 
{
    // register all possible services
    dsn::register_app<test_client>("test");
    lock_test_init();
    fd_test_init();

    // specify what services and tools will run in config file, then run
    dsn_run_config("config-test.ini", false);
    while (g_test_count == 0)
    {
        std::this_thread::sleep_for(std::chrono::seconds(1));
    }

#ifndef ENABLE_GCOV
    dsn_exit(g_test_ret);
#endif
    return g_test_ret;
}