diff options
Diffstat (limited to 'src/cmd.cpp')
-rw-r--r-- | src/cmd.cpp | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/cmd.cpp b/src/cmd.cpp index f0d748e0..5c554f32 100644 --- a/src/cmd.cpp +++ b/src/cmd.cpp @@ -36,10 +36,13 @@ // GpgFrontend #include "GpgFrontendBuildInfo.h" -#include "type.h" +#include "GpgFrontendContext.h" +#include "test/GpgFrontendTest.h" namespace po = boost::program_options; +namespace GpgFrontend { + auto PrintVersion() -> int { std::cout << PROJECT_NAME << " " << "v" << VERSION_MAJOR << "." << VERSION_MINOR << "." @@ -79,4 +82,19 @@ auto ParseLogLevel(const po::variables_map& vm) -> spdlog::level::level_enum { return spdlog::level::info; } -auto RunTest(int argc, char** argv) {}
\ No newline at end of file +auto RunTest(const GFCxtWPtr& p_ctx) -> int { + GpgFrontend::GFCxtSPtr ctx = p_ctx.lock(); + if (ctx == nullptr) { + SPDLOG_ERROR("cannot get gpgfrontend context for test running"); + return -1; + } + + GpgFrontend::Test::GpgFrontendContext test_init_args; + test_init_args.argc = ctx->argc; + test_init_args.argv = ctx->argv; + test_init_args.log_level = ctx->log_level; + + return GpgFrontend::Test::ExecuteAllTestCase(test_init_args); +} + +} // namespace GpgFrontend
\ No newline at end of file |