Explorar el Código

Merge branch 'ctkcoverage'

* ctkcoverage:
  ctkModelTester was supporting only vertical models
  Add basic tests for the factories
  Remove Qt files from coverage
Julien Finet hace 14 años
padre
commit
c42e8ada1f

+ 3 - 0
CMake/CTestCustom.cmake.in

@@ -14,6 +14,9 @@ SET(CTEST_CUSTOM_COVERAGE_EXCLUDE
   ".*/Testing/.*"
  
   ".*/CMakeExternals/.*"
+
+  "./ctkPixmapIconEngine.*"
+  "./ctkIconEngine.*"
   )
 
 # The following tests should not be run under valgrind

+ 5 - 0
Libs/Core/Testing/Cpp/CMakeLists.txt

@@ -55,6 +55,11 @@ ENDMACRO( SIMPLE_TEST  )
 # Add Tests
 #
 
+SIMPLE_TEST( ctkAbstractFactoryTest1 )
+SIMPLE_TEST( ctkAbstractLibraryFactoryTest1 )
+SIMPLE_TEST( ctkAbstractObjectFactoryTest1 )
+SIMPLE_TEST( ctkAbstractPluginFactoryTest1 )
+SIMPLE_TEST( ctkAbstractQObjectFactoryTest1 )
 SIMPLE_TEST( ctkCommandLineParserTest1 )
 SIMPLE_TEST( ctkDependencyGraphTest1 )
 SIMPLE_TEST( ctkDependencyGraphTest2 )

+ 2 - 2
Libs/Core/ctkModelTester.cpp

@@ -504,7 +504,7 @@ void ctkModelTester::onItemsInserted(const QModelIndex & vparent, Qt::Orientatio
 
   ctkModelTesterPrivate::Change change = d->AboutToBeInserted.pop();
   this->test(change.Parent == vparent, "Parent can't be different");
-  this->test(change.Orientation == Qt::Vertical, "Orientation can't be different");
+  this->test(change.Orientation == orientation, "Orientation can't be different");
   this->test(change.Start == start, "Start can't be different");
   this->test(change.End == end, "End can't be different");
   int count =  (orientation == Qt::Vertical ? d->Model->rowCount(vparent) :d->Model->columnCount(vparent) );
@@ -530,7 +530,7 @@ void ctkModelTester::onItemsRemoved(const QModelIndex & vparent, Qt::Orientation
 
   ctkModelTesterPrivate::Change change = d->AboutToBeRemoved.pop();
   this->test(change.Parent == vparent, "Parent can't be different");
-  this->test(change.Orientation == Qt::Vertical, "Orientation can't be different");
+  this->test(change.Orientation == orientation, "Orientation can't be different");
   this->test(change.Start == start, "Start can't be different");
   this->test(change.End == end, "End can't be different");
   int count = (orientation == Qt::Vertical ? d->Model->rowCount(vparent) :d->Model->columnCount(vparent) );