Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Switch tests to automoc
Required for Qt5 compatibility
Raises minimum CMake version to 2.8.6
  • Loading branch information
m-kuhn committed Nov 4, 2014
1 parent f46e683 commit 1c2bdf1
Show file tree
Hide file tree
Showing 84 changed files with 84 additions and 94 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Expand Up @@ -18,7 +18,7 @@ MESSAGE(STATUS "QGIS version: ${COMPLETE_VERSION} ${RELEASE_NAME} (${QGIS_VERSIO
#############################################################
# CMake settings

CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0)
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.6)

SET(CMAKE_COLOR_MAKEFILE ON)

Expand Down
2 changes: 1 addition & 1 deletion INSTALL
Expand Up @@ -92,7 +92,7 @@ Following a summary of the required dependencies for building:

Required build tools:

- CMake >= 2.8.0
- CMake >= 2.8.6
- Flex
- Bison >= 2.4

Expand Down
4 changes: 1 addition & 3 deletions tests/src/analysis/CMakeLists.txt
Expand Up @@ -55,10 +55,8 @@ ENDIF (APPLE)
MACRO (ADD_QGIS_TEST testname testsrc)
SET(qgis_${testname}_SRCS ${testsrc} ${util_SRCS})
SET(qgis_${testname}_MOC_CPPS ${testsrc})
QT4_WRAP_CPP(qgis_${testname}_MOC_SRCS ${qgis_${testname}_MOC_CPPS})
ADD_CUSTOM_TARGET(qgis_${testname}moc ALL DEPENDS ${qgis_${testname}_MOC_SRCS})
ADD_EXECUTABLE(qgis_${testname} ${qgis_${testname}_SRCS})
ADD_DEPENDENCIES(qgis_${testname} qgis_${testname}moc)
SET_TARGET_PROPERTIES(qgis_${testname} PROPERTIES AUTOMOC TRUE)
TARGET_LINK_LIBRARIES(qgis_${testname}
${QT_QTCORE_LIBRARY}
${QT_QTTEST_LIBRARY}
Expand Down
2 changes: 1 addition & 1 deletion tests/src/analysis/testopenstreetmap.cpp
Expand Up @@ -190,4 +190,4 @@ void TestOpenStreetMap::importAndQueries()

QTEST_MAIN( TestOpenStreetMap )

#include "moc_testopenstreetmap.cxx"
#include "testopenstreetmap.moc"
2 changes: 1 addition & 1 deletion tests/src/analysis/testqgsvectoranalyzer.cpp
Expand Up @@ -130,4 +130,4 @@ void TestQgsVectorAnalyzer::layerExtent()
}

QTEST_MAIN( TestQgsVectorAnalyzer )
#include "moc_testqgsvectoranalyzer.cxx"
#include "testqgsvectoranalyzer.moc"
2 changes: 1 addition & 1 deletion tests/src/analysis/testqgszonalstatistics.cpp
Expand Up @@ -117,4 +117,4 @@ void TestQgsZonalStatistics::testStatistics()
}

QTEST_MAIN( TestQgsZonalStatistics )
#include "moc_testqgszonalstatistics.cxx"
#include "testqgszonalstatistics.moc"
4 changes: 1 addition & 3 deletions tests/src/app/CMakeLists.txt
Expand Up @@ -54,11 +54,9 @@ ENDIF (APPLE)

MACRO (ADD_QGIS_TEST testname testsrc)
SET(qgis_${testname}_SRCS ${testsrc} ${util_SRCS})
SET(qgis_${testname}_MOC_CPPS ${testsrc})
QT4_WRAP_CPP(qgis_${testname}_MOC_SRCS ${qgis_${testname}_MOC_CPPS})
ADD_CUSTOM_TARGET(qgis_${testname}moc ALL DEPENDS ${qgis_${testname}_MOC_SRCS})
ADD_EXECUTABLE(qgis_${testname} ${qgis_${testname}_SRCS})
ADD_DEPENDENCIES(qgis_${testname} qgis_${testname}moc)
SET_TARGET_PROPERTIES(qgis_${testname} PROPERTIES AUTOMOC TRUE)
TARGET_LINK_LIBRARIES(qgis_${testname}
${QT_QTXML_LIBRARY}
${QT_QTCORE_LIBRARY}
Expand Down
2 changes: 1 addition & 1 deletion tests/src/app/testqgisappclipboard.cpp
Expand Up @@ -100,4 +100,4 @@ void TestQgisAppClipboard::copyPaste()
}

