summaryrefslogtreecommitdiff
path: root/src/components/test_main.cc
blob: 55b1f96aeb0cc83ff8bbe714786a2a5873667940 (plain)
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
#include <iostream>
#include "gmock/gmock.h"
#include "utils/custom_string.h"

#ifdef ENABLE_LOG
#include "utils/logger/logger_impl.h"
#endif  // ENABLE_LOG

#include "utils/logger.h"

SDL_CREATE_LOG_VARIABLE("SDLMain")
int main(int argc, char** argv) {
#ifdef ENABLE_LOG
  // --------------------------------------------------------------------------
  // Logger initialization
  // Redefine for each paticular logger implementation
  auto logger_impl =
      std::unique_ptr<logger::LoggerImpl>(new logger::LoggerImpl(false));
  logger::Logger::instance(logger_impl.get());
#endif  // ENABLE_LOG

  namespace custom_str = utils::custom_string;
  testing::InitGoogleMock(&argc, argv);
  ::testing::DefaultValue<custom_str::CustomString>::Set(
      custom_str::CustomString(""));
  const int result = RUN_ALL_TESTS();

  SDL_DEINIT_LOGGER();
  return result;
}