You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
1.6 KiB

  1. #include <iostream>
  2. #include "gtest/gtest.h"
  3. #include "storm-config.h"
  4. #include "src/settings/SettingsManager.h"
  5. #ifdef STORM_LOGGING_FRAMEWORK
  6. #include "log4cplus/logger.h"
  7. #include "log4cplus/loggingmacros.h"
  8. #include "log4cplus/consoleappender.h"
  9. #include "log4cplus/fileappender.h"
  10. log4cplus::Logger logger;
  11. #endif
  12. /*!
  13. * Initializes the logging framework.
  14. */
  15. void setUpLogging() {
  16. #ifdef STORM_LOGGING_FRAMEWORK
  17. logger = log4cplus::Logger::getInstance(LOG4CPLUS_TEXT("main"));
  18. logger.setLogLevel(log4cplus::WARN_LOG_LEVEL);
  19. log4cplus::SharedAppenderPtr fileLogAppender(new log4cplus::FileAppender("storm-performance-tests.log"));
  20. fileLogAppender->setName("mainFileAppender");
  21. fileLogAppender->setThreshold(log4cplus::WARN_LOG_LEVEL);
  22. fileLogAppender->setLayout(std::auto_ptr<log4cplus::Layout>(new log4cplus::PatternLayout("%-5p - %D{%H:%M} (%r ms) - %F:%L : %m%n")));
  23. logger.addAppender(fileLogAppender);
  24. #endif
  25. // Uncomment these lines to enable console logging output
  26. // log4cplus::SharedAppenderPtr consoleLogAppender(new log4cplus::ConsoleAppender());
  27. // consoleLogAppender->setName("mainConsoleAppender");
  28. // consoleLogAppender->setLayout(std::auto_ptr<log4cplus::Layout>(new log4cplus::PatternLayout("%-5p - %D{%H:%M:%s} (%r ms) - %F:%L : %m%n")));
  29. // logger.addAppender(consoleLogAppender);
  30. }
  31. int main(int argc, char* argv[]) {
  32. setUpLogging();
  33. std::cout << "StoRM (Performance) Testing Suite" << std::endl;
  34. testing::InitGoogleTest(&argc, argv);
  35. int result = RUN_ALL_TESTS();
  36. #ifdef STORM_LOGGING_FRAMEWORK
  37. logger.closeNestedAppenders();
  38. #endif
  39. return result;
  40. }