QTEST_MAIN( TestQgisAppClipboard )
#include "moc_testqgisappclipboard.cxx"
#include "testqgisappclipboard.moc"
4 changes: 1 addition & 3 deletions tests/src/core/CMakeLists.txt
Expand Up @@ -55,10 +55,8 @@ ENDIF (APPLE)
MACRO (ADD_QGIS_TEST testname testsrc)
SET(qgis_${testname}_SRCS ${testsrc} ${util_SRCS})
SET(qgis_${testname}_MOC_CPPS ${testsrc})
QT4_WRAP_CPP(qgis_${testname}_MOC_SRCS ${qgis_${testname}_MOC_CPPS})
ADD_CUSTOM_TARGET(qgis_${testname}moc ALL DEPENDS ${qgis_${testname}_MOC_SRCS})
ADD_EXECUTABLE(qgis_${testname} ${qgis_${testname}_SRCS})
ADD_DEPENDENCIES(qgis_${testname} qgis_${testname}moc)
SET_TARGET_PROPERTIES(qgis_${testname} PROPERTIES AUTOMOC TRUE)
TARGET_LINK_LIBRARIES(qgis_${testname}
${QT_QTXML_LIBRARY}
${QT_QTCORE_LIBRARY}
Expand Down
2 changes: 1 addition & 1 deletion tests/src/core/regression1141.cpp
Expand Up @@ -160,4 +160,4 @@ void Regression1141::diacriticalTest()


QTEST_MAIN( Regression1141 )
#include "moc_regression1141.cxx"
#include "regression1141.moc"
2 changes: 1 addition & 1 deletion tests/src/core/regression992.cpp
Expand Up @@ -123,4 +123,4 @@ void Regression992::regression992()
}

QTEST_MAIN( Regression992 )
#include "moc_regression992.cxx"
#include "regression992.moc"
2 changes: 1 addition & 1 deletion tests/src/core/test_template.cpp
Expand Up @@ -27,7 +27,7 @@ class Test[testClassCamelCaseName]: public QObject
};

QTEST_MAIN( Test[testClassCamelCaseName] )
#include "test[testClassLowerCaseName].moc.cpp"
#include "test[testClassLowerCaseName].moc"



Expand Down
2 changes: 1 addition & 1 deletion tests/src/core/testcontrastenhancements.cpp
Expand Up @@ -103,5 +103,5 @@ void TestContrastEnhancements::linearMinMaxEnhancementTest()
QVERIFY( 255.0 == myEnhancement.enhance( 240.0 ) );
}
QTEST_MAIN( TestContrastEnhancements )
#include "moc_testcontrastenhancements.cxx"
#include "testcontrastenhancements.moc"

2 changes: 1 addition & 1 deletion tests/src/core/testmaprendererjob.cpp
Expand Up @@ -276,4 +276,4 @@ void TestQgsMapRendererJob::testCache()


QTEST_MAIN( TestQgsMapRendererJob )
#include "moc_testmaprendererjob.cxx"
#include "testmaprendererjob.moc"
2 changes: 1 addition & 1 deletion tests/src/core/testqgsapplication.cpp
Expand Up @@ -64,5 +64,5 @@ void TestQgsApplication::checkGdalSkip()
}

QTEST_MAIN( TestQgsApplication )
#include "moc_testqgsapplication.cxx"
#include "testqgsapplication.moc"

2 changes: 1 addition & 1 deletion tests/src/core/testqgsatlascomposition.cpp
Expand Up @@ -471,4 +471,4 @@ void TestQgsAtlasComposition::test_remove_layer()
}

