Browse Source

Delete test suites when stopping plug-ins.

Sascha Zelzer 13 years ago
parent
commit
84fc8e2698

+ 12 - 0
Libs/PluginFramework/Testing/ConfigAdminTest/ctkConfigAdminTestActivator.cpp

@@ -92,6 +92,18 @@ void ctkConfigAdminTestActivator::start(ctkPluginContext* context)
 void ctkConfigAdminTestActivator::stop(ctkPluginContext* context)
 {
   Q_UNUSED(context);
+
+  delete configAdminTestSuite;
+  delete managedServiceTestSuite;
+  delete managedServiceFactoryTestSuite;
+  delete configPluginTestSuite;
+  delete configListenerTestSuite;
+
+  configAdminTestSuite = 0;
+  managedServiceTestSuite = 0;
+  managedServiceFactoryTestSuite = 0;
+  configPluginTestSuite = 0;
+  configListenerTestSuite = 0;
 }
 
 Q_EXPORT_PLUGIN2(org_commontk_configadmintest, ctkConfigAdminTestActivator)

+ 7 - 0
Libs/PluginFramework/Testing/Cpp/ctkPluginFrameworkTestRunner.cpp

@@ -73,6 +73,13 @@ public:
       ++count;
     }
 
+    // stop the specified plugins
+    foreach(StartPluginPair pluginInfo, startPluginInfos)
+    {
+      QSharedPointer<ctkPlugin> plugin = context->getPlugin(pluginInfo.first);
+      plugin->stop();
+    }
+
     qDebug() << "#########" << count << "out of" << refs.size() << "test suites passed #########";
     if (result > 0)
     {

+ 16 - 0
Libs/PluginFramework/Testing/EventAdminTest/ctkEventAdminTestActivator.cpp

@@ -104,6 +104,22 @@ void ctkEventAdminTestActivator::start(ctkPluginContext* context)
 void ctkEventAdminTestActivator::stop(ctkPluginContext* context)
 {
   Q_UNUSED(context);
+
+  delete topicWildcardTestSuite;
+  delete topicWildcardTestSuiteSS;
+  delete scenario1TestSuite;
+  delete scenario1TestSuiteSS;
+  delete scenario2TestSuite;
+  delete scenario3TestSuite;
+  delete scenario4TestSuite;
+
+  topicWildcardTestSuite = 0;
+  topicWildcardTestSuiteSS = 0;
+  scenario1TestSuite = 0;
+  scenario1TestSuiteSS = 0;
+  scenario2TestSuite = 0;
+  scenario3TestSuite = 0;
+  scenario4TestSuite = 0;
 }
 
 Q_EXPORT_PLUGIN2(org_commontk_eventadmintest, ctkEventAdminTestActivator)

+ 6 - 0
Libs/PluginFramework/Testing/MetaTypeTest/ctkMetaTypeTestActivator.cpp

@@ -74,6 +74,12 @@ void ctkMetaTypeTestActivator::start(ctkPluginContext* context)
 void ctkMetaTypeTestActivator::stop(ctkPluginContext* context)
 {
   Q_UNUSED(context);
+
+  delete attrPwdTestSuite;
+  delete localeTestSuite;
+
+  attrPwdTestSuite = 0;
+  localeTestSuite = 0;
 }
 
 Q_EXPORT_PLUGIN2(org_commontk_metatypetest, ctkMetaTypeTestActivator)