Skip to content

Commit

Permalink
test builder now makes additions to makefile properly
Browse files Browse the repository at this point in the history
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
  • Loading branch information
timlinux committed Apr 8, 2006
1 parent 6f089dc commit 461aa04
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 12 deletions.
7 changes: 7 additions & 0 deletions tests/src/core/Makefile.am
Expand Up @@ -9,6 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

bin_PROGRAMS = testqgsapplication \
testqgsfield \
testqgssymbol

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

BUILT_SOURCES = $(testqgsapplication_MOC) \
$(testqgsfield_MOC) \
$(testqgssymbol_MOC)

CLEANFILES = $(BUILT_SOURCES)
Expand All @@ -44,3 +46,8 @@ testqgssymbol_MOC = testqgssymbol.moc.cpp
testqgssymbol_SOURCES = testqgssymbol.cpp
testqgssymbol_LDADD = $(GLOBALLDADD)
testqgssymbol_CXXFLAGS = $(GLOBALCXXFLAGS)

testqgsfield_MOC = testqgsfield.moc.cpp
testqgsfield_SOURCES = testqgsfield.cpp
testqgsfield_LDADD = $(GLOBALLDADD)
testqgsfield_CXXFLAGS = $(GLOBALCXXFLAGS)
21 changes: 9 additions & 12 deletions tests/src/core/test_builder.pl
Expand Up @@ -57,29 +57,26 @@
if(/^\s*bin_PROGRAMS =*/)
{
# add our application binary name to the next line
print MAKEFILEMOD "\\";
print MAKEFILEMOD "\t\t$testClassLowerCaseName \n";
}
else
{
print MAKEFILEMOD;
print MAKEFILEMOD "\t\ttest$testClassLowerCaseName \\\n";
}
if(/^\s*BUILT_SOURCES =*/)
elsif(/^\s*BUILT_SOURCES =*/)
{
# add our application binary name to the next line
print MAKEFILEMOD "\\";
print MAKEFILEMOD "\t\t${testClassLowerCaseName}_MOC \n";
print MAKEFILEMOD;
print MAKEFILEMOD "\t\t\$(test${testClassLowerCaseName}_MOC) \\\n";
}
else
{
print MAKEFILEMOD;
}
}
#before closing the file add the lines for our new test class
print MAKEFILEMOD "test${testClassLowerCaseName}_MOC = test${testClassLowerCaseName}.moc.cpp";
print MAKEFILEMOD "test${testClassLowerCaseName}_SOURCES = ${testClassLowerCaseName}.cpp";
print MAKEFILEMOD "test${testClassLowerCaseName}_LDADD = $(GLOBALLDADD)";
print MAKEFILEMOD "test${testClassLowerCaseName}_CXXFLAGS = $(GLOBALCXXFLAGS)";
print MAKEFILEMOD "\n";
print MAKEFILEMOD "test${testClassLowerCaseName}_MOC = test${testClassLowerCaseName}.moc.cpp\n";
print MAKEFILEMOD "test${testClassLowerCaseName}_SOURCES = test${testClassLowerCaseName}.cpp\n";
print MAKEFILEMOD "test${testClassLowerCaseName}_LDADD = \$(GLOBALLDADD)\n";
print MAKEFILEMOD "test${testClassLowerCaseName}_CXXFLAGS = \$(GLOBALCXXFLAGS)\n";

# close the Makefile file handles
close MAKEFILEMOD;
Expand Down
19 changes: 19 additions & 0 deletions tests/src/core/testqgsfield.cpp
@@ -0,0 +1,19 @@
#include <QtTest>
#include <QObject>
#include <QString>
#include <QObject>
//header for class being tested
#include <qgsfield.h>

class TestQgsField: public QObject
{
Q_OBJECT;
private slots:
};

QTEST_MAIN(TestQgsField)
#include "testqgsfield.moc.cpp"




0 comments on commit 461aa04

Please sign in to comment.