Skip to content

Commit 461aa04

Browse files
author
timlinux
committed
test builder now makes additions to makefile properly
Added testqgsfield which has no tests in it yet git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@5222 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 6f089dc commit 461aa04

File tree

3 files changed

+35
-12
lines changed

3 files changed

+35
-12
lines changed

tests/src/core/Makefile.am

+7
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1010

1111
bin_PROGRAMS = testqgsapplication \
12+
testqgsfield \
1213
testqgssymbol
1314

1415
#
@@ -26,6 +27,7 @@ GLOBALCXXFLAGS = $(CXXFLAGS) $(EXTRA_CXXFLAGS) $(GDAL_CFLAGS) $(QT_CXXFLAGS) $(P
2627
$(MOC) -o $@ $<
2728

2829
BUILT_SOURCES = $(testqgsapplication_MOC) \
30+
$(testqgsfield_MOC) \
2931
$(testqgssymbol_MOC)
3032

3133
CLEANFILES = $(BUILT_SOURCES)
@@ -44,3 +46,8 @@ testqgssymbol_MOC = testqgssymbol.moc.cpp
4446
testqgssymbol_SOURCES = testqgssymbol.cpp
4547
testqgssymbol_LDADD = $(GLOBALLDADD)
4648
testqgssymbol_CXXFLAGS = $(GLOBALCXXFLAGS)
49+
50+
testqgsfield_MOC = testqgsfield.moc.cpp
51+
testqgsfield_SOURCES = testqgsfield.cpp
52+
testqgsfield_LDADD = $(GLOBALLDADD)
53+
testqgsfield_CXXFLAGS = $(GLOBALCXXFLAGS)

tests/src/core/test_builder.pl

+9-12
Original file line numberDiff line numberDiff line change
@@ -57,29 +57,26 @@
5757
if(/^\s*bin_PROGRAMS =*/)
5858
{
5959
# add our application binary name to the next line
60-
print MAKEFILEMOD "\\";
61-
print MAKEFILEMOD "\t\t$testClassLowerCaseName \n";
62-
}
63-
else
64-
{
6560
print MAKEFILEMOD;
61+
print MAKEFILEMOD "\t\ttest$testClassLowerCaseName \\\n";
6662
}
67-
if(/^\s*BUILT_SOURCES =*/)
63+
elsif(/^\s*BUILT_SOURCES =*/)
6864
{
6965
# add our application binary name to the next line
70-
print MAKEFILEMOD "\\";
71-
print MAKEFILEMOD "\t\t${testClassLowerCaseName}_MOC \n";
66+
print MAKEFILEMOD;
67+
print MAKEFILEMOD "\t\t\$(test${testClassLowerCaseName}_MOC) \\\n";
7268
}
7369
else
7470
{
7571
print MAKEFILEMOD;
7672
}
7773
}
7874
#before closing the file add the lines for our new test class
79-
print MAKEFILEMOD "test${testClassLowerCaseName}_MOC = test${testClassLowerCaseName}.moc.cpp";
80-
print MAKEFILEMOD "test${testClassLowerCaseName}_SOURCES = ${testClassLowerCaseName}.cpp";
81-
print MAKEFILEMOD "test${testClassLowerCaseName}_LDADD = $(GLOBALLDADD)";
82-
print MAKEFILEMOD "test${testClassLowerCaseName}_CXXFLAGS = $(GLOBALCXXFLAGS)";
75+
print MAKEFILEMOD "\n";
76+
print MAKEFILEMOD "test${testClassLowerCaseName}_MOC = test${testClassLowerCaseName}.moc.cpp\n";
77+
print MAKEFILEMOD "test${testClassLowerCaseName}_SOURCES = test${testClassLowerCaseName}.cpp\n";
78+
print MAKEFILEMOD "test${testClassLowerCaseName}_LDADD = \$(GLOBALLDADD)\n";
79+
print MAKEFILEMOD "test${testClassLowerCaseName}_CXXFLAGS = \$(GLOBALCXXFLAGS)\n";
8380

8481
# close the Makefile file handles
8582
close MAKEFILEMOD;

tests/src/core/testqgsfield.cpp

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#include <QtTest>
2+
#include <QObject>
3+
#include <QString>
4+
#include <QObject>
5+
//header for class being tested
6+
#include <qgsfield.h>
7+
8+
class TestQgsField: public QObject
9+
{
10+
Q_OBJECT;
11+
private slots:
12+
};
13+
14+
QTEST_MAIN(TestQgsField)
15+
#include "testqgsfield.moc.cpp"
16+
17+
18+
19+

0 commit comments

Comments
 (0)