Skip to content

Commit 3effd9c

Browse files
committed
workaround for moc issue with app tests
1 parent 8b606ce commit 3effd9c

9 files changed

+24
-5
lines changed

src/app/qgisapp.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ class QgsDiagramProperties;
121121
#include "qgswelcomepageitemsmodel.h"
122122
#include "qgsruntimeprofiler.h"
123123

124-
125124
#include "ui_qgisapp.h"
126125

127126
#ifdef HAVE_TOUCH

tests/src/app/testqgisappclipboard.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@
1919
#include <QStringList>
2020
#include <QtTest/QtTest>
2121

22-
#include <qgisapp.h>
22+
#ifndef Q_MOC_RUN
23+
#include "qgisapp.h"
24+
#endif
25+
2326
#include <qgsapplication.h>
2427
#include <qgsfeature.h>
2528
#include <qgsfield.h>

tests/src/app/testqgisapppython.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@
1919
#include <QStringList>
2020
#include <QtTest/QtTest>
2121

22-
#include <qgisapp.h>
22+
#ifndef Q_MOC_RUN
23+
#include "qgisapp.h"
24+
#endif
25+
2326
#include <qgsapplication.h>
2427

2528
/** \ingroup UnitTests

tests/src/app/testqgsattributetable.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
* *
1414
***************************************************************************/
1515
#include <QtTest/QtTest>
16+
#ifndef Q_MOC_RUN
1617
#include "qgisapp.h"
18+
#endif
1719
#include "qgsapplication.h"
1820
#include "qgsvectorlayer.h"
1921
#include "qgsfeature.h"
@@ -25,6 +27,7 @@
2527
#include "qgsunittypes.h"
2628
#include "qgsvectorfilewriter.h"
2729

30+
2831
/** \ingroup UnitTests
2932
* This is a unit test for the attribute table dialog
3033
*/

tests/src/app/testqgsfieldcalculator.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
* *
1414
***************************************************************************/
1515
#include <QtTest/QtTest>
16+
#ifndef Q_MOC_RUN
1617
#include "qgisapp.h"
18+
#endif
1719
#include "qgsapplication.h"
1820
#include "qgsvectorlayer.h"
1921
#include "qgsfeature.h"

tests/src/app/testqgsmaptoolidentifyaction.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
***************************************************************************/
1515

1616
#include <QtTest/QtTest>
17+
#ifndef Q_MOC_RUN
18+
#include "qgisapp.h"
1719
#include "qgsapplication.h"
1820
#include "qgsvectorlayer.h"
1921
#include "qgsrasterlayer.h"
@@ -24,9 +26,9 @@
2426
#include "qgsmapcanvas.h"
2527
#include "qgsunittypes.h"
2628
#include "qgsmaptoolidentifyaction.h"
27-
#include "qgisapp.h"
2829
#include "qgsidentifymenu.h"
2930
#include "qgsidentifyresultsdialog.h"
31+
#endif
3032

3133
#include "cpl_conv.h"
3234

tests/src/app/testqgsmaptoolreshape.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,16 @@ Email : paul.blottiere@oslandia.com
1414
***************************************************************************/
1515

1616
#include <QtTest/QtTest>
17+
#ifndef Q_MOC_RUN
18+
#include "qgisapp.h"
19+
#endif
1720
#include "qgsapplication.h"
1821
#include "qgsmapcanvas.h"
1922
#include "qgsvectorlayer.h"
2023
#include "qgslinestringv2.h"
2124
#include "qgsmaptoolreshape.h"
2225
#include "qgsvectordataprovider.h"
2326
#include "qgsmaplayerregistry.h"
24-
#include "qgisapp.h"
2527

2628
class TestQgsMapToolReshape : public QObject
2729
{

tests/src/app/testqgsmeasuretool.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
* *
1414
***************************************************************************/
1515
#include <QtTest/QtTest>
16+
#ifndef Q_MOC_RUN
1617
#include "qgisapp.h"
18+
#endif
1719
#include "qgsapplication.h"
1820
#include "qgsvectorlayer.h"
1921
#include "qgsfeature.h"

tests/src/app/testqgsvectorlayersaveasdialog.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
* *
1414
***************************************************************************/
1515
#include <QtTest/QtTest>
16+
#ifndef Q_MOC_RUN
1617
#include "qgisapp.h"
18+
#endif
1719
#include "qgsapplication.h"
1820
#include "qgsvectorlayer.h"
1921
#include "qgsfeature.h"
@@ -24,6 +26,7 @@
2426
#include "qgsproject.h"
2527
#include "qgsmapcanvas.h"
2628

29+
2730
/** \ingroup UnitTests
2831
* This is a unit test for the save as dialog
2932
*/

0 commit comments

Comments
 (0)