-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
37 lines (33 loc) · 842 Bytes
/
main.cpp
File metadata and controls
37 lines (33 loc) · 842 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include <bench/app/program.hpp>
#include <bench/log/console_logger.hpp>
#include <bench/tests/all_tests.hpp>
#include <cstdlib>
#include <iostream>
static bench::log::logger & get_logger()
{
if (std::getenv("TEAMCITY_VERSION"))
return bench::log::get_teamcity_logger();
else
return bench::log::get_console_logger();
}
int main(int argc, const char * argv[])
{
bench::log::logger & logger = get_logger();
auto test_pool = bench::tests::get_all_tests();
bench::app::program program(logger, test_pool);
try
{
program.run(argc, argv);
return EXIT_SUCCESS;
}
catch (std::exception & e)
{
logger.fatal_error(e.what());
return EXIT_FAILURE;
}
catch (...)
{
logger.fatal_error("Unknown exception!");
return EXIT_FAILURE;
}
}