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.

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