QTEST_MAIN( TestQgsAtlasComposition )
#include "moc_testqgsatlascomposition.cxx"
#include "testqgsatlascomposition.moc"
2 changes: 1 addition & 1 deletion tests/src/core/testqgsblendmodes.cpp
Expand Up @@ -223,4 +223,4 @@ bool TestQgsBlendModes::imageCheck( QString theTestType )
}

QTEST_MAIN( TestQgsBlendModes )
#include "moc_testqgsblendmodes.cxx"
#include "testqgsblendmodes.moc"
2 changes: 1 addition & 1 deletion tests/src/core/testqgsclipper.cpp
Expand Up @@ -86,4 +86,4 @@ bool TestQgsClipper::checkBoundingBox( QPolygonF polygon, QgsRectangle clipRect
}

QTEST_MAIN( TestQgsClipper )
#include "moc_testqgsclipper.cxx"
#include "testqgsclipper.moc"
2 changes: 1 addition & 1 deletion tests/src/core/testqgscolorscheme.cpp
Expand Up @@ -155,4 +155,4 @@ void TestQgsColorScheme::clone()
}

QTEST_MAIN( TestQgsColorScheme )
#include "moc_testqgscolorscheme.cxx"
#include "testqgscolorscheme.moc"
2 changes: 1 addition & 1 deletion tests/src/core/testqgscolorschemeregistry.cpp
Expand Up @@ -195,4 +195,4 @@ void TestQgsColorSchemeRegistry::matchingSchemes()
}

QTEST_MAIN( TestQgsColorSchemeRegistry )
#include "moc_testqgscolorschemeregistry.cxx"
#include "testqgscolorschemeregistry.moc"
2 changes: 1 addition & 1 deletion tests/src/core/testqgscomposerdd.cpp
Expand Up @@ -136,5 +136,5 @@ void TestQgsComposerDD::ddEvaluate()
}

QTEST_MAIN( TestQgsComposerDD )
#include "moc_testqgscomposerdd.cxx"
#include "testqgscomposerdd.moc"

2 changes: 1 addition & 1 deletion tests/src/core/testqgscomposereffects.cpp
Expand Up @@ -108,4 +108,4 @@ void TestQgsComposerEffects::transparency()
}

QTEST_MAIN( TestQgsComposerEffects )
#include "moc_testqgscomposereffects.cxx"
#include "testqgscomposereffects.moc"
2 changes: 1 addition & 1 deletion tests/src/core/testqgscomposergroup.cpp
Expand Up @@ -176,4 +176,4 @@ void TestQgsComposerGroup::undoRedo()
}

QTEST_MAIN( TestQgsComposerGroup )
#include "moc_testqgscomposergroup.cxx"
#include "testqgscomposergroup.moc"
2 changes: 1 addition & 1 deletion tests/src/core/testqgscomposerhtml.cpp
Expand Up @@ -222,4 +222,4 @@ void TestQgsComposerHtml::htmlMultiFrameSmartBreak()


QTEST_MAIN( TestQgsComposerHtml )
#include "moc_testqgscomposerhtml.cxx"
#include "testqgscomposerhtml.moc"
2 changes: 1 addition & 1 deletion tests/src/core/testqgscomposerlabel.cpp
Expand Up @@ -209,4 +209,4 @@ void TestQgsComposerLabel::marginMethods()
}

QTEST_MAIN( TestQgsComposerLabel )
#include "moc_testqgscomposerlabel.cxx"
#include "testqgscomposerlabel.moc"
2 changes: 1 addition & 1 deletion tests/src/core/testqgscomposermap.cpp
Expand Up @@ -195,4 +195,4 @@ void TestQgsComposerMap::mapPolygonVertices()
}

QTEST_MAIN( TestQgsComposerMap )
#include "moc_testqgscomposermap.cxx"
#include "testqgscomposermap.moc"
2 changes: 1 addition & 1 deletion tests/src/core/testqgscomposermapgrid.cpp
Expand Up @@ -584,4 +584,4 @@ void TestQgsComposerMapGrid::annotationFormats()


