summaryrefslogtreecommitdiffstats
path: root/tests/auto/maketestselftest/tst_maketestselftest.cpp
diff options
context:
space:
mode:
authorRohan McGovern <rohan.mcgovern@nokia.com>2010-03-03 22:22:27 (GMT)
committerRohan McGovern <rohan.mcgovern@nokia.com>2010-03-03 23:20:01 (GMT)
commit9e5cc0da3cdcf3ddddc35dc78e670994237a180f (patch)
tree7a1ac34b5e1a276e3c97950b0980247a3def0147 /tests/auto/maketestselftest/tst_maketestselftest.cpp
parent0489ba37346e4f8efc4a7c1661a60905dc4aa423 (diff)
downloadQt-9e5cc0da3cdcf3ddddc35dc78e670994237a180f.zip
Qt-9e5cc0da3cdcf3ddddc35dc78e670994237a180f.tar.gz
Qt-9e5cc0da3cdcf3ddddc35dc78e670994237a180f.tar.bz2
Move tests into separate .pro files, based on Qt module.
Having the tests in separate projects allows for some optimization strategies when running the tests (e.g. start running corelib tests while the rest of Qt is still compiling), and allows developers to run only a subset of tests when appropriate.
Diffstat (limited to 'tests/auto/maketestselftest/tst_maketestselftest.cpp')
-rw-r--r--tests/auto/maketestselftest/tst_maketestselftest.cpp33
1 files changed, 19 insertions, 14 deletions
diff --git a/tests/auto/maketestselftest/tst_maketestselftest.cpp b/tests/auto/maketestselftest/tst_maketestselftest.cpp
index 1dde44b..8264e27 100644
--- a/tests/auto/maketestselftest/tst_maketestselftest.cpp
+++ b/tests/auto/maketestselftest/tst_maketestselftest.cpp
@@ -50,23 +50,27 @@ class tst_MakeTestSelfTest: public QObject
Q_OBJECT
private slots:
- void auto_dot_pro();
- void auto_dot_pro_data();
+ void tests_pro_files();
+ void tests_pro_files_data();
};
-/* Verify that all tests are listed somewhere in auto.pro */
-void tst_MakeTestSelfTest::auto_dot_pro()
+/* Verify that all tests are listed somewhere in one of the autotest .pro files */
+void tst_MakeTestSelfTest::tests_pro_files()
{
static QStringList lines;
if (lines.isEmpty()) {
- QString filename = QString::fromLatin1(SRCDIR "/../auto.pro");
- QFile file(filename);
- if (!file.open(QIODevice::ReadOnly)) {
- QFAIL(qPrintable(QString("open %1: %2").arg(filename).arg(file.errorString())));
- }
- while (!file.atEnd()) {
- lines << file.readLine().trimmed();
+ QDir dir(SRCDIR "/..");
+ QStringList proFiles = dir.entryList(QStringList() << "*.pro");
+ foreach (QString const& proFile, proFiles) {
+ QString filename = QString("%1/../%2").arg(SRCDIR).arg(proFile);
+ QFile file(filename);
+ if (!file.open(QIODevice::ReadOnly)) {
+ QFAIL(qPrintable(QString("open %1: %2").arg(filename).arg(file.errorString())));
+ }
+ while (!file.atEnd()) {
+ lines << file.readLine().trimmed();
+ }
}
}
@@ -79,13 +83,14 @@ void tst_MakeTestSelfTest::auto_dot_pro()
}
QFAIL(qPrintable(QString(
- "Subdir `%1' is missing from tests/auto/auto.pro\n"
+ "Subdir `%1' is missing from tests/auto/*.pro\n"
"This means the test won't be compiled or run on any platform.\n"
- "If this is intentional, please put the test name in a comment in auto.pro.").arg(subdir))
+ "If this is intentional, please put the test name in a comment in one of the .pro files.").arg(subdir))
);
+
}
-void tst_MakeTestSelfTest::auto_dot_pro_data()
+void tst_MakeTestSelfTest::tests_pro_files_data()
{
QTest::addColumn<QString>("subdir");
QDir dir(SRCDIR "/..");