ctkEventAdminImplPerfTestMain.cpp 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /*=============================================================================
  2. Library: CTK
  3. Copyright (c) German Cancer Research Center,
  4. Division of Medical and Biological Informatics
  5. Licensed under the Apache License, Version 2.0 (the "License");
  6. you may not use this file except in compliance with the License.
  7. You may obtain a copy of the License at
  8. http://www.apache.org/licenses/LICENSE-2.0
  9. Unless required by applicable law or agreed to in writing, software
  10. distributed under the License is distributed on an "AS IS" BASIS,
  11. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. See the License for the specific language governing permissions and
  13. limitations under the License.
  14. =============================================================================*/
  15. #include <QCoreApplication>
  16. #include <ctkConfig.h>
  17. #include <ctkPluginConstants.h>
  18. #include <Testing/Cpp/ctkPluginFrameworkTestRunner.h>
  19. int main(int argc, char** argv)
  20. {
  21. QCoreApplication app(argc, argv);
  22. ctkPluginFrameworkTestRunner testRunner;
  23. app.setOrganizationName("CTK");
  24. app.setOrganizationDomain("commontk.org");
  25. app.setApplicationName("ctkEventAdminImplCppTests");
  26. QString pluginDir;
  27. #ifdef CMAKE_INTDIR
  28. pluginDir = CTK_PLUGIN_DIR CMAKE_INTDIR "/";
  29. #else
  30. pluginDir = CTK_PLUGIN_DIR;
  31. #endif
  32. QString testpluginDir;
  33. #ifdef CMAKE_INTDIR
  34. testpluginDir = qApp->applicationDirPath() + "/../test_plugins/" CMAKE_INTDIR "/";
  35. #else
  36. testpluginDir = qApp->applicationDirPath() + "/test_plugins/";
  37. #endif
  38. testRunner.addPluginPath(pluginDir, false);
  39. testRunner.addPlugin(testpluginDir, "org_commontk_eventadmintest_perf");
  40. testRunner.addPlugin(pluginDir, "org_commontk_eventadmin");
  41. testRunner.addPlugin(pluginDir, "org_commontk_log");
  42. testRunner.startPluginOnRun("org.commontk.eventadmintest.perf");
  43. ctkProperties fwProps;
  44. fwProps.insert(ctkPluginConstants::FRAMEWORK_STORAGE_CLEAN, ctkPluginConstants::FRAMEWORK_STORAGE_CLEAN_ONFIRSTINIT);
  45. fwProps.insert("pluginfw.testDir", testpluginDir);
  46. fwProps.insert("event.impl", "org.commontk.eventadmin");
  47. fwProps.insert("org.commontk.eventadmin.ThreadPoolSize", 10);
  48. testRunner.init(fwProps);
  49. return testRunner.run(argc, argv);
  50. }