QTEST_MAIN( TestQgsComposerMapGrid )
#include "moc_testqgscomposermapgrid.cxx"
#include "testqgscomposermapgrid.moc"
2 changes: 1 addition & 1 deletion tests/src/core/testqgscomposermapoverview.cpp
Expand Up @@ -201,4 +201,4 @@ void TestQgsComposerMapOverview::overviewMapCenter()
}

QTEST_MAIN( TestQgsComposerMapOverview )
#include "moc_testqgscomposermapoverview.cxx"
#include "testqgscomposermapoverview.moc"
2 changes: 1 addition & 1 deletion tests/src/core/testqgscomposermodel.cpp
Expand Up @@ -586,4 +586,4 @@ void TestQgsComposerModel::reorderToBottomWithRemoved()
}

QTEST_MAIN( TestQgsComposerModel )
#include "moc_testqgscomposermodel.cxx"
#include "testqgscomposermodel.moc"
2 changes: 1 addition & 1 deletion tests/src/core/testqgscomposermultiframe.cpp
Expand Up @@ -349,4 +349,4 @@ void TestQgsComposerMultiFrame::undoRedoRemovedFrame()
}

QTEST_MAIN( TestQgsComposerMultiFrame )
#include "moc_testqgscomposermultiframe.cxx"
#include "testqgscomposermultiframe.moc"
2 changes: 1 addition & 1 deletion tests/src/core/testqgscomposerobject.cpp
Expand Up @@ -231,4 +231,4 @@ bool TestQgsComposerObject::renderCheck( QString testName, QImage &image, int mi
}

QTEST_MAIN( TestQgsComposerObject )
#include "moc_testqgscomposerobject.cxx"
#include "testqgscomposerobject.moc"
2 changes: 1 addition & 1 deletion tests/src/core/testqgscomposerpaper.cpp
Expand Up @@ -132,4 +132,4 @@ void TestQgsComposerPaper::markerLinePaper()
}

QTEST_MAIN( TestQgsComposerPaper )
#include "moc_testqgscomposerpaper.cxx"
#include "testqgscomposerpaper.moc"
2 changes: 1 addition & 1 deletion tests/src/core/testqgscomposerpicture.cpp
Expand Up @@ -382,4 +382,4 @@ void TestQgsComposerPicture::pictureRemoteUrl()
}

QTEST_MAIN( TestQgsComposerPicture )
#include "moc_testqgscomposerpicture.cxx"
#include "testqgscomposerpicture.moc"
2 changes: 1 addition & 1 deletion tests/src/core/testqgscomposerrotation.cpp
Expand Up @@ -224,4 +224,4 @@ void TestQgsComposerRotation::oldMapRotationApi()
#endif

QTEST_MAIN( TestQgsComposerRotation )
#include "moc_testqgscomposerrotation.cxx"
#include "testqgscomposerrotation.moc"
2 changes: 1 addition & 1 deletion tests/src/core/testqgscomposerscalebar.cpp
Expand Up @@ -171,4 +171,4 @@ void TestQgsComposerScaleBar::tick()
};

QTEST_MAIN( TestQgsComposerScaleBar )
#include "moc_testqgscomposerscalebar.cxx"
#include "testqgscomposerscalebar.moc"
2 changes: 1 addition & 1 deletion tests/src/core/testqgscomposershapes.cpp
Expand Up @@ -145,4 +145,4 @@ void TestQgsComposerShapes::symbolV2()
}

QTEST_MAIN( TestQgsComposerShapes )
#include "moc_testqgscomposershapes.cxx"
#include "testqgscomposershapes.moc"
2 changes: 1 addition & 1 deletion tests/src/core/testqgscomposertable.cpp
Expand Up @@ -506,5 +506,5 @@ void TestQgsComposerTable::attributeTableVisibleOnly()
}

QTEST_MAIN( TestQgsComposerTable )
#include "moc_testqgscomposertable.cxx"
#include "testqgscomposertable.moc"

2 changes: 1 addition & 1 deletion tests/src/core/testqgscomposertablev2.cpp
Expand Up @@ -614,5 +614,5 @@ void TestQgsComposerTableV2::removeDuplicates()
}

