ctkPluginFrameworkTestMain.cpp 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*=============================================================================
  2. Library: CTK
  3. Copyright (c) 2010 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 <ctkPluginConstants.h>
  17. #include "ctkPluginFrameworkTestRunner.h"
  18. int main(int argc, char** argv)
  19. {
  20. QCoreApplication app(argc, argv);
  21. ctkPluginFrameworkTestRunner testRunner;
  22. app.setOrganizationName("CTK");
  23. app.setOrganizationDomain("commontk.org");
  24. app.setApplicationName("ctkPluginFrameworkCppTests");
  25. QString pluginDir;
  26. #ifdef CMAKE_INTDIR
  27. pluginDir = qApp->applicationDirPath() + "/../test_plugins/" CMAKE_INTDIR "/";
  28. #else
  29. pluginDir = qApp->applicationDirPath() + "/test_plugins/";
  30. #endif
  31. testRunner.addPluginPath(pluginDir, false);
  32. testRunner.addPlugin(pluginDir, "org_commontk_pluginfwtest");
  33. testRunner.startPluginOnRun("org.commontk.pluginfwtest");
  34. ctkProperties fwProps;
  35. fwProps.insert(ctkPluginConstants::FRAMEWORK_STORAGE_CLEAN, ctkPluginConstants::FRAMEWORK_STORAGE_CLEAN_ONFIRSTINIT);
  36. fwProps.insert("pluginfw.testDir", pluginDir);
  37. #if defined(Q_CC_GNU) && ((__GNUC__ < 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ < 5)))
  38. fwProps.insert(ctkPluginConstants::FRAMEWORK_PLUGIN_LOAD_HINTS, QVariant::fromValue<QLibrary::LoadHints>(QLibrary::ExportExternalSymbolsHint));
  39. #endif
  40. testRunner.init(fwProps);
  41. return testRunner.run(argc, argv);
  42. }