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.

51 lines
1.7 KiB

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