QTEST_MAIN( TestQgsComposerTableV2 )
#include "moc_testqgscomposertablev2.cxx"
#include "testqgscomposertablev2.moc"

2 changes: 1 addition & 1 deletion tests/src/core/testqgscomposerutils.cpp
Expand Up @@ -682,4 +682,4 @@ bool TestQgsComposerUtils::renderCheck( QString testName, QImage &image, int mis
}

QTEST_MAIN( TestQgsComposerUtils )
#include "moc_testqgscomposerutils.cxx"
#include "testqgscomposerutils.moc"
2 changes: 1 addition & 1 deletion tests/src/core/testqgscomposition.cpp
Expand Up @@ -242,5 +242,5 @@ void TestQgsComposition::pageIsEmpty()
}

QTEST_MAIN( TestQgsComposition )
#include "moc_testqgscomposition.cxx"
#include "testqgscomposition.moc"

2 changes: 1 addition & 1 deletion tests/src/core/testqgscoordinatereferencesystem.cpp
Expand Up @@ -461,4 +461,4 @@ void TestQgsCoordinateReferenceSystem::debugPrint(
}

QTEST_MAIN( TestQgsCoordinateReferenceSystem )
#include "moc_testqgscoordinatereferencesystem.cxx"
#include "testqgscoordinatereferencesystem.moc"
2 changes: 1 addition & 1 deletion tests/src/core/testqgscoordinatetransform.cpp
Expand Up @@ -62,4 +62,4 @@ void TestQgsCoordinateTransform::transformBoundingBox()
}

QTEST_MAIN( TestQgsCoordinateTransform )
#include "moc_testqgscoordinatetransform.cxx"
#include "testqgscoordinatetransform.moc"
2 changes: 1 addition & 1 deletion tests/src/core/testqgsdataitem.cpp
Expand Up @@ -167,4 +167,4 @@ void TestQgsDataItem::testDirItemChildren()
}

QTEST_MAIN( TestQgsDataItem )
#include "moc_testqgsdataitem.cxx"
#include "testqgsdataitem.moc"
2 changes: 1 addition & 1 deletion tests/src/core/testqgsdiagram.cpp
Expand Up @@ -173,4 +173,4 @@ class TestQgsDiagram: public QObject
};

QTEST_MAIN( TestQgsDiagram )
#include "moc_testqgsdiagram.cxx"
#include "testqgsdiagram.moc"
2 changes: 1 addition & 1 deletion tests/src/core/testqgsdiagramexpression.cpp
Expand Up @@ -176,4 +176,4 @@ class TestQgsDiagramExpression: public QObject
};

QTEST_MAIN( TestQgsDiagramExpression )
#include "moc_testqgsdiagramexpression.cxx"
#include "testqgsdiagramexpression.moc"
2 changes: 1 addition & 1 deletion tests/src/core/testqgsdistancearea.cpp
Expand Up @@ -162,7 +162,7 @@ void TestQgsDistanceArea::unit_conversions()
};

QTEST_MAIN( TestQgsDistanceArea )
#include "moc_testqgsdistancearea.cxx"
#include "testqgsdistancearea.moc"



Expand Down
2 changes: 1 addition & 1 deletion tests/src/core/testqgsexpression.cpp
Expand Up @@ -974,5 +974,5 @@ class TestQgsExpression: public QObject

QTEST_MAIN( TestQgsExpression )

#include "moc_testqgsexpression.cxx"
#include "testqgsexpression.moc"

2 changes: 1 addition & 1 deletion tests/src/core/testqgsgeometry.cpp
Expand Up @@ -371,5 +371,5 @@ void TestQgsGeometry::dumpPolyline( QgsPolyline &thePolyline )
}

QTEST_MAIN( TestQgsGeometry )
#include "moc_testqgsgeometry.cxx"
#include "testqgsgeometry.moc"

2 changes: 1 addition & 1 deletion tests/src/core/testqgsgeometryimport.cpp
Expand Up @@ -239,5 +239,5 @@ bool TestQgsGeometryImport::compareLineStrings( const QgsPolyline& polyline, QVa
}

