Skip to content

Commit

Permalink
Switch tests to automoc
Browse files Browse the repository at this point in the history
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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