QTEST_MAIN( TestQgsGeometryImport )
#include "moc_testqgsgeometryimport.cxx"
#include "testqgsgeometryimport.moc"

2 changes: 1 addition & 1 deletion tests/src/core/testqgsgradients.cpp
Expand Up @@ -287,4 +287,4 @@ bool TestQgsGradients::imageCheck( QString theTestType )
}

QTEST_MAIN( TestQgsGradients )
#include "moc_testqgsgradients.cxx"
#include "testqgsgradients.moc"
2 changes: 1 addition & 1 deletion tests/src/core/testqgsinvertedpolygonrenderer.cpp
Expand Up @@ -179,4 +179,4 @@ bool TestQgsInvertedPolygon::imageCheck( QString theTestType, const QgsRectangle
}

QTEST_MAIN( TestQgsInvertedPolygon )
#include "moc_testqgsinvertedpolygonrenderer.cxx"
#include "testqgsinvertedpolygonrenderer.moc"
2 changes: 1 addition & 1 deletion tests/src/core/testqgslegendrenderer.cpp
Expand Up @@ -251,4 +251,4 @@ void TestQgsLegendRenderer::testThreeColumns()


QTEST_MAIN( TestQgsLegendRenderer )
#include "moc_testqgslegendrenderer.cxx"
#include "testqgslegendrenderer.moc"
2 changes: 1 addition & 1 deletion tests/src/core/testqgsmaplayer.cpp
Expand Up @@ -99,4 +99,4 @@ void TestQgsMapLayer::setBlendMode()
}

QTEST_MAIN( TestQgsMapLayer )
#include "moc_testqgsmaplayer.cxx"
#include "testqgsmaplayer.moc"
2 changes: 1 addition & 1 deletion tests/src/core/testqgsmaprenderer.cpp
Expand Up @@ -195,6 +195,6 @@ void TestQgsMapRenderer::performanceTest()
}

QTEST_MAIN( TestQgsMapRenderer )
#include "moc_testqgsmaprenderer.cxx"
#include "testqgsmaprenderer.moc"


2 changes: 1 addition & 1 deletion tests/src/core/testqgsnetworkcontentfetcher.cpp
Expand Up @@ -157,4 +157,4 @@ void TestQgsNetworkContentFetcher::contentLoaded()
}

QTEST_MAIN( TestQgsNetworkContentFetcher )
#include "moc_testqgsnetworkcontentfetcher.cxx"
#include "testqgsnetworkcontentfetcher.moc"
2 changes: 1 addition & 1 deletion tests/src/core/testqgsogcutils.cpp
Expand Up @@ -347,4 +347,4 @@ void TestQgsOgcUtils::testExpressionToOgcFilter_data()


QTEST_MAIN( TestQgsOgcUtils )
#include "moc_testqgsogcutils.cxx"
#include "testqgsogcutils.moc"
2 changes: 1 addition & 1 deletion tests/src/core/testqgspoint.cpp
Expand Up @@ -534,4 +534,4 @@ void TestQgsPoint::onSegment()
}

QTEST_MAIN( TestQgsPoint )
#include "moc_testqgspoint.cxx"
#include "testqgspoint.moc"
2 changes: 1 addition & 1 deletion tests/src/core/testqgsproject.cpp
Expand Up @@ -74,4 +74,4 @@ void TestQgsProject::testReadPath()


QTEST_MAIN( TestQgsProject )
#include "moc_testqgsproject.cxx"
#include "testqgsproject.moc"
2 changes: 1 addition & 1 deletion tests/src/core/testqgsrasterfilewriter.cpp
Expand Up @@ -186,4 +186,4 @@ void TestQgsRasterFileWriter::logError( QString msg )
}

QTEST_MAIN( TestQgsRasterFileWriter )
#include "moc_testqgsrasterfilewriter.cxx"
#include "testqgsrasterfilewriter.moc"

0 comments on commit 1c2bdf1

Please sign in to comment.